---
title: Create an archive
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > Logs Archives
---

# Create an archive{% #create-an-archive %}
Copy pageCopied
{% tab title="v2" %}

| Datadog site      | API endpoint                                                   |
| ----------------- | -------------------------------------------------------------- |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/logs/config/archives |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/logs/config/archives |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/logs/config/archives      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/logs/config/archives      |
| us2.ddog-gov.com  | POST https://api.us2.ddog-gov.com/api/v2/logs/config/archives  |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/logs/config/archives     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/logs/config/archives |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/logs/config/archives |

### Overview

Create an archive in your organization. This endpoint requires the `logs_write_archives` permission.

### Request

#### Body Data (required)

The definition of the new archive.

{% tab title="Model" %}

| Parent field | Field                             | Type          | Description                                                                                                                                      |
| ------------ | --------------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
|              | data                              | object        | The definition of an archive.                                                                                                                    |
| data         | attributes                        | object        | The attributes associated with the archive.                                                                                                      |
| attributes   | compression_method                | enum          | The type of compression for the archive. Allowed enum values: `GZIP,ZSTD`                                                                        |
| attributes   | destination [*required*]     |  <oneOf> | An archive's destination.                                                                                                                        |
| destination  | Option 1                          | object        | The Azure archive destination.                                                                                                                   |
| Option 1     | container [*required*]       | string        | The container where the archive will be stored.                                                                                                  |
| Option 1     | integration [*required*]     | object        | The Azure archive's integration destination.                                                                                                     |
| integration  | client_id [*required*]       | string        | A client ID.                                                                                                                                     |
| integration  | tenant_id [*required*]       | string        | A tenant ID.                                                                                                                                     |
| Option 1     | path                              | string        | The archive path.                                                                                                                                |
| Option 1     | region                            | string        | The region where the archive will be stored.                                                                                                     |
| Option 1     | storage_account [*required*] | string        | The associated storage account.                                                                                                                  |
| Option 1     | type [*required*]            | enum          | Type of the Azure archive destination. Allowed enum values: `azure`                                                                              |
| destination  | Option 2                          | object        | The GCS archive destination.                                                                                                                     |
| Option 2     | bucket [*required*]          | string        | The bucket where the archive will be stored.                                                                                                     |
| Option 2     | integration [*required*]     | object        | The GCS archive's integration destination.                                                                                                       |
| integration  | client_email [*required*]    | string        | A client email.                                                                                                                                  |
| integration  | project_id                        | string        | A project ID.                                                                                                                                    |
| Option 2     | path                              | string        | The archive path.                                                                                                                                |
| Option 2     | type [*required*]            | enum          | Type of the GCS archive destination. Allowed enum values: `gcs`                                                                                  |
| destination  | Option 3                          | object        | The S3 archive destination.                                                                                                                      |
| Option 3     | bucket [*required*]          | string        | The bucket where the archive will be stored.                                                                                                     |
| Option 3     | encryption                        | object        | The S3 encryption settings.                                                                                                                      |
| encryption   | key                               | string        | An Amazon Resource Name (ARN) used to identify an AWS KMS key.                                                                                   |
| encryption   | type [*required*]            | enum          | Type of S3 encryption for a destination. Allowed enum values: `NO_OVERRIDE,SSE_S3,SSE_KMS`                                                       |
| Option 3     | integration [*required*]     | object        | The S3 Archive's integration destination.                                                                                                        |
| integration  | account_id [*required*]      | string        | The account ID for the integration.                                                                                                              |
| integration  | role_name [*required*]       | string        | The path of the integration.                                                                                                                     |
| Option 3     | path                              | string        | The archive path.                                                                                                                                |
| Option 3     | storage_class                     | enum          | The storage class where the archive will be stored. Allowed enum values: `STANDARD,STANDARD_IA,ONEZONE_IA,INTELLIGENT_TIERING,GLACIER_IR`        |
| Option 3     | type [*required*]            | enum          | Type of the S3 archive destination. Allowed enum values: `s3`                                                                                    |
| attributes   | 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. |
| attributes   | lookup_attributes                 | [string]      | An array of attributes to use as lookup keys for the archive.                                                                                    |
| attributes   | name [*required*]            | string        | The archive name.                                                                                                                                |
| attributes   | 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.                |
| attributes   | query [*required*]           | string        | The archive query/filter. Logs matching this query are included in the archive.                                                                  |
| attributes   | rehydration_max_scan_size_in_gb   | int64         | Maximum scan size for rehydration from this archive.                                                                                             |
| attributes   | rehydration_tags                  | [string]      | An array of tags to add to rehydrated logs from an archive.                                                                                      |
| data         | type [*required*]            | string        | The type of the resource. The value should always be archives.                                                                                   |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "compression_method": "GZIP",
      "destination": {
        "container": "container-name",
        "integration": {
          "client_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa",
          "tenant_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"
        },
        "path": "string",
        "region": "string",
        "storage_account": "account-name",
        "type": "azure"
      },
      "include_tags": false,
      "lookup_attributes": [
        "trace_id",
        "user_id"
      ],
      "name": "Nginx Archive",
      "partitioning_attributes": [
        "service",
        "status"
      ],
      "query": "source:nginx",
      "rehydration_max_scan_size_in_gb": 100,
      "rehydration_tags": [
        "team:intake",
        "team:app"
      ]
    },
    "type": "archives"
  }
}
```

{% /tab %}

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
The logs archive.

| Parent field | Field                             | Type                | Description                                                                                                                                      |
| ------------ | --------------------------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
|              | data                              | object              | The definition of an archive.                                                                                                                    |
| data         | attributes                        | object              | The attributes associated with the archive.                                                                                                      |
| attributes   | compression_method                | enum                | The type of compression for the archive. Allowed enum values: `GZIP,ZSTD`                                                                        |
| attributes   | destination [*required*]     | object <oneOf> | An archive's destination.                                                                                                                        |
| destination  | Option 1                          | object              | The Azure archive destination.                                                                                                                   |
| Option 1     | container [*required*]       | string              | The container where the archive will be stored.                                                                                                  |
| Option 1     | integration [*required*]     | object              | The Azure archive's integration destination.                                                                                                     |
| integration  | client_id [*required*]       | string              | A client ID.                                                                                                                                     |
| integration  | tenant_id [*required*]       | string              | A tenant ID.                                                                                                                                     |
| Option 1     | path                              | string              | The archive path.                                                                                                                                |
| Option 1     | region                            | string              | The region where the archive will be stored.                                                                                                     |
| Option 1     | storage_account [*required*] | string              | The associated storage account.                                                                                                                  |
| Option 1     | type [*required*]            | enum                | Type of the Azure archive destination. Allowed enum values: `azure`                                                                              |
| destination  | Option 2                          | object              | The GCS archive destination.                                                                                                                     |
| Option 2     | bucket [*required*]          | string              | The bucket where the archive will be stored.                                                                                                     |
| Option 2     | integration [*required*]     | object              | The GCS archive's integration destination.                                                                                                       |
| integration  | client_email [*required*]    | string              | A client email.                                                                                                                                  |
| integration  | project_id                        | string              | A project ID.                                                                                                                                    |
| Option 2     | path                              | string              | The archive path.                                                                                                                                |
| Option 2     | type [*required*]            | enum                | Type of the GCS archive destination. Allowed enum values: `gcs`                                                                                  |
| destination  | Option 3                          | object              | The S3 archive destination.                                                                                                                      |
| Option 3     | bucket [*required*]          | string              | The bucket where the archive will be stored.                                                                                                     |
| Option 3     | encryption                        | object              | The S3 encryption settings.                                                                                                                      |
| encryption   | key                               | string              | An Amazon Resource Name (ARN) used to identify an AWS KMS key.                                                                                   |
| encryption   | type [*required*]            | enum                | Type of S3 encryption for a destination. Allowed enum values: `NO_OVERRIDE,SSE_S3,SSE_KMS`                                                       |
| Option 3     | integration [*required*]     | object              | The S3 Archive's integration destination.                                                                                                        |
| integration  | account_id [*required*]      | string              | The account ID for the integration.                                                                                                              |
| integration  | role_name [*required*]       | string              | The path of the integration.                                                                                                                     |
| Option 3     | path                              | string              | The archive path.                                                                                                                                |
| Option 3     | storage_class                     | enum                | The storage class where the archive will be stored. Allowed enum values: `STANDARD,STANDARD_IA,ONEZONE_IA,INTELLIGENT_TIERING,GLACIER_IR`        |
| Option 3     | type [*required*]            | enum                | Type of the S3 archive destination. Allowed enum values: `s3`                                                                                    |
| attributes   | 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. |
| attributes   | lookup_attributes                 | [string]            | An array of attributes to use as lookup keys for the archive.                                                                                    |
| attributes   | name [*required*]            | string              | The archive name.                                                                                                                                |
| attributes   | 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.                |
| attributes   | query [*required*]           | string              | The archive query/filter. Logs matching this query are included in the archive.                                                                  |
| attributes   | rehydration_max_scan_size_in_gb   | int64               | Maximum scan size for rehydration from this archive.                                                                                             |
| attributes   | rehydration_tags                  | [string]            | An array of tags to add to rehydrated logs from an archive.                                                                                      |
| attributes   | state                             | enum                | The state of the archive. Allowed enum values: `UNKNOWN,WORKING,FAILING,WORKING_AUTH_LEGACY`                                                     |
| data         | id                                | string              | The archive ID.                                                                                                                                  |
| data         | type [*required*]            | string              | The type of the resource. The value should always be archives.                                                                                   |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "compression_method": "GZIP",
      "destination": {
        "container": "container-name",
        "integration": {
          "client_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa",
          "tenant_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"
        },
        "path": "string",
        "region": "string",
        "storage_account": "account-name",
        "type": "azure"
      },
      "include_tags": false,
      "lookup_attributes": [
        "trace_id",
        "user_id"
      ],
      "name": "Nginx Archive",
      "partitioning_attributes": [
        "service",
        "status"
      ],
      "query": "source:nginx",
      "rehydration_max_scan_size_in_gb": 100,
      "rehydration_tags": [
        "team:intake",
        "team:app"
      ],
      "state": "WORKING"
    },
    "id": "a2zcMylnM4OCHpYusxIi3g",
    "type": "archives"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Bad Request
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="403" %}
Forbidden
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

### Code Example

##### 
                  \## default
# 
 \# Curl command curl -X POST "https://api.datadoghq.com/api/v2/logs/config/archives" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "compression_method": "GZIP",
      "destination": {
        "container": "container-name",
        "storage_account": "account-name",
        "type": "azure"
      },
      "include_tags": false,
      "name": "Nginx Archive",
      "query": "source:nginx",
      "rehydration_max_scan_size_in_gb": 100,
      "rehydration_tags": [
        "team:intake",
        "team:app"
      ]
    },
    "type": "archives"
  }
}
EOF 
                
##### 

```python
"""
Create an archive returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.logs_archives_api import LogsArchivesApi
from datadog_api_client.v2.model.logs_archive_attributes_compression_method import (
    LogsArchiveAttributesCompressionMethod,
)
from datadog_api_client.v2.model.logs_archive_create_request import LogsArchiveCreateRequest
from datadog_api_client.v2.model.logs_archive_create_request_attributes import LogsArchiveCreateRequestAttributes
from datadog_api_client.v2.model.logs_archive_create_request_definition import LogsArchiveCreateRequestDefinition
from datadog_api_client.v2.model.logs_archive_destination_azure import LogsArchiveDestinationAzure
from datadog_api_client.v2.model.logs_archive_destination_azure_type import LogsArchiveDestinationAzureType
from datadog_api_client.v2.model.logs_archive_integration_azure import LogsArchiveIntegrationAzure

body = LogsArchiveCreateRequest(
    data=LogsArchiveCreateRequestDefinition(
        attributes=LogsArchiveCreateRequestAttributes(
            compression_method=LogsArchiveAttributesCompressionMethod.GZIP,
            destination=LogsArchiveDestinationAzure(
                container="container-name",
                integration=LogsArchiveIntegrationAzure(
                    client_id="aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa",
                    tenant_id="aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa",
                ),
                storage_account="account-name",
                type=LogsArchiveDestinationAzureType.AZURE,
            ),
            include_tags=False,
            name="Nginx Archive",
            query="source:nginx",
            rehydration_max_scan_size_in_gb=100,
            rehydration_tags=[
                "team:intake",
                "team:app",
            ],
        ),
        type="archives",
    ),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = LogsArchivesApi(api_client)
    response = api_instance.create_logs_archive(body=body)

    print(response)
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=python) and then save the example to `example.py` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" python3 "example.py"
##### 

```ruby
# Create an archive returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::LogsArchivesAPI.new

body = DatadogAPIClient::V2::LogsArchiveCreateRequest.new({
  data: DatadogAPIClient::V2::LogsArchiveCreateRequestDefinition.new({
    attributes: DatadogAPIClient::V2::LogsArchiveCreateRequestAttributes.new({
      compression_method: DatadogAPIClient::V2::LogsArchiveAttributesCompressionMethod::GZIP,
      destination: DatadogAPIClient::V2::LogsArchiveDestinationAzure.new({
        container: "container-name",
        integration: DatadogAPIClient::V2::LogsArchiveIntegrationAzure.new({
          client_id: "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa",
          tenant_id: "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa",
        }),
        storage_account: "account-name",
        type: DatadogAPIClient::V2::LogsArchiveDestinationAzureType::AZURE,
      }),
      include_tags: false,
      name: "Nginx Archive",
      query: "source:nginx",
      rehydration_max_scan_size_in_gb: 100,
      rehydration_tags: [
        "team:intake",
        "team:app",
      ],
    }),
    type: "archives",
  }),
})
p api_instance.create_logs_archive(body)
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=ruby) and then save the example to `example.rb` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
##### 

```go
// Create an archive returns "OK" response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)

func main() {
	body := datadogV2.LogsArchiveCreateRequest{
		Data: &datadogV2.LogsArchiveCreateRequestDefinition{
			Attributes: &datadogV2.LogsArchiveCreateRequestAttributes{
				CompressionMethod: datadogV2.LOGSARCHIVEATTRIBUTESCOMPRESSIONMETHOD_GZIP.Ptr(),
				Destination: datadogV2.LogsArchiveCreateRequestDestination{
					LogsArchiveDestinationAzure: &datadogV2.LogsArchiveDestinationAzure{
						Container: "container-name",
						Integration: datadogV2.LogsArchiveIntegrationAzure{
							ClientId: "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa",
							TenantId: "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa",
						},
						StorageAccount: "account-name",
						Type:           datadogV2.LOGSARCHIVEDESTINATIONAZURETYPE_AZURE,
					}},
				IncludeTags:                datadog.PtrBool(false),
				Name:                       "Nginx Archive",
				Query:                      "source:nginx",
				RehydrationMaxScanSizeInGb: *datadog.NewNullableInt64(datadog.PtrInt64(100)),
				RehydrationTags: []string{
					"team:intake",
					"team:app",
				},
			},
			Type: "archives",
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewLogsArchivesApi(apiClient)
	resp, r, err := api.CreateLogsArchive(ctx, body)

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `LogsArchivesApi.CreateLogsArchive`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `LogsArchivesApi.CreateLogsArchive`:\n%s\n", responseContent)
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=go) and then save the example to `main.go` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" go run "main.go"
##### 

```java
// Create an archive returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.LogsArchivesApi;
import com.datadog.api.client.v2.model.LogsArchive;
import com.datadog.api.client.v2.model.LogsArchiveAttributesCompressionMethod;
import com.datadog.api.client.v2.model.LogsArchiveCreateRequest;
import com.datadog.api.client.v2.model.LogsArchiveCreateRequestAttributes;
import com.datadog.api.client.v2.model.LogsArchiveCreateRequestDefinition;
import com.datadog.api.client.v2.model.LogsArchiveCreateRequestDestination;
import com.datadog.api.client.v2.model.LogsArchiveDestinationAzure;
import com.datadog.api.client.v2.model.LogsArchiveDestinationAzureType;
import com.datadog.api.client.v2.model.LogsArchiveIntegrationAzure;
import java.util.Arrays;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    LogsArchivesApi apiInstance = new LogsArchivesApi(defaultClient);

    LogsArchiveCreateRequest body =
        new LogsArchiveCreateRequest()
            .data(
                new LogsArchiveCreateRequestDefinition()
                    .attributes(
                        new LogsArchiveCreateRequestAttributes()
                            .compressionMethod(LogsArchiveAttributesCompressionMethod.GZIP)
                            .destination(
                                new LogsArchiveCreateRequestDestination(
                                    new LogsArchiveDestinationAzure()
                                        .container("container-name")
                                        .integration(
                                            new LogsArchiveIntegrationAzure()
                                                .clientId("aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa")
                                                .tenantId("aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"))
                                        .storageAccount("account-name")
                                        .type(LogsArchiveDestinationAzureType.AZURE)))
                            .includeTags(false)
                            .name("Nginx Archive")
                            .query("source:nginx")
                            .rehydrationMaxScanSizeInGb(100L)
                            .rehydrationTags(Arrays.asList("team:intake", "team:app")))
                    .type("archives"));

    try {
      LogsArchive result = apiInstance.createLogsArchive(body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling LogsArchivesApi#createLogsArchive");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=java) and then save the example to `Example.java` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"
##### 

```rust
// Create an archive returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_logs_archives::LogsArchivesAPI;
use datadog_api_client::datadogV2::model::LogsArchiveAttributesCompressionMethod;
use datadog_api_client::datadogV2::model::LogsArchiveCreateRequest;
use datadog_api_client::datadogV2::model::LogsArchiveCreateRequestAttributes;
use datadog_api_client::datadogV2::model::LogsArchiveCreateRequestDefinition;
use datadog_api_client::datadogV2::model::LogsArchiveCreateRequestDestination;
use datadog_api_client::datadogV2::model::LogsArchiveDestinationAzure;
use datadog_api_client::datadogV2::model::LogsArchiveDestinationAzureType;
use datadog_api_client::datadogV2::model::LogsArchiveIntegrationAzure;

#[tokio::main]
async fn main() {
    let body = LogsArchiveCreateRequest::new().data(
        LogsArchiveCreateRequestDefinition::new("archives".to_string()).attributes(
            LogsArchiveCreateRequestAttributes::new(
                LogsArchiveCreateRequestDestination::LogsArchiveDestinationAzure(Box::new(
                    LogsArchiveDestinationAzure::new(
                        "container-name".to_string(),
                        LogsArchiveIntegrationAzure::new(
                            "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa".to_string(),
                            "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa".to_string(),
                        ),
                        "account-name".to_string(),
                        LogsArchiveDestinationAzureType::AZURE,
                    ),
                )),
                "Nginx Archive".to_string(),
                "source:nginx".to_string(),
            )
            .compression_method(LogsArchiveAttributesCompressionMethod::GZIP)
            .include_tags(false)
            .rehydration_max_scan_size_in_gb(Some(100))
            .rehydration_tags(vec!["team:intake".to_string(), "team:app".to_string()]),
        ),
    );
    let configuration = datadog::Configuration::new();
    let api = LogsArchivesAPI::with_config(configuration);
    let resp = api.create_logs_archive(body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=rust) and then save the example to `src/main.rs` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo run
##### 

```typescript
/**
 * Create an archive returns "OK" response
 */

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v2.LogsArchivesApi(configuration);

const params: v2.LogsArchivesApiCreateLogsArchiveRequest = {
  body: {
    data: {
      attributes: {
        compressionMethod: "GZIP",
        destination: {
          container: "container-name",
          integration: {
            clientId: "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa",
            tenantId: "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa",
          },
          storageAccount: "account-name",
          type: "azure",
        },
        includeTags: false,
        name: "Nginx Archive",
        query: "source:nginx",
        rehydrationMaxScanSizeInGb: 100,
        rehydrationTags: ["team:intake", "team:app"],
      },
      type: "archives",
    },
  },
};

apiInstance
  .createLogsArchive(params)
  .then((data: v2.LogsArchive) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));
```

#### Instructions

First [install the library and its dependencies](https://docs.datadoghq.com/api/latest.md?code-lang=typescript) and then save the example to `example.ts` and run following commands:
    DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"
{% /tab %}
