# Get a document

### URL

<mark style="color:blue;">**GET**</mark> `https://api.complycube.com/v1/documents/:id`

Retrieves an existing document.

{% hint style="info" %}
This will retrieve the document object. To download attachments, you should use the [download attachment image](/documentation/api-reference/core-resources/documents/download-image-attachment.md) endpoint.
{% endhint %}

### Headers

<table><thead><tr><th width="301">Name</th><th width="80">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>Authorization</code><mark style="color:red;">*</mark></td><td>string</td><td>The API <strong><code>live</code></strong> or <strong><code>test</code></strong> key.</td></tr></tbody></table>

### Path parameters

<table><thead><tr><th width="298">Name</th><th width="83">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>id</code><mark style="color:red;">*</mark></td><td>string</td><td>The ID of the document.</td></tr></tbody></table>

### Example request

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X GET https://api.complycube.com/v1/documents/{:documentId} \
     -H 'Authorization: <YOUR_API_KEY>' 
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
const { ComplyCube } = require("@complycube/api");

const complycube = new ComplyCube({ apiKey: "<YOUR_API_KEY>" });

const document = await complycube.document.get("DOCUMENT_ID");
```

{% endtab %}

{% tab title="Python" %}

```python
from complycube import ComplyCubeClient

cc_api = ComplyCubeClient(api_key='<YOUR_API_KEY>')

document = cc_api.documents.get('DOCUMENT_ID')
```

{% endtab %}

{% tab title="PHP" %}

```php
use ComplyCube\ComplyCubeClient;

$ccapi = new ComplyCubeClient('<YOUR_API_KEY>');

$document = $ccapi->documents()->get('DOCUMENT_ID');
```

{% endtab %}

{% tab title=".NET" %}

```csharp
using ComplyCube.Net;
using ComplyCube.Net.Resources.Documents;

var docApi = new DocumentApi(new ComplyCubeClient("<YOUR_API_KEY>"));

var document = await docApi.GetAsync("DOCUMENT_ID");
```

{% endtab %}
{% endtabs %}

### Example responses

{% tabs %}
{% tab title="Success (200)" %}

```json
{
    "id": "5eb158880c19580007310f22",
    "clientId": "5eb1276d96be4a0008713af5",
    "type": "driving_license",
    "classification": "proof_of_identity",
    "issuingCountry": "GB",
    "images": [
        {
            "id": "5eb3c8ff2b5c980007e62024",
            "fileName": "front-test.jpg",
            "documentSide": "front",
            "downloadLink": "/documents/5eb158880c19580007310f22/images/5eb169302d868c0008828591/download",
            "contentType": "image/jpg",
            "size": 72716,
            "createdAt": "2020-01-04T18:20:21.122Z",
            "updatedAt": "2020-01-04T18:20:21.122Z"
        }
    ],
    "createdAt": "2020-01-04T17:24:29.146Z",
    "updatedAt": "2020-01-04T17:24:29.146Z"
}
```

{% endtab %}

{% tab title="Resource Not Found (404)" %}

```json
{
    "type": "resource_not_found",
    "message": "Invalid document id '5eb158880c19580007310f21'"
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.complycube.com/documentation/api-reference/core-resources/documents/get-a-document.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
