---
title: "Update task"
method: PATCH
path: "/v1/tasks/{task_id}"
tags: ["Tasks"]
---

# Update task

`PATCH /v1/tasks/{task_id}`

## Request

- Base URL: `https://ac.cnstrc.com`
- URL: `https://ac.cnstrc.com/v1/tasks/{task_id}`
- Auth: one of:
  - HTTP basic
  - HTTP bearer

**🔐 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)`.

Update the status of a single task to queue or cancel it.

## Path parameters

- `task_id` integer, required

## Query parameters

- `key` string, required: The key of the index to use.
- `c` string: The ID of the client and version that the request is coming from, such as `cio-js-2.90`.

## Request body

- TaskPatchRequestBody
  - `status` 'QUEUED' | 'CANCELED', required: This contains the new status that you want to update the task with. It is only allowed to cancel queued tasks by setting their status to `CANCELED` or re-run tasks that are not in progress by setting their status to `QUEUED`.In-progress tasks cannot be modified.

## Response `200`

OK

- union
  - IngestionTaskResponse
    - `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, 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` 'ingestion', required
    - `filename` string: The name of the file uploaded to Constructor.
    - `protocol` 'ftp' | 'http': Describes if the ingestion was created via FTP, HTTP API or other source (then null).
    - `result` IngestionResult
      - `changelog` DirectUploadChangelog, required
        - `item_groups_updated` integer
        - `item_groups_deleted` integer
        - `total_item_groups_changed` integer
        - `sections` object
      - `index_built` boolean, required: Shows if changes from the task have been indexed.
      - `ingestion_warnings` IngestionWarning[]: A list of the warnings produced during ingestion.
        - `code` string, required: Warning code
        - `message` string, required: Warning message
        - `data` object: Additional data related to warning
  - IngestionTaskErrorResponse
    - `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` 'ingestion', required
    - `error` union: Data about errors in case of task failure.
      - string
      - object
    - `filename` string: The name of the file uploaded to Constructor.
    - `protocol` 'ftp' | 'http': Describes if the ingestion was created via FTP, HTTP API or other source (then null).
  - 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, 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` '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, 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` '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' | '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.
    - `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

- `400`: Validation Error
- `401`: Credentials are not passed or action is forbidden.
- `403`: The supplied token does not have the required permissions.
- `404`: Not Found
- `409`: Conflict
- `429`: Rate limit breached

---

[API](https://skmtc.dev/constructor/apis/catalog-management.md) - [All operations](https://skmtc.dev/constructor/apis/catalog-management/llms.txt) - [OpenAPI document](https://skmtc.dev/constructor/apis/catalog-management/revisions/3a9833796fc6?raw)
