Webhooks
When you create an agent with a webhook URL, Cursor will send HTTP POST requests to notify you about status changes. Currently, onlystatusChange
events are supported, specifically when an agent encounters an ERROR
or FINISHED
state.
Webhook verification
To ensure the webhook requests are authentically from Cursor, verify the signature included with each request:Headers
Each webhook request includes the following headers:X-Webhook-Signature
– Contains the HMAC-SHA256 signature in the formatsha256=<hex_digest>
X-Webhook-ID
– A unique identifier for this delivery (useful for logging)X-Webhook-Event
– The event type (currently onlystatusChange
)User-Agent
– Always set toCursor-Agent-Webhook/1.0
Signature verification
To verify the webhook signature, compute the expected signature and compare it with the received signature:Payload format
The webhook payload is sent as JSON with the following structure:Best practices
- Verify signatures – Always verify the webhook signature to ensure the request is from Cursor
- Handle retries – Webhooks may be retried if your endpoint returns an error status code
- Return quickly – Return a 2xx status code as soon as possible
- Use HTTPS – Always use HTTPS URLs for webhook endpoints in production
- Store raw payloads – Store the raw webhook payload for debugging and future verification