---
title: "Get Operation Endpoint"
method: GET
path: "/v1/operations/{operation_id}"
tags: ["v1-operations"]
---

# Get Operation Endpoint

`GET /v1/operations/{operation_id}`

Return the current state of an async operation.

Polled or long-polled by clients to drive operation progress.
RLS scopes visibility to operations whose resource (connector) the
caller can read; an operation belonging to another tenant looks
like a 404 to a non-member rather than leaking existence.

Returns the AsyncOperationResponse shape — see models.py.

## Path parameters

- `operation_id` string, required

## Query parameters

- `wait` number, nullable — Optionally wait up to this many seconds for a terminal operation state. Omit for the existing immediate poll response.

## Response `200`

Current operation state. On `completed`, `result` holds the outcome — for `branch_create`, the full branch details.

- AsyncOperationResponse — Response shape for GET /v1/operations/{id}. Field set is intentionally narrow: the CLI polls this endpoint and we only expose what the CLI / future UI needs. Audit fields stay out of the response.
  - `id` string, required — Operation ID.
  - `org_id` string, required — Organization the operation belongs to.
  - `type` 'connector_engine_setup' | 'connector_reset' | 'connector_deep_reset' | 'connector_discovery' | 'connector_delete' | 'connector_secret_purge' | 'connector_rollout' | 'connector_replication_rollback' | 'connector_debezium_cutover' | 'connector_debezium_shadow_cleanup' | 'environment_deploy' | 'environment_destroy' | 'branch_create' | 'branch_delete', required — Discriminator for an async operation. Must match the async_operations_type_valid CHECK constraint in the migration — extending the set requires a migration to widen the constraint AND a worker registered in the dispatcher.
  - `resource_id` string, nullable, required — ID of the resource the operation acts on (the branch ID for branch create).
  - `status` 'pending' | 'running' | 'completed' | 'failed', required — Lifecycle status of an async operation. Mirrors the async_operations_status_valid CHECK constraint.
  - `stage` string, nullable — Raw progress token, kept for released CLIs. Read `stage_label` instead.
  - `stage_label` string, nullable — Human-readable stage; null means the operation has not started yet.
  - `progress` integer, nullable — Best-effort completion percentage. Null when no estimate is available.
  - `setup_status` object, nullable — Connector setup progress detail. Present only for connector engine setup.
  - `result` object, nullable — Result payload on completion; for branch create, includes `branch_url`.
  - `error` string, nullable — Error message when the operation failed.
  - `started_at` string, nullable — When work started. Null until then.
  - `completed_at` string, nullable — When the operation finished. Null until then.
  - `created_at` string, required — When the operation was created.
  - `updated_at` string, required — When the operation was last updated.

## Other responses

- `404` — Operation not found (or not visible to the caller).
- `422` — Validation Error

---

[API](https://skmtc.net/tryardent/apis/fastapi.md) · [All operations](https://skmtc.net/tryardent/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/tryardent/fastapi/revisions/71b66f68e19c/schema)
