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

## Get an operation

`GET /api/subgraphs/{name}/operations/{operation_id}` (self-hosted instances only)

One reindex or backfill by id. Poll it after a deploy, reindex or backfill until `status` is `completed`, `failed` or `cancelled`.

### Path parameters

| Name | Type | Description |
| --- | --- | --- |
| `name` | string, required | Subgraph name, as deployed. Lowercase letters, digits and hyphens. |
| `operation_id` | string, required | Operation id (UUID) from a deploy, reindex or backfill response, or from the operations list. |

### Returns

One `SubgraphOperation` object.

### Responses

- `200` The operation
- `401` This bind requires the instance token, and it was missing or wrong
- `404` No subgraph by this name (`SUBGRAPH_NOT_FOUND`), or no operation with this id on it (`OPERATION_NOT_FOUND`)

### Example

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

```json
{
  "id": "3f1c9a52-7d4e-4b8a-9e21-5c0d8f6a2b17",
  "subgraphName": "sbtc-flows",
  "kind": "reindex",
  "status": "running",
  "weight": "light",
  "fromBlock": 8000000,
  "toBlock": 9048712,
  "processedBlocks": null,
  "cursorBlock": null,
  "estimatedEvents": 48210,
  "processedEvents": 24105,
  "progress": 0.5,
  "error": null,
  "startedAt": "2026-09-21T09:15:04.000Z",
  "finishedAt": null,
  "createdAt": "2026-09-21T09:14:53.000Z",
  "updatedAt": "2026-09-21T09:18:37.000Z"
}
```
