# Manage & Operate › Logs Data Platform › Data streams › Archives API

> Part of the OVHcloud developer hub. Index of every page and section: https://developers.eu.ovhcloud.com/llms.txt
> The Manage & Operate product's sections: https://developers.eu.ovhcloud.com/reference/manage-operate/llms.txt
> Everything in one file: https://developers.eu.ovhcloud.com/llms-full.txt

> 4 operations of the OVHcloud API. Calls carry `authorization: Bearer $OVH_TOKEN`; the EU host is shown, Canada and the United States answer on api.ca.ovhcloud.com and api.us.ovhcloud.com.

Page: https://developers.eu.ovhcloud.com/reference/manage-operate/logs-data-platform/data-streams/archives/

OpenAPI v1: https://api.eu.ovhcloud.com/1.0/__schemas/developer-hub-navigation/manage-operate/logs-data-platform/data-streams/archives.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/manage-operate/logs-data-platform/data-streams/archives.json?format=openapi3

## Operations

- `GET /dbaas/logs/{serviceName}/output/graylog/stream/{streamId}/archive` — List archives
- `GET /dbaas/logs/{serviceName}/output/graylog/stream/{streamId}/archive/{archiveId}` — Get an archive
- `GET /dbaas/logs/{serviceName}/output/graylog/stream/{streamId}/archive/{archiveId}/encryptionKey` — List encryption keys for an archive
- `POST /dbaas/logs/{serviceName}/output/graylog/stream/{streamId}/archive/{archiveId}/url` — Create a temporary URL for an archive

## List archives

`GET /1.0/dbaas/logs/{serviceName}/output/graylog/stream/{streamId}/archive`

Link: https://developers.eu.ovhcloud.com/reference/manage-operate/logs-data-platform/data-streams/archives/#get-dbaas-logs-servicename-output-graylog-stream-streamid-archive

**Status:** Stable production version  
**IAM actions:** `ldp:apiovh:output/graylog/stream/archive/get`

Returns the archives of the Logs Data Platform service.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | Service name |
| `streamId` | path | string (uuid) | yes | Stream ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | string (uuid)[] | successful operation |
| 404 | object | Error 404 response |

```json
[
  "00000000-0000-0000-0000-000000000000"
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/dbaas/logs/{serviceName}/output/graylog/stream/{streamId}/archive" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/dbaas/logs/{serviceName}/output/graylog/stream/{streamId}/archive")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/dbaas/logs/{serviceName}/output/graylog/stream/{streamId}/archive");

print_r($result);
?>
```

## Get an archive

`GET /1.0/dbaas/logs/{serviceName}/output/graylog/stream/{streamId}/archive/{archiveId}`

Link: https://developers.eu.ovhcloud.com/reference/manage-operate/logs-data-platform/data-streams/archives/#get-dbaas-logs-servicename-output-graylog-stream-streamid-archive-archiveid

**Status:** Stable production version  
**IAM actions:** `ldp:apiovh:output/graylog/stream/archive/get`

Returns the archive.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `archiveId` | path | string (uuid) | yes | Archive ID |
| `serviceName` | path | string | yes | Service name |
| `streamId` | path | string (uuid) | yes | Stream ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | dbaas.logs.Archive | successful operation |
| 404 | object | Error 404 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `archiveId` | string (uuid) | read-only | Archive ID |
| `createdAt` | string (date-time) | read-only | Create date |
| `filename` | string | read-only | Filename |
| `md5` | string | read-only | MD5 checksum |
| `retrievalDelay` | integer | read-only | Retrieval delay |
| `retrievalState` | dbaas.logs.ArchiveRetrievalStateEnum | read-only | Retrieval state — one of `sealed`, `unsealed`, `unsealing` |
| `sha256` | string | read-only | sha256 checksum |
| `size` | integer | read-only | File size in bytes |

```json
{
  "archiveId": "00000000-0000-0000-0000-000000000000",
  "createdAt": "2024-01-01T12:00:00Z",
  "filename": "string",
  "md5": "string",
  "retrievalDelay": 0,
  "retrievalState": "sealed",
  "sha256": "string",
  "size": 0
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/dbaas/logs/{serviceName}/output/graylog/stream/{streamId}/archive/{archiveId}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/dbaas/logs/{serviceName}/output/graylog/stream/{streamId}/archive/{archiveId}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/dbaas/logs/{serviceName}/output/graylog/stream/{streamId}/archive/{archiveId}");

print_r($result);
?>
```

## List encryption keys for an archive

`GET /1.0/dbaas/logs/{serviceName}/output/graylog/stream/{streamId}/archive/{archiveId}/encryptionKey`

Link: https://developers.eu.ovhcloud.com/reference/manage-operate/logs-data-platform/data-streams/archives/#get-dbaas-logs-servicename-output-graylog-stream-streamid-archive-archiveid-encryptionkey

**Status:** Stable production version  
**IAM actions:** `ldp:apiovh:output/graylog/stream/archive/encryptionKey/get`

Returns the encryption keys that can decrypt the archive.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `archiveId` | path | string (uuid) | yes | Archive ID |
| `serviceName` | path | string | yes | Service name |
| `streamId` | path | string (uuid) | yes | Stream ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | string (uuid)[] | successful operation |
| 404 | object | Error 404 response |

```json
[
  "00000000-0000-0000-0000-000000000000"
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/dbaas/logs/{serviceName}/output/graylog/stream/{streamId}/archive/{archiveId}/encryptionKey" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/dbaas/logs/{serviceName}/output/graylog/stream/{streamId}/archive/{archiveId}/encryptionKey")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/dbaas/logs/{serviceName}/output/graylog/stream/{streamId}/archive/{archiveId}/encryptionKey");

print_r($result);
?>
```

## Create a temporary URL for an archive

`POST /1.0/dbaas/logs/{serviceName}/output/graylog/stream/{streamId}/archive/{archiveId}/url`

Link: https://developers.eu.ovhcloud.com/reference/manage-operate/logs-data-platform/data-streams/archives/#post-dbaas-logs-servicename-output-graylog-stream-streamid-archive-archiveid-url

**Status:** Stable production version  
**IAM actions:** `ldp:apiovh:output/graylog/stream/archive/url/generate`

Creates a temporary URL to download the archive. The URL expires.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `archiveId` | path | string (uuid) | yes | Archive ID |
| `serviceName` | path | string | yes | Service name |
| `streamId` | path | string (uuid) | yes | Stream ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | dbaas.logs.ArchiveUrl | successful operation |
| 404 | object | Error 404 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `expirationDate` | string (date-time) | read-only | Temporary URL expiration date |
| `url` | string | read-only | Temporary URL to get archive |

```json
{
  "expirationDate": "2024-01-01T12:00:00Z",
  "url": "string"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/dbaas/logs/{serviceName}/output/graylog/stream/{streamId}/archive/{archiveId}/url" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.post("/dbaas/logs/{serviceName}/output/graylog/stream/{streamId}/archive/{archiveId}/url")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->post("/dbaas/logs/{serviceName}/output/graylog/stream/{streamId}/archive/{archiveId}/url");

print_r($result);
?>
```
