---
title: "Create task"
method: POST
path: "/v1/tasks"
tags: ["Tasks"]
---

# Create task

`POST /v1/tasks`

**🔐 This endpoint requires [HTTP authentication](https://docs.constructor.com/reference/main-authentication) (either [Basic](https://docs.constructor.com/reference/main-authentication#basic-authentication) or [Bearer](https://docs.constructor.com/reference/main-authentication#bearer-authentication)).**
For authenticating with Bearer token, required scopes are: `catalog(w)`.

Create a task.

## Query parameters

- `key` string, required — The key of the index to use.

## Request body

- union
  - TaskListPostRequestBodyUserDataRequest
    - `action` 'request_report'
    - `user_id` string, required
    - `type` 'user_data_request', required
  - TaskListPostRequestBodyCatalogExport — Use this shape when exporting items, variations, or items with variations.
    - `section` string, required — The catalog section to export. Required for `items`, `variations`, and `items_with_variations`; omit for `item_groups`. The API enforces this conditional requirement during request validation.
    - `catalog_part` 'items' | 'variations' | 'items_with_variations', required — The part of the catalog to export. Supported values are `items`, `variations`, `item_groups`, and `items_with_variations`.
    - `from_timestamp` string, date-time — Only export catalog entities updated at or after this timestamp.
    - `type` 'catalog_export', required — The type of the task.

## Response `200`

OK

- union
  - UserDataRequestTaskResponse
    - `id` integer, required — The ID of the task.
    - `status` 'QUEUED' | 'CANCELED' | 'IN_PROGRESS' | 'DONE' | 'FAILED', required — Current status of the task.
    - `submission_time` string, date-time, required — Time of task submission.
    - `last_update` string, date-time — Last time the status of this task was updated. May be `null` if the task has never been run before.
    - `start_time` string, date-time — Starting time of the task. May be `null` if the task has not been run yet.
    - `type` 'user_data_request', required
    - `user_id` string
    - `result` UserDataRequestResult
      - `data_url` string — Link to file with user's data.
  - UserDataRequestTaskErrorResponse
    - `id` integer, required — The ID of the task.
    - `status` 'FAILED', required — Current status of the task.
    - `submission_time` string, date-time, required — Time of task submission.
    - `last_update` string, date-time — Last time the status of this task was updated. May be `null` if the task has never been run before.
    - `start_time` string, date-time — Starting time of the task. May be `null` if the task has not been run yet.
    - `type` 'user_data_request', required
    - `error` union — Data about errors in case of task failure.
      - string
      - object
    - `user_id` string
  - CatalogExportTaskResponse — Response for a catalog export task.
    - `id` integer, required — The ID of the task.
    - `status` 'QUEUED' | 'CANCELED' | 'IN_PROGRESS' | 'DONE', required — Current status of the task.
    - `submission_time` string, date-time, required — Time of task submission.
    - `last_update` string, date-time, nullable — Last time the status of this task was updated. May be `null` if the task has never been run before.
    - `start_time` string, date-time, nullable — Starting time of the task. May be `null` if the task has not been run yet.
    - `type` 'catalog_export', required — The type of the task.
    - `section` string — The catalog section used for the export. Valid values are the catalog section names configured for the index, such as `Products`; this mirrors the `section` request parameter.
    - `catalog_part` 'items' | 'variations' | 'item_groups' | 'items_with_variations' — The part of the catalog that was exported.
    - `result` CatalogExportResult — Contains the export file URL and entity count for a catalog export task result.
      - `url` string, nullable, required — An expiring download URL for the export file. The URL expires three days after the export file is generated. May be `null` when the export contains no entities.
      - `count` integer — Count of exported entities, such as items, variations, or item groups. For catalog export task results created before counts were returned, this key is omitted rather than returned as `null`.
  - CatalogExportTaskErrorResponse — Error response for a catalog export task.
    - `id` integer, required — The ID of the task.
    - `status` 'FAILED', required — Current status of the task.
    - `submission_time` string, date-time, required — Time of task submission.
    - `last_update` string, date-time, nullable — Last time the status of this task was updated. May be `null` if the task has never been run before.
    - `start_time` string, date-time, nullable — Starting time of the task. May be `null` if the task has not been run yet.
    - `type` 'catalog_export', required — The type of the task.
    - `error` union — Data about errors in case of task failure.
      - string
      - object
    - `section` string — The catalog section used for the export. Valid values are the catalog section names configured for the index, such as `Products`; this mirrors the `section` request parameter.
    - `catalog_part` 'items' | 'variations' | 'item_groups' | 'items_with_variations' — The part of the catalog that was exported.

## Other responses

- `303` — See Other
- `400` — Validation Error
- `401` — Credentials are not passed or action is forbidden.
- `403` — The supplied token does not have the required permissions.
- `409` — Conflict
- `429` — Rate limit breached

---

[API](https://skmtc.dev/constructor/apis/autocomplete.md) · [All operations](https://skmtc.dev/constructor/apis/autocomplete/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/constructor/autocomplete/revisions/2d33330633b6/schema)
