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

Выполнения.

Создание, проверка состояния и отмена выполнений инструментов Context4: запросы, ответы, попытки и ошибки API.

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

createExecution

POST /v1/executions

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

Create an execution (asynchronous, idempotent)

Полномочие: executions: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

Тело запроса

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

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

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

HTTPЗначениеФормат и схема
202Execution accepted (queued) or persisted as rejected with a denial code; poll the Location headerapplication/json Execution
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, session_expired, session_revoked, session_call_budget_exhausted)application/problem+json Problem
404Problem (not_found)application/problem+json Problem
409Problem (idempotency_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"
    }
  },
  "Location": {
    "description": "Resource location (/v1/executions/{executionId})",
    "schema": {
      "type": "string"
    }
  }
}

listExecutions

GET /v1/executions

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

List executions

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

Параметры

ИмяГдеОбязателенТип и ограничения
statusqueryнет{"type":"string","enum":["requested","queued","running","retrying","succeeded","failed","rejected","cancelled"]}
connector_idqueryнет{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,78}$","example":"bitrix24"}
user_idqueryнет{"$ref":"#/components/schemas/ExecutionEndUserRef"}
fromqueryнет{"type":"string","format":"date-time","example":"2026-07-16T12:00:00.000Z"}
toqueryнет{"type":"string","format":"date-time","example":"2026-07-16T12:00:00.000Z"}
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ЗначениеФормат и схема
200Executions ordered by creation time (descending)application/json ExecutionListResponse
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"
    }
  }
}

getExecution

GET /v1/executions/{executionId}

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

Get one execution with its result

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

Параметры

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

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

HTTPЗначениеФормат и схема
200Execution view; terminal successes include the resultapplication/json ExecutionWithResult
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"
    }
  }
}

listExecutionAttempts

GET /v1/executions/{executionId}/attempts

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

List execution attempts

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

Параметры

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

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

HTTPЗначениеФормат и схема
200Append-only attempt recordsapplication/json AttemptListResponse
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"
    }
  }
}

cancelExecution

POST /v1/executions/{executionId}/cancel

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

Cancel a queued execution

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

Параметры

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

Тело запроса

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

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

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

HTTPЗначениеФормат и схема
200The cancelled executionapplication/json Execution
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, execution_not_cancellable)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"
    }
  }
}