# POST /jobs/{id}/cancel

Section: [Scheduled jobs](https://appengine.appmint.io/documentation/tag/scheduled-jobs.md) · Full index: https://appengine.appmint.io/documentation.md
## POST /jobs/{id}/cancel

**Cancel a running scheduled run**

`operationId: JobsController_cancel`

For a run of a recurring job (kind `scheduled:<job>`, status `running`): sets `cancelRequested`. The job checks it between items (`ctx.cancelled()`), stops after the item in hand and the run ends `cancelled`, its result counting what was done (`cancelled: true`). What was done stays done; what was left is picked up by the next run. A run whose server stopped (its lock is gone) is closed as `cancelled` at once. A run that is already over is returned as it is. Jobs that check: a2p-watch, voice-agent-sweep, ai-employee-ping, everify-refresh, broadcast-send, notification-send, service-billing, data-purge, social-sync-* (others finish their run).

#### Signature

```http
POST /jobs/{id}/cancel (id: string) -> The run's `job` record (`cancelRequested: true`; `cancelled` once it has stopped).
```

#### Access

Requires a bearer JWT (`Authorization: Bearer <token>`).

#### Errors

Plus the standard platform errors: `401`, `403`, `429`, `500`.

#### See also

- `POST /jobs/{id}/retry`
- `GET /jobs`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `orgid` | header | string | yes | Organization (tenant) identifier. Every request is scoped to this org; data from other orgs is never visible. Issued with your API credentials. |
| `id` | path | string | yes | The `job` record id (a run), from GET /jobs. |

### Responses

| Status | Meaning |
| --- | --- |
| `201` | The run's `job` record (`cancelRequested: true`; `cancelled` once it has stopped). |
| `401` | Authentication failed: Invalid or expired token — The `Authorization` header is missing, malformed, or the JWT has expired. |
| `403` | You do not have permission to perform this action — The caller is authenticated but lacks the role required by the endpoint, or is acting on another org. |
| `429` | Too Many Requests — More than 100,000 requests from one IP within 5 minutes (configurable per deployment). CORS preflights and requests from inside the platform cluster are not counted. The limiter answers before the error filter, so the body is `{ statusCode, error, message }` with no `path`, `method` or `timeStamp`; the `RateLimit-*` response headers say when the window resets. |
| `500` | An unexpected error occurred. Our team has been notified. — An unhandled server-side failure. |

