Context4
Техническая документация

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

Синхронизации Context4: источники, доступные сущности, запуски и выгрузки данных через публичный API.

Сгенерировано из публичного OpenAPI Context4. Авторизация: Authorization: Bearer с API-ключом. Общие правила — API. Полный контракт — 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.

Параметры

ИмяГдеОбязателенТип и ограничения
syncIdpathда{"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"}
entityqueryда{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]{0,79}$"}

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

HTTPЗначениеФормат и схема
200Persisted delivery grants and source lineage without credentialsapplication/json SyncDeliveryAuthority
400Problem (validation_failed)application/problem+json Problem
401Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked)application/problem+json Problem
403Problem (capability_missing)application/problem+json Problem
404Problem (not_found)application/problem+json Problem
429Problem (rate_limited)application/problem+json Problem
500Problem (internal)application/problem+json Problem
503Problem (service_unavailable)application/problem+json Problem

Заголовки успешного ответа:

Data
{
  "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-Keyheaderнет{"type":"string"} Required when source_kind is database_poll; retries with the same key and payload return the original sync. Optional for other source kinds.

Тело запроса

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

Data
{
  "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ЗначениеФормат и схема
201The created sync; acquisition and initial loading follow the provider capabilitiesapplication/json Sync
400Problem (validation_failed)application/problem+json Problem
401Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked)application/problem+json Problem
403Problem (capability_missing, forbidden)application/problem+json Problem
404Problem (not_found)application/problem+json Problem
409Problem (conflict)application/problem+json Problem
429Problem (rate_limited, quota_exceeded)application/problem+json Problem
500Problem (internal)application/problem+json Problem
503Problem (service_unavailable)application/problem+json Problem

Заголовки успешного ответа:

Data
{
  "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.

Параметры

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

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

HTTPЗначениеФормат и схема
200One page of syncs with the continuation cursorapplication/json SyncList
400Problem (validation_failed)application/problem+json Problem
401Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked)application/problem+json Problem
403Problem (capability_missing)application/problem+json Problem
429Problem (rate_limited)application/problem+json Problem
500Problem (internal)application/problem+json Problem
503Problem (service_unavailable)application/problem+json Problem

Заголовки успешного ответа:

Data
{
  "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.

Параметры

ИмяГдеОбязателенТип и ограничения
syncIdpathда{"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"}

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

HTTPЗначениеФормат и схема
200The sync viewapplication/json Sync
400Problem (validation_failed)application/problem+json Problem
401Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked)application/problem+json Problem
403Problem (capability_missing)application/problem+json Problem
404Problem (not_found)application/problem+json Problem
429Problem (rate_limited)application/problem+json Problem
500Problem (internal)application/problem+json Problem
503Problem (service_unavailable)application/problem+json Problem

Заголовки успешного ответа:

Data
{
  "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.

Параметры

ИмяГдеОбязателенТип и ограничения
syncIdpathда{"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"}

Тело запроса

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

Data
{
  "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ЗначениеФормат и схема
200The updated sync viewapplication/json Sync
400Problem (validation_failed)application/problem+json Problem
401Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked)application/problem+json Problem
403Problem (capability_missing)application/problem+json Problem
404Problem (not_found)application/problem+json Problem
409Problem (conflict)application/problem+json Problem
429Problem (rate_limited)application/problem+json Problem
500Problem (internal)application/problem+json Problem
503Problem (service_unavailable)application/problem+json Problem

Заголовки успешного ответа:

Data
{
  "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.

Параметры

ИмяГдеОбязателенТип и ограничения
syncIdpathда{"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"}

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

HTTPЗначениеФормат и схема
200The deleted sync viewapplication/json Sync
400Problem (validation_failed)application/problem+json Problem
401Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked)application/problem+json Problem
403Problem (capability_missing)application/problem+json Problem
404Problem (not_found)application/problem+json Problem
409Problem (conflict)application/problem+json Problem
429Problem (rate_limited)application/problem+json Problem
500Problem (internal)application/problem+json Problem
503Problem (service_unavailable)application/problem+json Problem

Заголовки успешного ответа:

Data
{
  "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.

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

Тело запроса

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

Data
{
  "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ЗначениеФормат и схема
200Normalized sample records plus the estimated total volumeapplication/json SyncTestFire
400Problem (validation_failed)application/problem+json Problem
401Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked)application/problem+json Problem
403Problem (capability_missing)application/problem+json Problem
404Problem (not_found)application/problem+json Problem
429Problem (rate_limited)application/problem+json Problem
500Problem (internal)application/problem+json Problem
503Problem (service_unavailable, provider_unavailable)application/problem+json Problem

Заголовки успешного ответа:

Data
{
  "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-Keyheaderнет{"type":"string"} Required when the sync source_kind is database_poll; retries with the same key return the original run. Optional for other source kinds.
syncIdpathда{"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"}

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

HTTPЗначениеФормат и схема
202The sync view with the planned run enqueuedapplication/json Sync
400Problem (validation_failed)application/problem+json Problem
401Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked)application/problem+json Problem
403Problem (capability_missing)application/problem+json Problem
404Problem (not_found)application/problem+json Problem
409Problem (conflict). The source does not support a manual refresh, or a run is already activeapplication/problem+json Problem
429Problem (rate_limited)application/problem+json Problem
500Problem (internal)application/problem+json Problem
503Problem (service_unavailable)application/problem+json Problem

Заголовки успешного ответа:

Data
{
  "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.

Параметры

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

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

HTTPЗначениеФормат и схема
200One page of runs with the continuation cursorapplication/json SyncRunList
400Problem (validation_failed)application/problem+json Problem
401Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked)application/problem+json Problem
403Problem (capability_missing)application/problem+json Problem
404Problem (not_found)application/problem+json Problem
429Problem (rate_limited)application/problem+json Problem
500Problem (internal)application/problem+json Problem
503Problem (service_unavailable)application/problem+json Problem

Заголовки успешного ответа:

Data
{
  "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.

Параметры

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

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

HTTPЗначениеФормат и схема
200One page of record changes ordered by modification cursorapplication/json SyncRecordList
400Problem (validation_failed)application/problem+json Problem
401Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked)application/problem+json Problem
403Problem (capability_missing)application/problem+json Problem
404Problem (not_found)application/problem+json Problem
409Problem (conflict)application/problem+json Problem
429Problem (rate_limited)application/problem+json Problem
500Problem (internal)application/problem+json Problem
503Problem (service_unavailable)application/problem+json Problem

Заголовки успешного ответа:

Data
{
  "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.

Параметры

ИмяГдеОбязателенТип и ограничения
syncIdpathда{"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"}

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

HTTPЗначениеФормат и схема
200The number of records reset for republicationapplication/json SyncReplay
400Problem (validation_failed)application/problem+json Problem
401Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked)application/problem+json Problem
403Problem (capability_missing)application/problem+json Problem
404Problem (not_found)application/problem+json Problem
429Problem (rate_limited)application/problem+json Problem
500Problem (internal)application/problem+json Problem
503Problem (service_unavailable)application/problem+json Problem

Заголовки успешного ответа:

Data
{
  "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.

Параметры

ИмяГдеОбязателенТип и ограничения
connectorIdpathда{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,78}$","example":"bitrix24"}

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

HTTPЗначениеФормат и схема
200Syncable entities with strategy and default scheduleapplication/json SyncableEntityList
400Problem (validation_failed)application/problem+json Problem
401Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked)application/problem+json Problem
403Problem (capability_missing)application/problem+json Problem
404Problem (not_found)application/problem+json Problem
429Problem (rate_limited)application/problem+json Problem
500Problem (internal)application/problem+json Problem
503Problem (service_unavailable)application/problem+json Problem

Заголовки успешного ответа:

Data
{
  "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ЗначениеФормат и схема
200Byte limits, envelope versions and delete semantics this deployment honoursapplication/json SyncDeliveryCapabilities
400Problem (validation_failed)application/problem+json Problem
401Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked)application/problem+json Problem
403Problem (capability_missing)application/problem+json Problem
429Problem (rate_limited)application/problem+json Problem
500Problem (internal)application/problem+json Problem
503Problem (service_unavailable)application/problem+json Problem

Заголовки успешного ответа:

Data
{
  "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.

Параметры

ИмяГдеОбязателенТип и ограничения
syncIdpathда{"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"}

Тело запроса

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

Data
{
  "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ЗначениеФормат и схема
201Export session with its captured frontier and publication barrierapplication/json SyncExportSession
400Problem (validation_failed)application/problem+json Problem
401Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked)application/problem+json Problem
403Problem (capability_missing)application/problem+json Problem
404Problem (not_found)application/problem+json Problem
429Problem (rate_limited)application/problem+json Problem
500Problem (internal)application/problem+json Problem
503Problem (service_unavailable, provider_unavailable)application/problem+json Problem

Заголовки успешного ответа:

Data
{
  "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.

Параметры

ИмяГдеОбязателенТип и ограничения
syncIdpathда{"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"}
exportIdpathда{"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"}

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

HTTPЗначениеФормат и схема
202Cancellation recorded; the session reaches cancelled once the runner stopsapplication/json SyncExportSession
400Problem (validation_failed)application/problem+json Problem
401Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked)application/problem+json Problem
403Problem (capability_missing)application/problem+json Problem
404Problem (not_found)application/problem+json Problem
409Problem (conflict)application/problem+json Problem
429Problem (rate_limited)application/problem+json Problem
500Problem (internal)application/problem+json Problem
503Problem (service_unavailable)application/problem+json Problem

Заголовки успешного ответа:

Data
{
  "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.

Параметры

ИмяГдеОбязателенТип и ограничения
syncIdpathда{"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"}
exportIdpathда{"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"}

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

HTTPЗначениеФормат и схема
200Export session state, progress and terminal outcomeapplication/json SyncExportSession
400Problem (validation_failed)application/problem+json Problem
401Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked)application/problem+json Problem
403Problem (capability_missing)application/problem+json Problem
404Problem (not_found)application/problem+json Problem
429Problem (rate_limited)application/problem+json Problem
500Problem (internal)application/problem+json Problem
503Problem (service_unavailable)application/problem+json Problem

Заголовки успешного ответа:

Data
{
  "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.

Параметры

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

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

HTTPЗначениеФормат и схема
200Published providers with Sync entities; empty pages may have a continuation cursorapplication/json SyncProviderListResponse
400Problem (validation_failed)application/problem+json Problem
401Problem (authentication_required, invalid_api_key, api_key_expired, api_key_revoked)application/problem+json Problem
403Problem (capability_missing)application/problem+json Problem
429Problem (rate_limited)application/problem+json Problem
500Problem (internal)application/problem+json Problem
503Problem (service_unavailable)application/problem+json Problem

Заголовки успешного ответа:

Data
{
  "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"
    }
  }
}