# Download audit trail

{% get /%}
{% path text="/v1/document/downloadAuditLog" /%}

Returns the audit log for the completed document in PDF format for the specified document Id. This audit trail document will contain information about the different actions performed by the recipients with time stamp along with hash of the digitally signed document, which can be used to determine if the signed document is modified.

When the document is created on behalf of a particular sender email, then the download audit trail operation can be performed on the same account by specifying the email in the `onBehalfOf.`

## Code snippet

{% codetab %}

cURL

```shell
curl -X GET 'https://api.boldsign.com/v1/document/downloadAuditLog?documentId=949ebf20-45a8-4a3e-91a9-68e9540e0020' \
     -H 'accept: application/json' \
     -H 'X-API-KEY: {your-api-key}'
```

C#

```csharp
ApiClient apiClient = new ApiClient("https://api.boldsign.com", "Your_API_Key");

DocumentClient documentClient = new DocumentClient(apiClient);
var documentStream = documentClient.DownloadAuditLog("YOUR_DOCUMENT_ID");
```

Python

```python
import boldsign

configuration = boldsign.Configuration(host = "https://api.boldsign.com", api_key="YOUR_API_KEY")

with boldsign.ApiClient(configuration) as api_client:
    
    document_api = boldsign.DocumentApi(api_client)
    document_stream = document_api.download_audit_log(document_id="YOUR_DOCUMENT_ID")
```

PHP

```php
<?php require_once "vendor/autoload.php";

use BoldSign\Configuration;
use BoldSign\Api\DocumentApi;

$config = new Configuration();
$config->setHost('https://api.boldsign.com');
$config->setApiKey('YOUR_API_KEY');

$document_api = new DocumentApi($config);
$document_stream = $document_api->downloadAuditLog($document_id = 'YOUR_DOCUMENT_ID');
```

Java

```java
ApiClient client = Configuration.getDefaultApiClient();
client.setBasePath("https://api.boldsign.com");
client.setApiKey("YOUR_API_KEY");
        
DocumentApi documentApi = new DocumentApi(client); 
File documentStream = documentApi.downloadAuditLog("YOUR_DOCUMENT_ID", null);
```

NodeJS

```js
import { DocumentApi } from "boldsign";

const documentApi = new DocumentApi("https://api.boldsign.com");
documentApi.setApiKey("YOUR_API_KEY");

const documentStream = documentApi.downloadAuditLog("YOUR_DOCUMENT_ID");
```

{% /codetab %}

## Query parameters

{% nestedtable %}

- {% arguments name="documentId" /%}{% batch datatype="string" /%}{% required /%}
- The unique document id of the document.

---

- {% arguments name="onBehalfOf" /%}{% batch datatype="string" /%}
- The on behalf email address of the sender.

{% /nestedtable %}

## Example response

***200 Success***

```json
Contains the audit PDF document
```
