---
title: "Update an archive"
method: PUT
path: "/api/v2/logs/config/archives/{archive_id}"
tags: ["Logs Archives"]
---

# Update an archive

`PUT /api/v2/logs/config/archives/{archive_id}`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/logs/config/archives/{archive_id}`
- Auth: API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`

Update a given archive configuration.

**Note**: Using this method updates your archive configuration by **replacing**
your current configuration with the new one sent to your Datadog organization.

## Path parameters

- `archive_id` string, required

## Request body

- LogsArchiveCreateRequest: The logs archive.
  - `data` LogsArchiveCreateRequestDefinition: The definition of an archive.
    - `attributes` LogsArchiveCreateRequestAttributes: The attributes associated with the archive.
      - `compression_method` 'GZIP' | 'ZSTD': The type of compression for the archive.
      - `destination` union, required: An archive's destination.
        - LogsArchiveDestinationAzure: The Azure archive destination.
          - `container` string, required: The container where the archive will be stored.
          - `integration` LogsArchiveIntegrationAzure, required: The Azure archive's integration destination.
            - `client_id` string, required: A client ID.
            - `tenant_id` string, required: A tenant ID.
          - `path` string: The archive path.
          - `region` string: The region where the archive will be stored.
          - `storage_account` string, required: The associated storage account.
          - `type` 'azure', required: Type of the Azure archive destination.
        - LogsArchiveDestinationGCS: The GCS archive destination.
          - `bucket` string, required: The bucket where the archive will be stored.
          - `integration` LogsArchiveIntegrationGCS, required: The GCS archive's integration destination.
            - `client_email` string, required: A client email.
            - `project_id` string: A project ID.
          - `path` string: The archive path.
          - `type` 'gcs', required: Type of the GCS archive destination.
        - LogsArchiveDestinationS3: The S3 archive destination.
          - `bucket` string, required: The bucket where the archive will be stored.
          - `encryption` LogsArchiveEncryptionS3: The S3 encryption settings.
            - `key` string: An Amazon Resource Name (ARN) used to identify an AWS KMS key.
            - `type` 'NO_OVERRIDE' | 'SSE_S3' | 'SSE_KMS', required: Type of S3 encryption for a destination.
          - `integration` union, required: The S3 Archive's integration destination. You must provide one of the following: `access_key_id` alone, or both `account_id` and `role_name` together.
            - LogsArchiveIntegrationS3AccessKey: The S3 Archive's integration destination using an access key.
              - …
            - LogsArchiveIntegrationS3Role: The S3 Archive's integration destination using an IAM role.
              - …
          - `path` string: The archive path.
          - `storage_class` 'STANDARD' | 'STANDARD_IA' | 'ONEZONE_IA' | 'INTELLIGENT_TIERING' | 'GLACIER_IR': The storage class where the archive will be stored.
          - `type` 's3', required: Type of the S3 archive destination.
      - `include_tags` boolean: To store the tags in the archive, set the value "true". If it is set to "false", the tags will be deleted when the logs are sent to the archive.
      - `lookup_attributes` string[]: An array of attributes to use as lookup keys for the archive.
      - `name` string, required: The archive name.
      - `partitioning_attributes` string[]: An array of attributes to use as partition keys for the archive. The attribute used most frequently for querying should be first.
      - `query` string, required: The archive query/filter. Logs matching this query are included in the archive.
      - `rehydration_max_scan_size_in_gb` integer, nullable: Maximum scan size for rehydration from this archive.
      - `rehydration_tags` string[]: An array of tags to add to rehydrated logs from an archive.
    - `type` string, required: The type of the resource. The value should always be archives.

## Response `200`

OK

- LogsArchive: The logs archive.
  - `data` LogsArchiveDefinition: The definition of an archive.
    - `attributes` LogsArchiveAttributes: The attributes associated with the archive.
      - `compression_method` 'GZIP' | 'ZSTD': The type of compression for the archive.
      - `destination` union, required: An archive's destination.
        - object: The Azure archive destination.
          - `container` string, required: The container where the archive will be stored.
          - `integration` LogsArchiveIntegrationAzure, required: The Azure archive's integration destination.
            - `client_id` string, required: A client ID.
            - `tenant_id` string, required: A tenant ID.
          - `path` string: The archive path.
          - `region` string: The region where the archive will be stored.
          - `storage_account` string, required: The associated storage account.
          - `type` 'azure', required: Type of the Azure archive destination.
        - object: The GCS archive destination.
          - `bucket` string, required: The bucket where the archive will be stored.
          - `integration` LogsArchiveIntegrationGCS, required: The GCS archive's integration destination.
            - `client_email` string, required: A client email.
            - `project_id` string: A project ID.
          - `path` string: The archive path.
          - `type` 'gcs', required: Type of the GCS archive destination.
        - object: The S3 archive destination.
          - `bucket` string, required: The bucket where the archive will be stored.
          - `encryption` LogsArchiveEncryptionS3: The S3 encryption settings.
            - `key` string: An Amazon Resource Name (ARN) used to identify an AWS KMS key.
            - `type` 'NO_OVERRIDE' | 'SSE_S3' | 'SSE_KMS', required: Type of S3 encryption for a destination.
          - `integration` union, required: The S3 Archive's integration destination. You must provide one of the following: `access_key_id` alone, or both `account_id` and `role_name` together.
            - LogsArchiveIntegrationS3AccessKey: The S3 Archive's integration destination using an access key.
              - …
            - LogsArchiveIntegrationS3Role: The S3 Archive's integration destination using an IAM role.
              - …
          - `path` string: The archive path.
          - `storage_class` 'STANDARD' | 'STANDARD_IA' | 'ONEZONE_IA' | 'INTELLIGENT_TIERING' | 'GLACIER_IR': The storage class where the archive will be stored.
          - `type` 's3', required: Type of the S3 archive destination.
      - `include_tags` boolean: To store the tags in the archive, set the value "true". If it is set to "false", the tags will be deleted when the logs are sent to the archive.
      - `lookup_attributes` string[]: An array of attributes to use as lookup keys for the archive.
      - `name` string, required: The archive name.
      - `partitioning_attributes` string[]: An array of attributes to use as partition keys for the archive. The attribute used most frequently for querying should be first.
      - `query` string, required: The archive query/filter. Logs matching this query are included in the archive.
      - `rehydration_max_scan_size_in_gb` integer, nullable: Maximum scan size for rehydration from this archive.
      - `rehydration_tags` string[]: An array of tags to add to rehydrated logs from an archive.
      - `state` 'UNKNOWN' | 'WORKING' | 'FAILING' | 'WORKING_AUTH_LEGACY': The state of the archive.
    - `id` string: The archive ID.
    - `type` string, required: The type of the resource. The value should always be archives.

## Other responses

- `400`: Bad Request
- `403`: Forbidden
- `404`: Not found
- `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)
