---
title: "Update import tasks for an instance"
method: PUT
path: "/instances/{instance_id}/import_tasks"
tags: ["Private"]
---

# Update import tasks for an instance

`PUT /instances/{instance_id}/import_tasks`

The instance import process involves multiple tasks. This endpoint updates the state of an import task.

## Path parameters

- `instance_id` string, required

## Headers

- `If-Match` string

## Request body

- ImportTasks
  - `build_hierarchies` object[]
    - `code_list_id` string — The ID of the codelist that this hierarchy represents
    - `dimension_name` string — The name of the dimension the hierarchy represents
    - `state` string — The state of the import observations task
  - `build_search_indexes` object[]
    - `dimension_name` string — The name of the dimension the search index represents
    - `state` string — The state of the import observations task
  - `import_observations` object
    - `state` string — The state of the import observations task
    - `total_inserted_observations` integer — The number of inserted observations in this instance

## Response `200`

Updated the state of the import task

## Other responses

- `400` — Failed to process the request due to invalid request
- `401` — The token provided is unauthorised to carry out this operation
- `404` — InstanceId does not match any instances
- `409` — Failed to process the request due to a conflict
- `500` — Failed to process the request due to an internal error

---

[API](https://skmtc.net/office-of-national-statistics/apis/explore-our-data.md) · [All operations](https://skmtc.net/office-of-national-statistics/apis/explore-our-data/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/office-of-national-statistics/explore-our-data/versions/269ed359fb27/schema)
