Webhooks
AgentOS notifies your systems when a run or scheduled task finishes or fails, or when an agent sends an alert, with every notification signed.
On this page
With a webhook, AgentOS notifies one of your systems when something happens: a run finishes, a scheduled task fails, or an agent sends an alert. Every notification is signed, so your system can check that it comes from AgentOS.
Create a destination#
In AgentOSWebhooksNew destination
- Address: your system's address that receives the notifications, with
https. - Notify when: the events it receives (at least one).
- Authentication: how AgentOS identifies itself to your system, on top of the signature: No authentication, Token (Bearer), Key in a header, or Username and password (Basic).
- Delivery: Retries (1 to 10 per notification), Timeout, and Stop after (the failures in a row after which sending stops).
- Click Create destination and copy the signing secret: it's shown only this once.
Then Send test sends a test notification and tells you what your system responded.
The events#
| Event | When |
|---|---|
run.completed |
A run finishes successfully |
run.failed |
A run fails |
task.completed |
A scheduled task finishes successfully |
task.failed |
A scheduled task fails |
agent.alert |
An agent sends an alert |
Each agent picks its destination in its settings, under Capabilities › Alerts to other systems (see Capabilities).
What your system receives#
A POST with a JSON body like this one:
{
"event": "run.completed",
"timestamp": "2026-12-03T14:05:09.120Z",
"delivery_id": "6f1c2d8e-4b1a-4e7f-9a51-0c3b7d2e9f10",
"version": "1.0",
"source": {
"org_id": "<organization>",
"agent_id": "<agent>",
"run_id": "<run>",
"schedule_id": null
},
"status": "success",
"result": { "llm_response": "..." },
"result_url": "<full result address>",
"payload_truncated": false
}
status is success or failure (for agent.alert, alert, with severity, message, and data in result). If the result is very large, it arrives truncated (payload_truncated), and result_url points to the run in the API (see the API reference).
Check the signature#
Every notification carries three headers:
| Header | What it holds |
|---|---|
X-AgentOS-Signature |
sha256= followed by the HMAC-SHA256 signature in hexadecimal |
X-AgentOS-Timestamp |
When it was sent, in Unix seconds |
X-AgentOS-Delivery-Id |
The delivery's identifier, so you never process the same notification twice |
The signature is computed over <timestamp>.<body> with your signing secret. In Python:
import hashlib
import hmac
import time
def is_valid(secret: str, body: bytes, timestamp: str, signature: str) -> bool:
# Rejects notifications older than 5 minutes so an old one can't be replayed
if abs(time.time() - int(timestamp)) > 300:
return False
expected = hmac.new(secret.encode(), f"{timestamp}.".encode() + body, hashlib.sha256).hexdigest()
return hmac.compare_digest(f"sha256={expected}", signature)
Use the body exactly as it arrived, without serializing it again. Respond with a 2xx code as soon as you receive it: a 5xx error or no response makes AgentOS retry it.
If sending stops#
After the failures in a row you set, the destination goes to Sending stopped. Check that your system responds and click Reopen sending. If the secret is exposed, Rotate the signing secret creates a new one and the previous one stops working immediately. The Delivery history shows every attempt with its response.