API: Imports
CSV / ClickHouse / Amplitude import jobs.
На этой странице
Раздел собран из спецификации OpenAPI продукта: 5 метод(ов). Поверхность — query-api (основной API, база /api/v1). Все методы требуют аутентификации.
Методы раздела
/imports/{iid} Get import job status (secrets redacted)
Параметры
| Имя | Где | Тип | Описание |
|---|---|---|---|
iid обязателен | Путь | integer (int64) | Import job id. |
Ответы
| Код | Что означает | Тело |
|---|---|---|
| 200 | Import job | ImportJob |
| 401 | Missing or invalid credentials (code=unauthorized) | Error |
| 404 | Resource not found (code=not_found) | Error |
/imports/{iid}/cancel Request cancellation of an import (analyst+)
Idempotent for pending, running, cancel_requested and canceled jobs. Pending jobs become canceled immediately; a running worker stops at the next durable checkpoint. The request body must be empty.
Параметры
| Имя | Где | Тип | Описание |
|---|---|---|---|
iid обязателен | Путь | integer (int64) | Import job id. |
Ответы
| Код | Что означает | Тело |
|---|---|---|
| 200 | Updated import job | ImportJob |
| 401 | Missing or invalid credentials (code=unauthorized) | Error |
| 403 | Authenticated but not permitted (code=forbidden) | Error |
| 404 | Resource not found (code=not_found) | Error |
| 409 | The job is already terminal and not cancelable | Error |
| 422 | Request failed validation (code=validation_failed) | Error |
| 429 | Rate limit (code=rate_limited) or plan quota exceeded (code=quota_exceeded). On ingest operations a live trial that exhausted its total event cap answers code=trial_quota_exceeded instead of quota_exceeded. Заголовки: Retry-After.
| Error |
/imports/{iid}/resume Resume a canceled CSV import from its durable checkpoint (analyst+)
Requeues the same job and source file. Stable event IDs plus the flushed-row checkpoint make retries idempotent. The request body must be empty; non-CSV or non-canceled jobs fail closed.
Параметры
| Имя | Где | Тип | Описание |
|---|---|---|---|
iid обязателен | Путь | integer (int64) | Import job id. |
Ответы
| Код | Что означает | Тело |
|---|---|---|
| 202 | Import requeued | ImportJob |
| 401 | Missing or invalid credentials (code=unauthorized) | Error |
| 403 | Authenticated but not permitted (code=forbidden) | Error |
| 404 | Resource not found (code=not_found) | Error |
| 409 | Job or checkpoint source is not resumable | Error |
| 422 | Request failed validation (code=validation_failed) | Error |
| 429 | Rate limit (code=rate_limited) or plan quota exceeded (code=quota_exceeded). On ingest operations a live trial that exhausted its total event cap answers code=trial_quota_exceeded instead of quota_exceeded. Заголовки: Retry-After.
| Error |
/projects/{id}/imports List import jobs of a project (newest first, cursor pagination)
Параметры
| Имя | Где | Тип | Описание |
|---|---|---|---|
id обязателен | Путь | integer (int32) | Project id. |
cursor необязателен | Query | string | Opaque pagination cursor |
limit необязателен | Query | integer | Page size (default 50, max 100) |
Ответы
| Код | Что означает | Тело |
|---|---|---|
| 200 | Import jobs page (secrets redacted) | object |
| 401 | Missing or invalid credentials (code=unauthorized) | Error |
| 404 | Resource not found (code=not_found) | Error |
| 422 | Request failed validation (code=validation_failed) | Error |
/projects/{id}/imports Create an import job (analyst+)
JSON body for type=clickhouse; multipart/form-data (fields: type, config, file) for type=csv|amplitude. The selected type requires clickhouse_import, csv_import or amplitude_import respectively in the cloud EffectivePlan or current verified on-prem signed-license subset.
Параметры
| Имя | Где | Тип | Описание |
|---|---|---|---|
id обязателен | Путь | integer (int32) | Project id. |
Тело запроса application/json , обязательно
| Поле | Тип | Описание |
|---|---|---|
type обязательно | enum(clickhouse) | |
config обязательно | oneOf<ClickHouseImportQueryConfig | ClickHouseImportTableConfig> |
Ответы
| Код | Что означает | Тело |
|---|---|---|
| 201 | Created import job (server-owned secrets redacted) | ImportJob |
| 401 | Missing or invalid credentials (code=unauthorized) | Error |
| 403 | Authenticated but not permitted (code=forbidden) | Error |
| 404 | Resource not found (code=not_found) | Error |
| 409 | Demo project — imports are disabled (code `demo_project`) | Error |
| 422 | Request failed validation (code=validation_failed) | Error |
Источник раздела — docs/api/openapi.yaml репозитория продукта,
версия API 1.0.0, OpenAPI 3.0.3,
снимок 095579325c2d.
Расхождение снимка со спецификацией роняет сборку документации.