# Cancel a job before delivery. The buyer pays $0.

URL: https://services.dev/docs/examples/lingua/api/cancel_job

## Cancel a job before delivery. The buyer pays $0.

`POST /jobs/{id}/cancel` · `cancel_job`

Status: live

### Parameters

- `id` string · required: The job, as every answer names it.
- `Services-Version` string
- `Idempotency-Key` string

### Returns

- 200 job: OK.
- 400 error: BLOCKED: body_invalid, version_unknown. (not captured yet)
- 401 error: BLOCKED: key_missing, key_invalid. (not captured yet)
- 404 error: EMPTY: not_found. (not captured yet)
- 409 error: BLOCKED: not_cancelable.
- 500 error: BLOCKED: api_error. (not captured yet)

### CLI

```
$ npx services.dev cancel job_7Hq8
job_7Hq8 · canceled · buyer · $0
```

### API

```
curl -X POST http://localhost:8787/jobs/job_7Hq8/cancel
```

### MCP

```
→ tools/call cancel_job {"id":"job_7Hq8"}
← job_7Hq8 · canceled · buyer · $0
```

### SDK

```
await job.cancel()
```

### 200 job

```json
{
  "id": "job_7Hq8",
  "object": "job",
  "created": "2026-10-25T14:02:11.000Z",
  "livemode": false,
  "simulated": true,
  "service": "translation",
  "input": {
    "document": {
      "url": "https://example.com/contract.pdf",
      "name": "contract.pdf"
    },
    "to": "it"
  },
  "metadata": {},
  "price": {
    "usd": 49,
    "approved": false,
    "max_usd": 49
  },
  "payment": {
    "status": "none",
    "amount_usd": 0
  },
  "human": "AI delivers every job.",
  "stage": null,
  "steps": [
    {
      "id": "stp_1",
      "object": "step",
      "step": "draft",
      "by": "ai",
      "status": "pending"
    },
    {
      "id": "stp_2",
      "object": "step",
      "step": "review",
      "by": "ai",
      "review": "adversarial",
      "status": "pending"
    }
  ],
  "next": [],
  "status": "canceled",
  "reason": "buyer"
}
```

### 409 not_cancelable

```json
{
  "type": "BLOCKED",
  "category": "conflict",
  "code": "not_cancelable",
  "reason": "The job is already delivered. Send it back instead.",
  "next": null,
  "doc_url": "http://localhost:8787/docs/errors/not_cancelable",
  "request_id": "req_u8o3Og",
  "simulated": true
}
```
