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

Подключения и приложения OAuth.

Подключения рабочих сервисов и конфигурации OAuth в Context4: управление аккаунтами и схемы провайдеров через API.

Сгенерировано из публичного OpenAPI Context4. Авторизация: Authorization: Bearer с API-ключом. Общие правила — API. Полный контракт — OpenAPI JSON. В JSON ниже $ref указывает на именованную схему из раздела «Схемы».

listConnections

GET /v1/connections

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

List connections

Полномочие: connections:read.

Параметры

ИмяГдеОбязателенТип и ограничения
statusqueryнет{"type":"string","enum":["pending","active","degraded","revoked","failed"]}
user_idqueryнет{"$ref":"#/components/schemas/EndUserRef"}
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ЗначениеФормат и схема
200Connections in the key's workspaceapplication/json ConnectionListResponse
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"
    }
  }
}

createConnection

POST /v1/connections

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

Initiate a connection (hosted auth link)

Полномочие: connections:write.

Параметры

ИмяГдеОбязателенТип и ограничения
Idempotency-Keyheaderда{"type":"string"} Client-chosen key (8-128 chars of [A-Za-z0-9._:-]); replays with the same payload return the original outcome

Тело запроса

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

Data
{
  "required": true,
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/CreateConnectionRequest"
      }
    }
  }
}

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

HTTPЗначениеФормат и схема
201Hosted authorization link for the end userapplication/json HostedAuthLink
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)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"
    }
  }
}

getConnection

GET /v1/connections/{connectionId}

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

Get one connection

Полномочие: connections:read.

Параметры

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

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

HTTPЗначениеФормат и схема
200Connection view (engine-free)application/json Connection
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"
    }
  }
}

listAuthConfigs

GET /v1/auth-configs

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

List auth configurations

Полномочие: connections:read.

Параметры

ИмяГдеОбязателенТип и ограничения
connector_idqueryнет{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,78}$","example":"bitrix24"}
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ЗначениеФормат и схема
200Auth configurations in the key's workspaceapplication/json AuthConfigListResponse
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"
    }
  }
}

createAuthConfig

POST /v1/auth-configs

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

Create an auth configuration

Полномочие: connections:write.

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

Тело запроса

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

Data
{
  "required": true,
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/CreateAuthConfigRequest"
      }
    }
  }
}

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

HTTPЗначениеФормат и схема
201The created auth configurationapplication/json AuthConfig
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
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"
    }
  }
}

getAuthConfig

GET /v1/auth-configs/{authConfigId}

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

Get one auth configuration

Полномочие: connections:read.

Параметры

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

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

HTTPЗначениеФормат и схема
200Auth configuration (secret-free)application/json AuthConfig
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"
    }
  }
}

updateAuthConfig

PATCH /v1/auth-configs/{authConfigId}

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

Update an auth configuration

Полномочие: connections:write.

Параметры

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

Тело запроса

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

Data
{
  "required": true,
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/UpdateAuthConfigRequest"
      }
    }
  }
}

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

HTTPЗначениеФормат и схема
200The updated auth configurationapplication/json AuthConfig
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)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"
    }
  }
}

deleteAuthConfig

DELETE /v1/auth-configs/{authConfigId}

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

Delete an auth configuration

Полномочие: connections:write.

Параметры

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

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

HTTPЗначениеФормат и схема
204DeletedТело не задано контрактом
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)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"
    }
  }
}

getProviderSchema

GET /v1/connections/{connectionId}/schemas/{entity}

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

Read the latest discovered provider entity schema

Полномочие: connections:read.

Параметры

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

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

HTTPЗначениеФормат и схема
200Latest tenant-scoped provider schemaapplication/json ProviderSchema
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
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"
    }
  }
}

discoverProviderSchema

POST /v1/connections/{connectionId}/schemas/{entity}

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

Discover and persist provider entity metadata

Полномочие: connections:write.

Параметры

ИмяГдеОбязателенТип и ограничения
Idempotency-Keyheaderда{"type":"string"} Client-chosen key (8-128 chars of [A-Za-z0-9._:-]); replays with the same payload return the original outcome
connectionIdpathда{"type":"string","format":"uuid","example":"9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"}
entitypathда{"type":"string","minLength":1,"maxLength":80}

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

HTTPЗначениеФормат и схема
200Immutable provider schema revisionapplication/json ProviderSchema
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
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"
    }
  }
}