Skip to main content
Most tool calls that reach the web (scrapes, dataset collections, enrichment) take longer than the 25 seconds the Tool API waits, so they answer 202. Instead of polling, pass a webhook URL with the call: when the call ends, Connie POSTs its outcome there.

Ask for a webhook

Add webhook next to input when you run a tool:
  • The URL must use https, contain no username or password and be at most 2,048 characters. Otherwise the call is refused with 400 invalid_webhook and nothing runs.
  • Connie looks up the URL’s host when it accepts the call. A host on a private network, or one with no DNS address, is refused with 400 invalid_webhook and nothing runs; send the corrected call with a new Idempotency-Key. If the lookup fails for a moment, the call answers 503 webhooks_unavailable and nothing runs: send the same request again.
  • The webhook is part of the request: sending the same Idempotency-Key with a different webhook (or none) is 409 idempotency_conflict.
  • You can still poll the operation as usual. A successful call that ends within 25 seconds answers 200 with its outcome and also sends the webhook. A failed call returns its error status and sends the corresponding outcome.

What Connie sends

One POST with a JSON body, when the call ends:
data is the operation returned by GET /api/tool-invocations/{invocationId}, without replayed or chargedThisRequest. A result over 1 MiB comes as resultRef: fetch it with ?result=full. Headers on every webhook:

Verify the signature

Webhooks are signed the Standard Webhooks way, so any Standard Webhooks library verifies them. Get your workspace’s signing secret once and keep it on your server:
The signature is the base64 HMAC-SHA256 of {webhook-id}.{webhook-timestamp}.{raw body}, keyed with the base64-decoded part of the secret after whsec_. Check it against the raw body, before parsing it, and reject timestamps more than 5 minutes off.

Answer quickly, handle duplicates

  • Answer with any 2xx within 10 seconds, then do the work. Connie doesn’t read the body.
  • Retries: any other answer, a timeout or a connection error is retried after 30 seconds, 2 minutes, 10 minutes, 30 minutes, 1 hour, 2 hours, 4 hours and 8 hours (about 16 hours in all). Answer 410 Gone to stop retries for that event.
  • Redirects are not followed. Give Connie the final URL.
  • A host that can’t be looked up is retried on the same schedule. Connie stops for good only if the host now points to a private network.
  • Duplicates happen. The same event can arrive more than once: skip a webhook-id you have already handled.
  • Order isn’t guaranteed between different calls. For one call, the event’s data is its final outcome. If a call that only reads was interrupted and ran again, you may get an unknown_outcome event first and then, with a new webhook-id, the real outcome.

Rotate the secret

For the next 24 hours every webhook carries two signatures, one with each secret, so you can deploy the new secret without missing an event. The verification code above accepts either. Reading or rotating the secret needs a key that can run tools. The secret is the same for every key in the workspace.