---
title: "Синхронизация и экспорт"
description: "Синхронизации Context4: источники, доступные сущности, запуски и выгрузки данных через публичный API."
group: "Техническая документация"
order: 35
---

## Адреса этого стенда

- Документация: https://context4.me/docs.md
- Индекс для агента: https://context4.me/docs/agent-index.json
- Консоль и подключения: https://console.context4.me/integrations
- MCP: https://context4.me/mcp
- HTTP API: https://context4.me/v1
- Composio base URL: https://context4.me/compat/context4/v1
- OpenAPI: https://context4.me/docs/openapi.json
- Каталог HTTP/MCP: https://context4.me/docs/api-index.json
- Маршруты Composio: https://context4.me/docs/compat-routes.json
- Коннекторы: https://context4.me/docs/connectors.json


# Синхронизация и экспорт

Сгенерировано из публичного OpenAPI Context4. Авторизация: `Authorization: Bearer` с API-ключом. Общие правила — [API](https://context4.me/docs/api.md). Полный контракт — [OpenAPI JSON](https://context4.me/docs/openapi.json). В JSON ниже `$ref` указывает на именованную схему из раздела «Схемы».

## getSyncDeliveryAuthority

`GET /v1/syncs/{syncId}/delivery-authority`

URL этого стенда: `https://context4.me/v1/syncs/{syncId}/delivery-authority`. Параметры в фигурных скобках заменяются фактическими ID из API.

Read the tenant-scoped delivery grant fence for a sync resource

Полномочие: `syncs:read`.

### Параметры

| Имя | Где | Обязателен | Тип и ограничения |
| --- | --- | --- | --- |
| `syncId` | path | да | &#123;"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"&#125;  |
| `entity` | query | да | &#123;"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]&#123;0,79&#125;$"&#125;  |

### Ответы и ошибки

| HTTP | Значение | Формат и схема |
| --- | --- | --- |
| 200 | Persisted delivery grants and source lineage without credentials | `application/json` [SyncDeliveryAuthority](https://context4.me/docs/api-schemas-3.md#syncdeliveryauthority) |
| 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |

Заголовки успешного ответа:
```json
{
  "X-Request-Id": {
    "description": "Correlation id echoed on every response",
    "schema": {
      "type": "string"
    }
  },
  "RateLimit-Limit": {
    "description": "Per-key request limit for the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Remaining": {
    "description": "Requests remaining in the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Reset": {
    "description": "Seconds until the current window resets",
    "schema": {
      "type": "integer"
    }
  }
}
```

## createSync

`POST /v1/syncs`

URL этого стенда: `https://context4.me/v1/syncs`. Параметры в фигурных скобках заменяются фактическими ID из API.

Create a sync binding a connection to a syncable entity

Полномочие: `syncs:write`.

### Параметры

| Имя | Где | Обязателен | Тип и ограничения |
| --- | --- | --- | --- |
| `Idempotency-Key` | header | нет | &#123;"type":"string"&#125; Required when source_kind is database_poll; retries with the same key and payload return the original sync. Optional for other source kinds. |

### Тело запроса

Обязательно. 

```json
{
  "required": true,
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "connection_id": {
            "type": "string",
            "format": "uuid",
            "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"
          },
          "source_kind": {
            "type": "string",
            "enum": [
              "api_poll",
              "database_cdc",
              "database_poll",
              "topic"
            ]
          },
          "database_poll": {
            "type": "object",
            "properties": {
              "schema": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "table": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "columns": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                },
                "minItems": 1,
                "maxItems": 256
              },
              "primary_key": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 128
                },
                "minItems": 1,
                "maxItems": 16
              },
              "mode": {
                "type": "string",
                "enum": [
                  "full_scan",
                  "rowversion",
                  "timestamp"
                ]
              },
              "watermark_column": {
                "type": [
                  "string",
                  "null"
                ],
                "minLength": 1,
                "maxLength": 128
              },
              "full_reconciliation_minutes": {
                "type": "integer",
                "minimum": 1,
                "maximum": 10080
              },
              "timestamp_overlap_seconds": {
                "type": "integer",
                "minimum": 0,
                "maximum": 86400
              },
              "deletion_policy": {
                "type": "string",
                "enum": [
                  "preserve",
                  "confirm_missing"
                ]
              }
            },
            "required": [
              "schema",
              "table",
              "columns",
              "primary_key"
            ],
            "additionalProperties": false
          },
          "entity": {
            "type": "string",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,79}$"
          },
          "schedule_minutes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10080
          }
        },
        "required": [
          "connection_id",
          "entity"
        ],
        "additionalProperties": false
      }
    }
  }
}
```

### Ответы и ошибки

| HTTP | Значение | Формат и схема |
| --- | --- | --- |
| 201 | The created sync; acquisition and initial loading follow the provider capabilities | `application/json` [Sync](https://context4.me/docs/api-schemas-3.md#sync) |
| 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 403 | Problem (capability_missing, forbidden) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 409 | Problem (conflict) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 429 | Problem (rate_limited, quota_exceeded) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |

Заголовки успешного ответа:
```json
{
  "X-Request-Id": {
    "description": "Correlation id echoed on every response",
    "schema": {
      "type": "string"
    }
  },
  "RateLimit-Limit": {
    "description": "Per-key request limit for the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Remaining": {
    "description": "Requests remaining in the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Reset": {
    "description": "Seconds until the current window resets",
    "schema": {
      "type": "integer"
    }
  }
}
```

## listSyncs

`GET /v1/syncs`

URL этого стенда: `https://context4.me/v1/syncs`. Параметры в фигурных скобках заменяются фактическими ID из API.

List syncs in the workspace

Полномочие: `syncs:read`.

### Параметры

| Имя | Где | Обязателен | Тип и ограничения |
| --- | --- | --- | --- |
| `cursor` | query | нет | &#123;"type":"string","minLength":1,"maxLength":400,"pattern":"^[A-Za-z0-9_-]+$","description":"Opaque pagination cursor from a previous response"&#125; Opaque pagination cursor from a previous response |
| `limit` | query | нет | &#123;"type":"integer","minimum":1,"maximum":100,"description":"Page size (1-100, default 25)"&#125; Page size (1-100, default 25) |
| `connection_id` | query | нет | &#123;"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"&#125;  |

### Ответы и ошибки

| HTTP | Значение | Формат и схема |
| --- | --- | --- |
| 200 | One page of syncs with the continuation cursor | `application/json` [SyncList](https://context4.me/docs/api-schemas-3.md#synclist) |
| 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |

Заголовки успешного ответа:
```json
{
  "X-Request-Id": {
    "description": "Correlation id echoed on every response",
    "schema": {
      "type": "string"
    }
  },
  "RateLimit-Limit": {
    "description": "Per-key request limit for the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Remaining": {
    "description": "Requests remaining in the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Reset": {
    "description": "Seconds until the current window resets",
    "schema": {
      "type": "integer"
    }
  }
}
```

## getSync

`GET /v1/syncs/{syncId}`

URL этого стенда: `https://context4.me/v1/syncs/{syncId}`. Параметры в фигурных скобках заменяются фактическими ID из API.

Get one sync

Полномочие: `syncs:read`.

### Параметры

| Имя | Где | Обязателен | Тип и ограничения |
| --- | --- | --- | --- |
| `syncId` | path | да | &#123;"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"&#125;  |

### Ответы и ошибки

| HTTP | Значение | Формат и схема |
| --- | --- | --- |
| 200 | The sync view | `application/json` [Sync](https://context4.me/docs/api-schemas-3.md#sync) |
| 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |

Заголовки успешного ответа:
```json
{
  "X-Request-Id": {
    "description": "Correlation id echoed on every response",
    "schema": {
      "type": "string"
    }
  },
  "RateLimit-Limit": {
    "description": "Per-key request limit for the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Remaining": {
    "description": "Requests remaining in the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Reset": {
    "description": "Seconds until the current window resets",
    "schema": {
      "type": "integer"
    }
  }
}
```

## patchSync

`PATCH /v1/syncs/{syncId}`

URL этого стенда: `https://context4.me/v1/syncs/{syncId}`. Параметры в фигурных скобках заменяются фактическими ID из API.

Pause, resume, or update the schedule of a sync

Полномочие: `syncs:write`.

### Параметры

| Имя | Где | Обязателен | Тип и ограничения |
| --- | --- | --- | --- |
| `syncId` | path | да | &#123;"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"&#125;  |

### Тело запроса

Обязательно. 

```json
{
  "required": true,
  "content": {
    "application/json": {
      "schema": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "action": {
                "type": "string",
                "enum": [
                  "pause",
                  "resume"
                ]
              }
            },
            "required": [
              "action"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "action": {
                "type": "string",
                "enum": [
                  "update_schedule"
                ]
              },
              "schedule_minutes": {
                "type": "integer",
                "minimum": 1,
                "maximum": 10080
              },
              "full_reconciliation_minutes": {
                "type": "integer",
                "minimum": 1,
                "maximum": 10080
              },
              "deletion_policy": {
                "type": "string",
                "enum": [
                  "preserve"
                ]
              },
              "expected_config_revision": {
                "type": "integer",
                "exclusiveMinimum": 0
              }
            },
            "required": [
              "action",
              "schedule_minutes",
              "expected_config_revision"
            ],
            "additionalProperties": false
          }
        ]
      }
    }
  }
}
```

### Ответы и ошибки

| HTTP | Значение | Формат и схема |
| --- | --- | --- |
| 200 | The updated sync view | `application/json` [Sync](https://context4.me/docs/api-schemas-3.md#sync) |
| 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 409 | Problem (conflict) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |

Заголовки успешного ответа:
```json
{
  "X-Request-Id": {
    "description": "Correlation id echoed on every response",
    "schema": {
      "type": "string"
    }
  },
  "RateLimit-Limit": {
    "description": "Per-key request limit for the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Remaining": {
    "description": "Requests remaining in the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Reset": {
    "description": "Seconds until the current window resets",
    "schema": {
      "type": "integer"
    }
  }
}
```

## deleteSync

`DELETE /v1/syncs/{syncId}`

URL этого стенда: `https://context4.me/v1/syncs/{syncId}`. Параметры в фигурных скобках заменяются фактическими ID из API.

Delete a sync (record history stays pullable)

Полномочие: `syncs:write`.

### Параметры

| Имя | Где | Обязателен | Тип и ограничения |
| --- | --- | --- | --- |
| `syncId` | path | да | &#123;"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"&#125;  |

### Ответы и ошибки

| HTTP | Значение | Формат и схема |
| --- | --- | --- |
| 200 | The deleted sync view | `application/json` [Sync](https://context4.me/docs/api-schemas-3.md#sync) |
| 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 409 | Problem (conflict) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |

Заголовки успешного ответа:
```json
{
  "X-Request-Id": {
    "description": "Correlation id echoed on every response",
    "schema": {
      "type": "string"
    }
  },
  "RateLimit-Limit": {
    "description": "Per-key request limit for the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Remaining": {
    "description": "Requests remaining in the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Reset": {
    "description": "Seconds until the current window resets",
    "schema": {
      "type": "integer"
    }
  }
}
```

## testFireSync

`POST /v1/syncs/test-fire`

URL этого стенда: `https://context4.me/v1/syncs/test-fire`. Параметры в фигурных скобках заменяются фактическими ID из API.

Synchronously probe a bounded record sample without persisting anything

Полномочие: `syncs:write`.

Дополнительных параметров в контракте нет.

### Тело запроса

Обязательно. 

```json
{
  "required": true,
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "connection_id": {
            "type": "string",
            "format": "uuid",
            "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"
          },
          "entity": {
            "type": "string",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,79}$"
          },
          "sample_limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 50
          }
        },
        "required": [
          "connection_id",
          "entity"
        ],
        "additionalProperties": false
      }
    }
  }
}
```

### Ответы и ошибки

| HTTP | Значение | Формат и схема |
| --- | --- | --- |
| 200 | Normalized sample records plus the estimated total volume | `application/json` [SyncTestFire](https://context4.me/docs/api-schemas-3.md#synctestfire) |
| 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 503 | Problem (service_unavailable, provider_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |

Заголовки успешного ответа:
```json
{
  "X-Request-Id": {
    "description": "Correlation id echoed on every response",
    "schema": {
      "type": "string"
    }
  },
  "RateLimit-Limit": {
    "description": "Per-key request limit for the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Remaining": {
    "description": "Requests remaining in the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Reset": {
    "description": "Seconds until the current window resets",
    "schema": {
      "type": "integer"
    }
  }
}
```

## triggerSyncRun

`POST /v1/syncs/{syncId}/trigger`

URL этого стенда: `https://context4.me/v1/syncs/{syncId}/trigger`. Параметры в фигурных скобках заменяются фактическими ID из API.

Enqueue a manual run

Полномочие: `syncs:write`.

### Параметры

| Имя | Где | Обязателен | Тип и ограничения |
| --- | --- | --- | --- |
| `Idempotency-Key` | header | нет | &#123;"type":"string"&#125; Required when the sync source_kind is database_poll; retries with the same key return the original run. Optional for other source kinds. |
| `syncId` | path | да | &#123;"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"&#125;  |

### Ответы и ошибки

| HTTP | Значение | Формат и схема |
| --- | --- | --- |
| 202 | The sync view with the planned run enqueued | `application/json` [Sync](https://context4.me/docs/api-schemas-3.md#sync) |
| 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 409 | Problem (conflict). The source does not support a manual refresh, or a run is already active | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |

Заголовки успешного ответа:
```json
{
  "X-Request-Id": {
    "description": "Correlation id echoed on every response",
    "schema": {
      "type": "string"
    }
  },
  "RateLimit-Limit": {
    "description": "Per-key request limit for the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Remaining": {
    "description": "Requests remaining in the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Reset": {
    "description": "Seconds until the current window resets",
    "schema": {
      "type": "integer"
    }
  }
}
```

## listSyncRuns

`GET /v1/syncs/{syncId}/runs`

URL этого стенда: `https://context4.me/v1/syncs/{syncId}/runs`. Параметры в фигурных скобках заменяются фактическими ID из API.

Run history with per-change-type counters and error causes

Полномочие: `syncs:read`.

### Параметры

| Имя | Где | Обязателен | Тип и ограничения |
| --- | --- | --- | --- |
| `syncId` | path | да | &#123;"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"&#125;  |
| `cursor` | query | нет | &#123;"type":"string","minLength":1,"maxLength":400,"pattern":"^[A-Za-z0-9_-]+$","description":"Opaque pagination cursor from a previous response"&#125; Opaque pagination cursor from a previous response |
| `limit` | query | нет | &#123;"type":"integer","minimum":1,"maximum":100,"description":"Page size (1-100, default 25)"&#125; Page size (1-100, default 25) |

### Ответы и ошибки

| HTTP | Значение | Формат и схема |
| --- | --- | --- |
| 200 | One page of runs with the continuation cursor | `application/json` [SyncRunList](https://context4.me/docs/api-schemas-3.md#syncrunlist) |
| 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |

Заголовки успешного ответа:
```json
{
  "X-Request-Id": {
    "description": "Correlation id echoed on every response",
    "schema": {
      "type": "string"
    }
  },
  "RateLimit-Limit": {
    "description": "Per-key request limit for the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Remaining": {
    "description": "Requests remaining in the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Reset": {
    "description": "Seconds until the current window resets",
    "schema": {
      "type": "integer"
    }
  }
}
```

## pullSyncRecords

`GET /v1/syncs/{syncId}/records`

URL этого стенда: `https://context4.me/v1/syncs/{syncId}/records`. Параметры в фигурных скобках заменяются фактическими ID из API.

Cursor-paged record change stream (the pull door onto the broker stream)

Полномочие: `syncs:read`.

### Параметры

| Имя | Где | Обязателен | Тип и ограничения |
| --- | --- | --- | --- |
| `syncId` | path | да | &#123;"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"&#125;  |
| `cursor` | query | нет | &#123;"type":"string","minLength":1,"maxLength":400,"pattern":"^[A-Za-z0-9_-]+$","description":"Opaque pagination cursor from a previous response"&#125; Opaque pagination cursor from a previous response |
| `limit` | query | нет | &#123;"type":"integer","minimum":1,"maximum":100,"description":"Page size (1-100, default 25)"&#125; Page size (1-100, default 25) |

### Ответы и ошибки

| HTTP | Значение | Формат и схема |
| --- | --- | --- |
| 200 | One page of record changes ordered by modification cursor | `application/json` [SyncRecordList](https://context4.me/docs/api-schemas-4.md#syncrecordlist) |
| 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 409 | Problem (conflict) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |

Заголовки успешного ответа:
```json
{
  "X-Request-Id": {
    "description": "Correlation id echoed on every response",
    "schema": {
      "type": "string"
    }
  },
  "RateLimit-Limit": {
    "description": "Per-key request limit for the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Remaining": {
    "description": "Requests remaining in the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Reset": {
    "description": "Seconds until the current window resets",
    "schema": {
      "type": "integer"
    }
  }
}
```

## replaySyncRecords

`POST /v1/syncs/{syncId}/replay`

URL этого стенда: `https://context4.me/v1/syncs/{syncId}/replay`. Параметры в фигурных скобках заменяются фактическими ID из API.

Replay dead-lettered record deliveries for a sync

Полномочие: `syncs:write`.

### Параметры

| Имя | Где | Обязателен | Тип и ограничения |
| --- | --- | --- | --- |
| `syncId` | path | да | &#123;"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"&#125;  |

### Ответы и ошибки

| HTTP | Значение | Формат и схема |
| --- | --- | --- |
| 200 | The number of records reset for republication | `application/json` [SyncReplay](https://context4.me/docs/api-schemas-4.md#syncreplay) |
| 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |

Заголовки успешного ответа:
```json
{
  "X-Request-Id": {
    "description": "Correlation id echoed on every response",
    "schema": {
      "type": "string"
    }
  },
  "RateLimit-Limit": {
    "description": "Per-key request limit for the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Remaining": {
    "description": "Requests remaining in the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Reset": {
    "description": "Seconds until the current window resets",
    "schema": {
      "type": "integer"
    }
  }
}
```

## listSyncableEntities

`GET /v1/connectors/{connectorId}/syncable-entities`

URL этого стенда: `https://context4.me/v1/connectors/{connectorId}/syncable-entities`. Параметры в фигурных скобках заменяются фактическими ID из API.

Entities the catalog declares syncable for a connector

Полномочие: `syncs:read`.

### Параметры

| Имя | Где | Обязателен | Тип и ограничения |
| --- | --- | --- | --- |
| `connectorId` | path | да | &#123;"type":"string","pattern":"^[a-z0-9][a-z0-9-]&#123;1,78&#125;$","example":"bitrix24"&#125;  |

### Ответы и ошибки

| HTTP | Значение | Формат и схема |
| --- | --- | --- |
| 200 | Syncable entities with strategy and default schedule | `application/json` [SyncableEntityList](https://context4.me/docs/api-schemas-4.md#syncableentitylist) |
| 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |

Заголовки успешного ответа:
```json
{
  "X-Request-Id": {
    "description": "Correlation id echoed on every response",
    "schema": {
      "type": "string"
    }
  },
  "RateLimit-Limit": {
    "description": "Per-key request limit for the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Remaining": {
    "description": "Requests remaining in the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Reset": {
    "description": "Seconds until the current window resets",
    "schema": {
      "type": "integer"
    }
  }
}
```

## getSyncDeliveryCapabilities

`GET /v1/sync-delivery-capabilities`

URL этого стенда: `https://context4.me/v1/sync-delivery-capabilities`. Параметры в фигурных скобках заменяются фактическими ID из API.

Delivery limits and semantics a consumer must satisfy

Полномочие: `syncs:read`.

Дополнительных параметров в контракте нет.

### Ответы и ошибки

| HTTP | Значение | Формат и схема |
| --- | --- | --- |
| 200 | Byte limits, envelope versions and delete semantics this deployment honours | `application/json` [SyncDeliveryCapabilities](https://context4.me/docs/api-schemas-4.md#syncdeliverycapabilities) |
| 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |

Заголовки успешного ответа:
```json
{
  "X-Request-Id": {
    "description": "Correlation id echoed on every response",
    "schema": {
      "type": "string"
    }
  },
  "RateLimit-Limit": {
    "description": "Per-key request limit for the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Remaining": {
    "description": "Requests remaining in the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Reset": {
    "description": "Seconds until the current window resets",
    "schema": {
      "type": "integer"
    }
  }
}
```

## createSyncExport

`POST /v1/syncs/{syncId}/exports`

URL этого стенда: `https://context4.me/v1/syncs/{syncId}/exports`. Параметры в фигурных скобках заменяются фактическими ID из API.

Open an immutable historical export over a captured frontier

Полномочие: `syncs:write`.

### Параметры

| Имя | Где | Обязателен | Тип и ограничения |
| --- | --- | --- | --- |
| `syncId` | path | да | &#123;"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"&#125;  |

### Тело запроса

Обязательно. 

```json
{
  "required": true,
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "properties": {
          "destination": {
            "type": "string",
            "enum": [
              "file",
              "bounded-replay-topic"
            ]
          },
          "entity": {
            "type": "string",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,79}$"
          },
          "idempotency_key": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "range": {
            "type": "object",
            "properties": {
              "after_cursor": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^(0|[1-9][0-9]{0,18})$"
              },
              "through_cursor": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^(0|[1-9][0-9]{0,18})$"
              }
            },
            "required": [
              "after_cursor",
              "through_cursor"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "entity",
          "idempotency_key"
        ],
        "additionalProperties": false
      }
    }
  }
}
```

### Ответы и ошибки

| HTTP | Значение | Формат и схема |
| --- | --- | --- |
| 201 | Export session with its captured frontier and publication barrier | `application/json` [SyncExportSession](https://context4.me/docs/api-schemas-4.md#syncexportsession) |
| 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 503 | Problem (service_unavailable, provider_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |

Заголовки успешного ответа:
```json
{
  "X-Request-Id": {
    "description": "Correlation id echoed on every response",
    "schema": {
      "type": "string"
    }
  },
  "RateLimit-Limit": {
    "description": "Per-key request limit for the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Remaining": {
    "description": "Requests remaining in the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Reset": {
    "description": "Seconds until the current window resets",
    "schema": {
      "type": "integer"
    }
  }
}
```

## cancelSyncExport

`POST /v1/syncs/{syncId}/exports/{exportId}/cancel`

URL этого стенда: `https://context4.me/v1/syncs/{syncId}/exports/{exportId}/cancel`. Параметры в фигурных скобках заменяются фактическими ID из API.

Request cancellation of a running export

Полномочие: `syncs:write`.

### Параметры

| Имя | Где | Обязателен | Тип и ограничения |
| --- | --- | --- | --- |
| `syncId` | path | да | &#123;"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"&#125;  |
| `exportId` | path | да | &#123;"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"&#125;  |

### Ответы и ошибки

| HTTP | Значение | Формат и схема |
| --- | --- | --- |
| 202 | Cancellation recorded; the session reaches `cancelled` once the runner stops | `application/json` [SyncExportSession](https://context4.me/docs/api-schemas-4.md#syncexportsession) |
| 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 409 | Problem (conflict) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |

Заголовки успешного ответа:
```json
{
  "X-Request-Id": {
    "description": "Correlation id echoed on every response",
    "schema": {
      "type": "string"
    }
  },
  "RateLimit-Limit": {
    "description": "Per-key request limit for the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Remaining": {
    "description": "Requests remaining in the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Reset": {
    "description": "Seconds until the current window resets",
    "schema": {
      "type": "integer"
    }
  }
}
```

## getSyncExport

`GET /v1/syncs/{syncId}/exports/{exportId}`

URL этого стенда: `https://context4.me/v1/syncs/{syncId}/exports/{exportId}`. Параметры в фигурных скобках заменяются фактическими ID из API.

Read an export session's state and progress

Полномочие: `syncs:read`.

### Параметры

| Имя | Где | Обязателен | Тип и ограничения |
| --- | --- | --- | --- |
| `syncId` | path | да | &#123;"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"&#125;  |
| `exportId` | path | да | &#123;"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"&#125;  |

### Ответы и ошибки

| HTTP | Значение | Формат и схема |
| --- | --- | --- |
| 200 | Export session state, progress and terminal outcome | `application/json` [SyncExportSession](https://context4.me/docs/api-schemas-4.md#syncexportsession) |
| 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 404 | Problem (not_found) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |

Заголовки успешного ответа:
```json
{
  "X-Request-Id": {
    "description": "Correlation id echoed on every response",
    "schema": {
      "type": "string"
    }
  },
  "RateLimit-Limit": {
    "description": "Per-key request limit for the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Remaining": {
    "description": "Requests remaining in the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Reset": {
    "description": "Seconds until the current window resets",
    "schema": {
      "type": "integer"
    }
  }
}
```

## listSyncProviders

`GET /v1/sync-providers`

URL этого стенда: `https://context4.me/v1/sync-providers`. Параметры в фигурных скобках заменяются фактическими ID из API.

List published Sync providers

Полномочие: `syncs:read`.

### Параметры

| Имя | Где | Обязателен | Тип и ограничения |
| --- | --- | --- | --- |
| `cursor` | query | нет | &#123;"type":"string","minLength":1,"maxLength":400,"pattern":"^[A-Za-z0-9_-]+$","description":"Opaque pagination cursor from a previous response"&#125; Opaque pagination cursor from a previous response |
| `limit` | query | нет | &#123;"type":"integer","minimum":1,"maximum":100,"description":"Page size (1-100, default 20)"&#125; Page size (1-100, default 20) |

### Ответы и ошибки

| HTTP | Значение | Формат и схема |
| --- | --- | --- |
| 200 | Published providers with Sync entities; empty pages may have a continuation cursor | `application/json` [SyncProviderListResponse](https://context4.me/docs/api-schemas-4.md#syncproviderlistresponse) |
| 400 | Problem (validation_failed) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 401 | Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 403 | Problem (capability_missing) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 429 | Problem (rate_limited) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 500 | Problem (internal) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |
| 503 | Problem (service_unavailable) | `application/problem+json` [Problem](https://context4.me/docs/api-schemas-1.md#problem) |

Заголовки успешного ответа:
```json
{
  "X-Request-Id": {
    "description": "Correlation id echoed on every response",
    "schema": {
      "type": "string"
    }
  },
  "RateLimit-Limit": {
    "description": "Per-key request limit for the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Remaining": {
    "description": "Requests remaining in the current window",
    "schema": {
      "type": "integer"
    }
  },
  "RateLimit-Reset": {
    "description": "Seconds until the current window resets",
    "schema": {
      "type": "integer"
    }
  }
}
```

