<!-- source: https://secondlayer.tools/docs/api-reference#stop-deployment -->

## Stop the active reindex or backfill

`POST /api/subgraphs/{name}/stop` (self-hosted instances only)

Takes no body. Flags the queued or running operation for cancellation; the processor stops it at its next checkpoint and marks it `cancelled`. A stopped backfill resumes from its checkpoint when the same range is queued again.

### Path parameters

| Name | Type | Description |
| --- | --- | --- |
| `name` | string, required | Subgraph name, as deployed. Lowercase letters, digits and hyphens. |

### Responses

- `200` Stop requested
- `400` A parameter, filter, cursor or body field was refused; `code` says which
- `401` This bind requires the instance token, and it was missing or wrong
- `404` No subgraph by this name (`SUBGRAPH_NOT_FOUND`), or nothing queued or running to stop (`NO_OPERATION`)
- `415` Missing or non-JSON `Content-Type` (`UNSUPPORTED_MEDIA_TYPE`) — writes must send `Content-Type: application/json`

### Example

```bash
curl -X POST http://127.0.0.1:3800/api/subgraphs/{name}/stop \
  -H "Authorization: Bearer $INSTANCE_TOKEN"
```

```json
{
  "message": "Stop requested for \"sbtc-flows\"",
  "operationId": "3f1c9a52-7d4e-4b8a-9e21-5c0d8f6a2b17",
  "status": "cancel_requested"
}
```
