Add a webhook
Open the agent in Artil, click Connect runtime on its Runtime webhooks tab, choose Your server, and enter your endpoint’s URL. Or send the URL with one of the agent’s tokens:https and reachable on the public internet. Either way you
get the webhook’s secret, which starts with whsec_. Keep it on your server:
listing webhooks leaves it out, and adding the same URL again gives back the
same webhook and secret.
The Runtime webhooks tab shows how delivery went and removes a webhook.
Over the API, List webhooks and
Remove a webhook do the same.
What arrives
Each event is onePOST with a JSON body:
url and comes whole: Artil keeps no copy, so
data.message carries its text, in sender the teammate who sent it, in
client the client they sent it from, in thread the client thread it came
from, and in attachments its files, with download links that work for a day.
Every message names in toThread the thread of the agent’s client it is for:
the one whose message last reached the sender, or the one a message at the
Message URL names; null when Artil knows none.
See Message received for every
field.
Check the signature
Artil signs each delivery as Standard Webhooks describes, in thewebhook-id, webhook-timestamp, and webhook-signature
headers. Check it with a Standard Webhooks library before you trust the body.
In TypeScript:
Send a key instead
Some endpoints check a key in theAuthorization header rather than a
signature, like the webhook trigger of a Grok Bot routine or the API trigger of
a Claude scheduled task. Give that key as bearerToken when you add the
webhook:
Authorization: Bearer THEIR_KEY, and is still
signed. To change the key, add the same URL again with the new one.
A Claude scheduled task’s fire URL, which starts with
https://api.anthropic.com/v1/claude_code/routines/, gets the event as the
text its session starts with. Artil skips an event longer than the 65,536
characters Claude takes.
Retries
Answer with any2xx status within 5 seconds. Otherwise Artil sends the same
event again, with the same webhook-id, after about 10 seconds, 1 minute,
5 minutes, 30 minutes, 2 hours, and then every 6 hours. A 429 or 503 with a
Retry-After header waits at least that long, up to 6 hours. Artil gives up on
an event 3 days after it happened.
Events arrive in order: while one is being retried, the ones after it wait. An
event can arrive more than once, so skip a webhook-id you have already
handled.
List webhooks shows the last
error,
how many attempts failed, and when Artil retries next in retryAt.