Agents
Cloud Agent Webhooks: Status Notifications
When you create a Cloud Agent with a webhook URL, Cursor sends HTTP POST requests to that URL when the agent's status changes. Currently, only statusChange events are supported, sent when an agent reaches ERROR or FINISHED. You verify each request's HMAC-SHA256 signature against the raw body. Webhooks need the legacy v0 API; v1 lists them as coming soon.

On this page
When does Cursor send a Cloud Agent webhook?
Cursor sends one when an agent you created with a webhook URL encounters an ERROR state or reaches FINISHED. Each delivery is an HTTP POST to that URL. The event type is statusChange, which the docs say is currently the only one supported, and it also arrives in the X-Webhook-Event header.
That makes the signal narrow. No webhook announces that an agent started or is partway through a task, so a delivery tells you a run has ended, one way or the other. The word "currently" leaves room for more event types later, though the docs promise none.
The URL is set when you create the agent, and the webhooks page doesn't describe changing it afterwards. These are outbound notifications about an agent that already exists. To start a run from your own systems instead, an automation's webhook trigger gives you a private endpoint to POST to, covered under automations.
This is covered hands-on in Agent Mode Foundations — 6 short Units, free to read.
Rather do it than read about it? Run 11 interactive Cursor walkthroughs in a simulated editor. Free, no account needed.
Which Cloud Agents API version supports webhooks?
Only the legacy v0 API. Its Launch an Agent request (POST /v0/agents) takes an optional webhook object. webhook.url is required when you pass the object, and webhook.secret is an optional verification key of at least 32 characters. The current v1 API, in public beta, lists webhooks as coming soon.
A new integration therefore has to choose. Cursor says new integrations should use v1, and its v0 reference says v0 remains available during the migration window, without giving an end date. Until v1 adds webhooks, a v1 client can read a run's status from Get A Run, or follow Stream A Run, whose Server-Sent Events include status and result. A v1 run ends as FINISHED, ERROR, CANCELLED or EXPIRED, so a client that polls should treat all four as terminal, not only the two states that trigger a v0 webhook.
How do I verify a webhook really came from Cursor?
Recompute the signature and compare it with the one Cursor sent. Every request is signed with HMAC-SHA256, and the result arrives in the X-Webhook-Signature header as sha256=<hex_digest>. Three other headers travel with it.
- Header
X-Webhook-Signature- What it carries
- HMAC-SHA256 signature, formatted
sha256=<hex_digest>
- Header
X-Webhook-ID- What it carries
- A unique identifier for this delivery, useful for logging
- Header
X-Webhook-Event- What it carries
- The event type, currently only
statusChange
- Header
User-Agent- What it carries
- Always
Cursor-Agent-Webhook/1.0
| Header | What it carries |
|---|---|
X-Webhook-Signature | HMAC-SHA256 signature, formatted sha256=<hex_digest> |
X-Webhook-ID | A unique identifier for this delivery, useful for logging |
X-Webhook-Event | The event type, currently only statusChange |
User-Agent | Always Cursor-Agent-Webhook/1.0 |
Headers on every Cloud Agent webhook request.
Always compute the signature over the raw request body, before any parsing, as the docs instruct. The signature covers the bytes Cursor sent. A framework that parses the JSON and hands you a re-serialized copy can change spacing or key order, and a genuine request then fails the check.
Capture the body first, verify it, and only then parse.
const crypto = require("crypto"); function verifyWebhook(secret, rawBody, signature) { const expectedSignature = "sha256=" + crypto.createHmac("sha256", secret).update(rawBody).digest("hex"); return signature === expectedSignature; }
import hmac
import hashlib
def verify_webhook(secret, raw_body, signature):
expected_signature = 'sha256=' + hmac.new(
secret.encode(),
raw_body,
hashlib.sha256
).hexdigest()
return signature == expected_signatureBoth functions take three inputs (the secret, the raw body and the received signature) and return whether the signatures match. The expected value is sha256= followed by the hex digest of an HMAC-SHA256 over the raw body, keyed with the secret. The samples compare it with a plain equality check, and the docs show no other comparison method.
The webhooks page doesn't say where the secret comes from. The v0 reference does: it is the webhook.secret value you pass when you launch the agent. Because that field is optional, check that you set one. The docs don't say how a request is signed when the secret is left out.
What does the webhook payload contain?
A JSON body with the event name, a timestamp, the agent's id, its status and a summary, plus nested source and target objects. Some fields are optional and appear only when available. The docs give this example for a run that finished.
{
"event": "statusChange",
"timestamp": "2024-01-15T10:30:00Z",
"id": "bc_abc123",
"status": "FINISHED",
"source": {
"repository": "https://github.com/your-org/your-repo",
"ref": "main"
},
"target": {
"url": "https://cursor.com/agents?id=bc_abc123",
"branchName": "cursor/add-readme-1234",
"prUrl": "https://github.com/your-org/your-repo/pull/1234"
},
"summary": "Added README.md with installation instructions"
}- Field
event- Value in the docs example
statusChange
- Field
timestamp- Value in the docs example
2024-01-15T10:30:00Z
- Field
id- Value in the docs example
bc_abc123
- Field
status- Value in the docs example
FINISHED
- Field
source.repository- Value in the docs example
- A GitHub repository URL
- Field
source.ref- Value in the docs example
main
- Field
target.url- Value in the docs example
- A cursor.com/agents link for the run
- Field
target.branchName- Value in the docs example
cursor/add-readme-1234
- Field
target.prUrl- Value in the docs example
- A GitHub pull request URL
- Field
summary- Value in the docs example
- One line describing what the agent did
| Field | Value in the docs example |
|---|---|
event | statusChange |
timestamp | 2024-01-15T10:30:00Z |
id | bc_abc123 |
status | FINISHED |
source.repository | A GitHub repository URL |
source.ref | main |
target.url | A cursor.com/agents link for the run |
target.branchName | cursor/add-readme-1234 |
target.prUrl | A GitHub pull request URL |
summary | One line describing what the agent did |
Fields in the documented payload and the example value for each.
In the example, the id also appears as the id query parameter of target.url, so either one can point a person back to the run in Cursor. source records where the work started, a repository and a ref, and target records where it landed: the run's page, the branch name and a pull request URL. Because only two states trigger a delivery, expect status to read ERROR or FINISHED.
The docs don't say which fields are optional, and their example shows every field. Code that reads target.prUrl or summary should cope with a missing value.
For more than the payload carries, call the v0 Agent Status endpoint, GET /v0/agents/{id}, with the id from the delivery. It returns the same status, source, target and summary fields, plus the agent's name and createdAt.
How should my webhook endpoint behave?
Cursor's webhooks page lists five practices for the receiving side, and they are all it says about running an endpoint.
- 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.
Two of the practices concern your response. Cursor may retry a delivery when your endpoint answers with an error status, and the docs ask for a 2xx response as soon as possible. They give no timeout value, so "as soon as possible" is the only guidance.
Storing the raw payload supports verification. You need the raw bytes to recompute a signature, so a stored payload lets you check a doubtful delivery again later.
The page says webhooks may be retried after an error status. It does not say how many times, over how long, or whether a retried delivery reuses the same X-Webhook-ID.
The docs also don't say whether stopping an agent with the v0 Stop an Agent endpoint, which pauses it without deleting it, sends a delivery. If your integration depends on that, test it on one agent before you rely on it.
Frequently asked questions
Which events do Cloud Agent webhooks send?
Only statusChange events are supported at the moment. Cursor sends one when an agent encounters an ERROR state or reaches FINISHED, and the event type is repeated in the X-Webhook-Event header.
Can I register a webhook through the v1 Cloud Agents API?
Not yet. The v1 API, in public beta, lists webhooks as coming soon. The legacy v0 API supports them: pass a webhook object with a url, and optionally a secret of at least 32 characters, when you launch the agent.
How do I verify a Cursor webhook signature?
Compute an HMAC-SHA256 of the raw request body using your secret, prefix the hex digest with sha256=, and compare the result with the X-Webhook-Signature header. Use the raw body before any parsing, since a re-serialized copy can differ from what Cursor signed.
Does a Cloud Agent webhook always include every payload field?
No. The docs say some fields are optional and are included only when available, without listing which ones. The documented example has event, timestamp, id, status, source, target and summary.
Sources & last verified
- Cursor docs: Webhooks
- Cursor docs: Cloud Agents API v0 (legacy)
- Cursor docs: Cloud Agents API
- Cursor docs: Automations
Cursor ships frequently. Last updated October 28, 2026.