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

# Get Operation Status

> Poll the execution state of an async operation (withdrawal, rebalance, etc.) dispatched on a portfolio.

Returns the current lifecycle state of an operation previously dispatched
via a write endpoint such as `POST /v2/portfolios/{portfolioId}/withdraw`
or `POST /v2/portfolios/{portfolioId}/rebalance`. Use to poll for onchain
confirmation.

Operations transition through:

```
accepted → running → (completed | failed | cancelled)
              ↕
          retrying / awaiting_user
```

`completed`, `failed`, and `cancelled` are terminal — stop polling once
you see one.

* Auth: `x-api-key` header (required)
* Scope: `portfolios:read`

### Polling cadence

Poll at 2–5 second intervals. There is no SLA on when a dispatched
withdrawal confirms onchain — it depends on the target chain's block
time, bundler throughput, and paymaster availability. For withdraws,
typical end-to-end latency is under a minute on Base / Arbitrum / Polygon
and under \~30 seconds on L1 in most conditions; but pathological
conditions (RPC congestion, paymaster rebalancing) may push this higher.

### Response fields

| Field                     | Type             | Notes                                            |
| ------------------------- | ---------------- | ------------------------------------------------ |
| `operationId`             | string           | Echo of the URL param.                           |
| `portfolioId`             | string           | Echo of the URL param.                           |
| `kind`                    | string           | `withdraw`, `rebalance`, `bridge`, `swap`.       |
| `state`                   | enum             | Current lifecycle state.                         |
| `createdAt` / `updatedAt` | ISO 8601         | Operation timestamps.                            |
| `finishedAt`              | ISO 8601 or null | Set once the operation reaches a terminal state. |
| `error`                   | string or null   | Set on `failed`/`cancelled`. Free-form message.  |

Common error responses:

* `401` when `x-api-key` header is missing or the key is invalid
* `403` when the API key lacks the `portfolios:read` scope
* `404` when the portfolio doesn't exist, your API key cannot access it,
  or the `operationId` doesn't correspond to any operation on that portfolio
* `500` on unexpected server errors

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url 'https://api.glider.fi/v2/portfolios/01JWZEE2MF30KVRMRX53N88VA4/operations/op_01J_ABCDEF' \
    --header 'x-api-key: gldr_sk_your_api_key'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 — running theme={null}
  {
    "success": true,
    "data": {
      "operationId": "op_01J_ABCDEF",
      "portfolioId": "01JWZEE2MF30KVRMRX53N88VA4",
      "kind": "withdraw",
      "state": "running",
      "createdAt": "2026-04-17T12:05:00.000Z",
      "updatedAt": "2026-04-17T12:05:10.000Z",
      "finishedAt": null,
      "error": null
    }
  }
  ```

  ```json 200 — completed theme={null}
  {
    "success": true,
    "data": {
      "operationId": "op_01J_ABCDEF",
      "portfolioId": "01JWZEE2MF30KVRMRX53N88VA4",
      "kind": "withdraw",
      "state": "completed",
      "createdAt": "2026-04-17T12:05:00.000Z",
      "updatedAt": "2026-04-17T12:05:28.000Z",
      "finishedAt": "2026-04-17T12:05:28.000Z",
      "error": null
    }
  }
  ```

  ```json 404 theme={null}
  {
    "success": false,
    "error": {
      "code": "API_200",
      "message": "Portfolio or operation not found"
    }
  }
  ```
</ResponseExample>
