---
title: "Update archive order"
method: PUT
path: "/api/v2/logs/config/archive-order"
tags: ["Logs Archives"]
---

# Update archive order

`PUT /api/v2/logs/config/archive-order`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/logs/config/archive-order`
- Auth: API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`

Update the order of your archives. Since logs are processed sequentially, reordering an archive may change
the structure and content of the data processed by other archives.

**Note**: Using the `PUT` method updates your archive's order by replacing the current order
with the new one.

## Request body

- LogsArchiveOrder: A ordered list of archive IDs.
  - `data` LogsArchiveOrderDefinition: The definition of an archive order.
    - `attributes` LogsArchiveOrderAttributes, required: The attributes associated with the archive order.
      - `archive_ids` string[], required: An ordered array of `<ARCHIVE_ID>` strings, the order of archive IDs in the array define the overall archives order for Datadog.
    - `type` 'archive_order', required: Type of the archive order definition.

## Response `200`

OK

- LogsArchiveOrder: A ordered list of archive IDs.
  - `data` LogsArchiveOrderDefinition: The definition of an archive order.
    - `attributes` LogsArchiveOrderAttributes, required: The attributes associated with the archive order.
      - `archive_ids` string[], required: An ordered array of `<ARCHIVE_ID>` strings, the order of archive IDs in the array define the overall archives order for Datadog.
    - `type` 'archive_order', required: Type of the archive order definition.

## Other responses

- `400`: Bad Request
- `403`: Forbidden
- `422`: Unprocessable Entity
- `429`: Too many requests

---

[API](https://skmtc.dev/datadog/apis/datadog-api-v2-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/revisions/da68bf029e4c?raw)
