# Download a specific audit log export

```
GET https://www.example.com/api/v2/consent/audit_log/:id
```

Downloads the contents of a specific monthly audit log export file. The response is a JSON file containing an array of individual consent audit log records, returned as an attachment.

## Request

### Path Parameters

**id** integerrequired

The ID of the audit log export to download.

**Example:** `30`

### Header Parameters

**authorization** stringrequired

**Example:** `Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9`

## Responses

- 200
- 401
- 502

Audit log export file downloaded

- application/json

- Schema
- Example (auto)

**Schema**

- Array [
    
    **consent_container_version_id** string
    
    The unique identifier of the consent container version.
    
    **Example:** `3232ed80-72fb-4ac9-badc-1c8acef8cd1f`
    
    **consent_preferences** string
    
    The consent preferences of the user, in JSON format.
    
    **Example:** `{\n  "cookieOptions": [\n    {\n      "gtm_key": "dg-consent-category-54b4ce",\n      "isEnabled": true\n    },\n    {\n      "gtm_key": "dg-consent-category-6994d6",\n      "isEnabled": true\n    },\n    {\n      "gtm_key": "dg-consent-category-4e97c2",\n      "isEnabled": true\n    },\n    {\n      "gtm_key": "dg-consent-category-dfb0b8",\n      "isEnabled": true\n    },\n    {\n      "gtm_key": "dg-consent-category-5deaeb",\n      "isEnabled": true\n    },\n    {\n      "gtm_key": "dg-consent-category-d4e8ec",\n      "isEnabled": true\n    }\n  ],\n  "isCustomised": true\n}`
    
    **consent_state** string
    
    The consent state of the user, such as "Accept All", "Reject All", etc.
    
    **Example:** `Accept All`
    
    **created_at** string
    
    The timestamp when the consent preferences were created.
    
    **Example:** `2024-11-14T19:53:25.223024Z`
    
    **customer_supplied** string | nullnullable
    
    Any customer-supplied information related to the consent preferences.
    
    **dg_customer_id** string
    
    The unique identifier of the DataGrail customer.
    
    **Example:** `c30be0d2-795f-40af-9f70-502b83f7bb68`
    
    **dg_id** string
    
    The unique identifier of the Consent User.
    
    **Example:** `3232ed80-72fb-4ac9-badc-1c8acef8cd1f`
    
    **languages** string
    
    The languages accepted by the user, in the format of a language tag from the browser.
    
    **Example:** `en-US,en;q=0.9`
    
    **method** string
    
    The method of consent collection, such as "optout", "optin"
    
    **Example:** `optout`
    
    **country** string | nullnullable
    
    The country of the user, if available.
    
    **Example:** `US`
    
    **region** string | nullnullable
    
    The region of the user, if available. This could be a state or province code, for example.
    
    **Example:** `CA`
    
    **url** string
    
    The URL where the consent preferences were collected.
    
    **Example:** `https://www.beepyoinkslam.lol/#`
    
    **url_domain** string
    
    The domain of the URL where the consent preferences were collected.
    
    **Example:** `www.beepyoinkslam.lol`
    
    **policyName** string | nullnullable
    
    The name of the policy associated with the consent preferences, if applicable.
    
    **Example:** `GDPR`
    
    **defaultPolicy** boolean
    
    Whether the applicable policy is the default policy.
    
    **Example:** `false`
    
    **locale_code** string | nullnullable
    
    The locale code of the user, if available.
    
    **Example:** `

- ]

```json
[
  {
    "consent_container_version_id": "3232ed80-72fb-4ac9-badc-1c8acef8cd1f",
    "consent_preferences": "{\n  \"cookieOptions\": [\n    {\n      \"gtm_key\": \"dg-consent-category-54b4ce\",\n      \"isEnabled\": true\n    },\n    {\n      \"gtm_key\": \"dg-consent-category-6994d6\",\n      \"isEnabled\": true\n    },\n    {\n      \"gtm_key\": \"dg-consent-category-4e97c2\",\n      \"isEnabled\": true\n    },\n    {\n      \"gtm_key\": \"dg-consent-category-dfb0b8\",\n      \"isEnabled\": true\n    },\n    {\n      \"gtm_key\": \"dg-consent-category-5deaeb\",\n      \"isEnabled\": true\n    },\n    {\n      \"gtm_key\": \"dg-consent-category-d4e8ec\",\n      \"isEnabled\": true\n    }\n  ],\n  \"isCustomised\": true\n}\n",
    "consent_state": "Accept All",
    "created_at": "2024-11-14T19:53:25.223024Z",
    "customer_supplied": "string",
    "dg_customer_id": "c30be0d2-795f-40af-9f70-502b83f7bb68",
    "dg_id": "3232ed80-72fb-4ac9-badc-1c8acef8cd1f",
    "languages": "en-US,en;q=0.9",
    "method": "optout",
    "country": "US",
    "region": "CA",
    "url": "https://www.beepyoinkslam.lol/#",
    "url_domain": "www.beepyoinkslam.lol",
    "policyName": "GDPR",
    "defaultPolicy": false,
    "locale_code": ""
  }
]
```

Unauthorized

Bad Gateway when export fetch fails

- curl
- go
- java
- nodejs
- php
- python
- ruby
- rust
- swift

- CURL

```bash
curl -L 'https://www.example.com/api/v2/consent/audit_log/:id' \
-H 'Accept: application/json'
```
