> ## Documentation index
> Fetch the complete documentation index at: https://rankfield.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Cancel a Site Map job

> Stop a Site Map job. Items already finished stay readable for 24 hours; items not started are dropped.

`POST https://rankfield.dev/v1/map/jobs/{id}/cancel`

```bash cURL
curl -X POST 'https://rankfield.dev/v1/map/jobs/8f14e45fceea167a5a36dedd4bea2543/cancel' \
  -H 'Authorization: Bearer YOUR_API_KEY'
```

```python Python
import requests

response = requests.post(
    "https://rankfield.dev/v1/map/jobs/8f14e45fceea167a5a36dedd4bea2543/cancel",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
)
print(response.json())
```

```javascript JavaScript
const response = await fetch("https://rankfield.dev/v1/map/jobs/8f14e45fceea167a5a36dedd4bea2543/cancel", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY",
  },
});
console.log(await response.json());
```

```json 200
{
  "job": {
    "id": "8f14e45fceea167a5a36dedd4bea2543",
    "status": "canceled",
    "total": 2,
    "done": 1,
    "failed": 0,
    "createdAt": "2026-10-26T18:00:00Z",
    "finishedAt": "2026-10-26T18:00:04Z",
    "expiresAt": "2026-10-27T18:00:04Z"
  }
}
```

## Parameters

### Headers

| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| `Authorization` | string | Yes | – | `Bearer` followed by your API key. See [Authentication](/docs/get-started/authentication). |

### Path parameters

| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| `id` | string | Yes | – | The job id from [Start a Site Map job](/docs/map/start-a-job). |

## Response

The job, now `canceled`, as in [Get a Site Map job](/docs/map/get-a-job). Items already running finish; nothing new starts. A job that has already finished is returned unchanged (its status stays `done`).

## Errors

| Status | Code | When |
|---|---|---|
| 401 | `unauthorized` | No valid API key. |
| 404 |  | No job with this id for this key, or it has expired. This answer has no `code`: `{"error":{"message":"Not found"}}`. |
