Supported Events
Registering a Webhook
POST /webhooks
Register a new webhook endpoint and subscribe it to one or more events.Request Body
string
required
The HTTPS URL that Agent Therapy should POST event payloads to. Must be publicly reachable and respond with a
2xx status. HTTP (non-TLS) URLs are not accepted.array
required
An array of event name strings to subscribe to. You must subscribe to at least one event. Use
["*"] to subscribe to all current and future events. Valid values: session.completed, session.failed, finding.critical, health_score.threshold_breached, intervention.applied.string
An optional secret string used to sign webhook payloads with HMAC-SHA256. Strongly recommended for production endpoints. If provided, every request will include an
X-AgentTherapy-Signature header you can use to verify authenticity. See Verifying Webhook Signatures for details.Response Fields
string
The unique identifier for this webhook registration. Prefixed with
wh_.string
The destination URL that was registered.
array
The list of events this webhook is subscribed to.
string
The webhook’s current status:
active or inactive.string
ISO 8601 timestamp indicating when the webhook was registered.
Example
Webhook Payload Format
When an event fires, Agent Therapy POSTs a JSON payload to your registered URL. Every payload follows the same envelope structure:Verifying Webhook Signatures
If you provided asecret when registering your webhook, Agent Therapy signs each payload with HMAC-SHA256 and includes the signature in the X-AgentTherapy-Signature header. Always verify this signature before processing the event to ensure the payload came from Agent Therapy and was not tampered with.
The signature is computed as:
sha256=:
Managing Webhooks
GET /webhooks
List all webhook registrations for your account.DELETE /webhooks/
Deactivate and remove a webhook registration. Agent Therapy will immediately stop sending events to the registered URL.204 No Content response with no body.