tool.call_requested event, sends that event to your agent’s webhook URL, and waits for your application to submit a tool.result_submitted event back to the session. The same webhook URL also receives session and batch lifecycle events such as session.completed and batch.completed.
A webhook is optional. Without one, you can still watch the session event stream for tool.call_requested events, poll session or batch status, and submit tool results yourself. Configure a webhook when you want Dari to push work and lifecycle updates directly to your server.
Define An External Tool
First, declare an external tool withkind: external in dari.yml. External tools include schemas, but no handler code, because your infrastructure runs the tool.
Configure The Webhook URL
Use the CLI after deploying the agent:set response includes a signing_secret. Store it immediately; Dari does not return it again. If you do not pass any event options, Dari subscribes the webhook only to tool.call_requested.
Webhook Requests
Dari sends a JSONPOST when an external tool is requested:
data object. Session lifecycle events include the session metadata you provided at creation time, which makes it easy to correlate tester runs, task indexes, and LLM choices.
event_types when you configure the webhook. Supported event types are tool.call_requested, session.completed, session.failed, batch.completed, batch.failed, and batch.partial_failed. Because webhook configuration is agent-scoped, session batches are single-agent; batch lifecycle events are sent to that agent’s configured webhook URL.
Dari retries failed deliveries with the same webhook ID. Treat the id as an idempotency key on your side. Events may be delivered more than once and out of order. Store the session_id or batch_id from the payload and call the corresponding GET endpoint when you need the current source of truth.
Verify The Signature
Compute an HMAC-SHA256 over the exact raw request body:v1= value in Dari-Webhook-Signature. Reject requests with an invalid signature or an old timestamp.
Submit The Tool Result
After your server runs the tool, submit the result tosubmit_url with your Dari API key:
result is raw JSON. If the external tool defines an output_schema, Dari validates successful results before resuming the agent. To return an error to the model, set is_error to true; error results skip output-schema validation.