> For a complete page index of the Captain API documentation, fetch https://docs.captain.dev/llms.txt?excludeSpec=true

# parse.cancelled

POST 

Sent when a parse job is cancelled with `DELETE /v3/parse/jobs/{job_id}`. A cancelled parse job is not billed.

Each parse job sends exactly one event, when it reaches its final status. See [Webhooks](/guides/webhooks) to add an endpoint and verify signatures.

Reference: https://docs.captain.dev/reference/webhooks/events/parse-cancelled

## Request

### Headers

- `webhook-id` (string, required) — A unique id for this message. It stays the same on every retry and resend. Deduplicate on it.
- `webhook-timestamp` (string, required) — When this attempt was sent, in Unix seconds.
- `webhook-signature` (string, required) — One or more space-separated signatures, each `v1,` followed by a base64 HMAC-SHA256 of `{webhook-id}.{webhook-timestamp}.{body}` made with the endpoint's signing secret.

### Payload

- `id` (string, required) — `evt_` followed by the job id. One event per job, so it is stable across retries.
- `type` (enum, required)
  - Allowed values: `parse.completed`, `parse.failed`, `parse.cancelled`
- `timestamp` (string, required)
- `data` (ParseWebhookEventData, required)

## Types

### ParseWebhookEventData

- `job_id` (string, required) — The parse job's id.
- `status` (enum, required) — The job's final status.
  - Allowed values: `completed`, `failed`, `cancelled`
- `source` (enum, required) — Always `api`: parse jobs are started through the API.
  - Allowed values: `api`
- `type` (enum, required) — Which parse endpoint started the job.
  - Allowed values: `document`, `spreadsheet`
- `environment` (string, required) — The environment of the API key that started the job.
- `usage` (ParseWebhookEventDataUsage, required) — What the job was billed. A failed or cancelled job bills 0 credits.
- `test` (boolean, required) — `true` only for a test event sent from the Webhooks page or the test endpoint.
- `url` (string, required) — The Get Parse Job URL for this job. Fetch it for the chunks.
- `created_at` (string, optional, nullable)
- `completed_at` (string, optional, nullable)
- `chunk_count` (integer, optional, nullable) — How many chunks the job produced. Null unless `status` is `completed`.
- `error_code` (string, optional, nullable) — Why the job failed. Null unless `status` is `failed`. Known values: `unsupported_file_type`, `download_failed`, `parse_failed`, `chunk_failed`, `assemble_failed`, `timed_out`. New values may be added.

### ParseWebhookEventDataUsage

What the job was billed. A failed or cancelled job bills 0 credits.

- `pages_basic` (integer, required)
- `pages_advanced` (integer, required)
- `credits` (double, required)