# Read a page of sync snapshot rows

- **OpenAPI Version:** `3.2.0`
- **API Version:** `3.1.0`
- **Contact:** Syndai <https://syndai.ai>

## Contents

**Operations**

- [GET /api/v1/external/coding/sync/snapshot](#scalar-operation-get-apiv1externalcodingsyncsnapshot)

**Schemas**

- [SyncSnapshotResponse](#scalar-schema-syncsnapshotresponse)
- [ProblemDetail](#scalar-schema-problemdetail)
- [ExternalErrorCode](#scalar-schema-externalerrorcode)

<a id="scalar-context-global-servers"></a>

## Servers

- **URL:** `https://api.syndai.ai`

<a id="scalar-context-global-authentication"></a>

## Authentication

- **CustomerApiKey**: HTTP bearer (`API Key`)

  Customer API key sent as a bearer token

## Tags

### Account

The API key you are calling with and the workspace it belongs to. Read the key's identity and scopes, revoke it, or page through a snapshot of the workspace's runs, projects and threads to seed a local mirror.

## Operations

<a id="scalar-operation-get-apiv1externalcodingsyncsnapshot"></a>

### Read a page of sync snapshot rows

- **Method:** `GET`
- **Path:** `/api/v1/external/coding/sync/snapshot`
- **Operation ID:** `getSyncSnapshot`
- **Tags:** Account

One keyset page of a sync entity's rows for the caller, the sync hydrate for `coding_run`, `coding_project` and `coding_thread_item`. `customer_id` is required. `rows` have exactly the shape of a sync delta's `data` for that entity. `versions` maps a row id to its sync version (the row's highest sync event sequence, read in the same statement as the row; a row with no sync event is omitted): apply a later delta for that row only when its sequence is higher. Server-owned ordering: newest created\_at, then id descending. `limit` is the page size (default 200, clamped to 1..500). Pass the prior response's opaque `next_cursor` as `after`; `next_cursor` is null at the end. The first page (no `after`) carries `resume`: the caller's event-stream position read before the page; open `/api/v1/events/stream?after=<resume>` to receive every change since. `resume` is null on later pages and when the stream is unavailable.

**Servers:** [Inherited servers](#scalar-context-global-servers)

**Authentication:** [Global authentication](#scalar-context-global-authentication)

#### Query parameters

- **`entity` (required)**: `string`, possible values: `"coding_run", "coding_project", "coding_thread_item"`
- **`customer_id` (required)**: `string`, format: `uuid`
- **`after`**: `string | null`
- **`limit`**: `integer`, default: `200`

#### Responses

##### 200 Request fulfilled, document follows

**Content type:** `application/json`

[SyncSnapshotResponse](#scalar-schema-syncsnapshotresponse)

<a id="scalar-example-1"></a>

**Generated example:**

```json
{
  "next_cursor": "",
  "resume": "",
  "rows": [
    {
      "additionalProperty": "anything"
    }
  ],
  "versions": {
    "additionalProperty": 1
  }
}
```

##### 400, 401, 403, 404

- `400` Bad request syntax or unsupported method
- `401` Invalid or missing customer API key
- `403` Insufficient scope or forbidden customer access
- `404` Resource not found

**Content type:** `application/problem+json`

[ProblemDetail](#scalar-schema-problemdetail)

RFC 7807 problem detail returned for public CaaS errors.

<a id="scalar-example-2"></a>

**Generated example:**

```json
{
  "code": "BUDGET_EXHAUSTED",
  "detail": null,
  "existing_run_id": null,
  "instance": null,
  "status": 1,
  "title": "",
  "type": "about:blank",
  "additionalProperty": "anything"
}
```

##### 429 Rate limit exceeded

**Headers:**

- **`Retry-After`**

  Seconds to wait before retrying the request

  `integer`

**Content type:** `application/problem+json`

[ProblemDetail](#scalar-schema-problemdetail)

RFC 7807 problem detail returned for public CaaS errors.

[Generated example](#scalar-example-2)

##### default Unexpected error

**Content type:** `application/problem+json`

[ProblemDetail](#scalar-schema-problemdetail)

<a id="scalar-example-3"></a>

**Generated example:**

```json
null
```

## Schemas

<a id="scalar-schema-syncsnapshotresponse"></a>

### SyncSnapshotResponse

**Type:** `object`

- **`rows` (required)**: `array of object`
- **`versions` (required)**: `object`

  **Additional properties:**

  `integer`
- **`next_cursor`**: `string | null`
- **`resume`**: `string | null`

<a id="scalar-example-4"></a>

**Generated example:**

```json
{
  "next_cursor": "",
  "resume": "",
  "rows": [
    {
      "additionalProperty": "anything"
    }
  ],
  "versions": {
    "additionalProperty": 1
  }
}
```

<a id="scalar-schema-problemdetail"></a>

### ProblemDetail

**Type:** `object`

RFC 7807 problem detail returned for public CaaS errors.

- **`code` (required)**: `string`, possible values: `"BUDGET_EXHAUSTED", "QUOTA_EXCEEDED", "RUN_CONCURRENCY_LIMIT", "CUSTOMER_DISABLED", "REPO_NOT_BOUND", "IDEMPOTENCY_REPLAY", "CONFLICT", "MISSION_BUSY_RETRY", "HITL_REQUEST_CONFLICT", "HITL_REQUEST_SETTLED", "RUN_TERMINATED_BEFORE_RESPONSE", "INVALID_POLICY", "INVALID_SCOPE", "RATE_LIMITED", "INSTALLATION_INCOMPLETE", "SUBSCRIPTION_USAGE_UNAVAILABLE", "INVALID_TOKEN", "ROLE_REQUIRED", "PLAN_UPGRADE_REQUIRED", "EMAIL_MISMATCH", "EXPIRED_TOKEN", "NOT_FOUND", "OVERSCOPE_ACK_REQUIRED", "VERIFY_FAILED", "PUBLISH_IN_FLIGHT", "PUBLISH_UNSUPPORTED_REPO", "PUBLICATION_NOT_LIVE", "NO_APP_DATA", "FEATURE_REQUESTS_NEEDS_MEMBERS", "EMPTY_UPDATE", "BAD_CURSOR", "HUMAN_APPROVAL_REQUIRED", "PROTECTED_PATHS_MANAGED_ONLY", "RUN_IN_FLIGHT", "TEXT_EDIT_REFUSED", "CLI_UPGRADE_REQUIRED", "PRODUCTION_STEP_UP_REQUIRED", "PRICES_UPDATING", "GITHUB_UNAVAILABLE", "PUBLISH_NOT_SET_UP", "VERSION_NOT_DEPLOYED", "INTERNAL_ERROR"`

  Stable error codes surfaced to public CaaS clients.
- **`status` (required)**: `integer`
- **`title` (required)**: `string`
- **`detail`**: `string | null`, default: `null`
- **`existing_run_id`**: `string | null`, default: `null`
- **`instance`**: `string | null`, default: `null`
- **`type`**: `string`, default: `"about:blank"`

<a id="scalar-example-5"></a>

**Generated example:**

```json
{
  "code": "BUDGET_EXHAUSTED",
  "detail": null,
  "existing_run_id": null,
  "instance": null,
  "status": 1,
  "title": "",
  "type": "about:blank",
  "additionalProperty": "anything"
}
```

<a id="scalar-schema-externalerrorcode"></a>

### ExternalErrorCode

**Type:** `string`, possible values: `"BUDGET_EXHAUSTED", "QUOTA_EXCEEDED", "RUN_CONCURRENCY_LIMIT", "CUSTOMER_DISABLED", "REPO_NOT_BOUND", "IDEMPOTENCY_REPLAY", "CONFLICT", "MISSION_BUSY_RETRY", "HITL_REQUEST_CONFLICT", "HITL_REQUEST_SETTLED", "RUN_TERMINATED_BEFORE_RESPONSE", "INVALID_POLICY", "INVALID_SCOPE", "RATE_LIMITED", "INSTALLATION_INCOMPLETE", "SUBSCRIPTION_USAGE_UNAVAILABLE", "INVALID_TOKEN", "ROLE_REQUIRED", "PLAN_UPGRADE_REQUIRED", "EMAIL_MISMATCH", "EXPIRED_TOKEN", "NOT_FOUND", "OVERSCOPE_ACK_REQUIRED", "VERIFY_FAILED", "PUBLISH_IN_FLIGHT", "PUBLISH_UNSUPPORTED_REPO", "PUBLICATION_NOT_LIVE", "NO_APP_DATA", "FEATURE_REQUESTS_NEEDS_MEMBERS", "EMPTY_UPDATE", "BAD_CURSOR", "HUMAN_APPROVAL_REQUIRED", "PROTECTED_PATHS_MANAGED_ONLY", "RUN_IN_FLIGHT", "TEXT_EDIT_REFUSED", "CLI_UPGRADE_REQUIRED", "PRODUCTION_STEP_UP_REQUIRED", "PRICES_UPDATING", "GITHUB_UNAVAILABLE", "PUBLISH_NOT_SET_UP", "VERSION_NOT_DEPLOYED", "INTERNAL_ERROR"`

Stable error codes surfaced to public CaaS clients.
