# Create a document

### URL

<mark style="color:green;">**POST**</mark> `https://api.complycube.com/v1/documents`

Creates a new document.

### Headers

<table><thead><tr><th width="245">Name</th><th width="97">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>Content-Type</code><mark style="color:red;">*</mark></td><td>string</td><td>The content-type must always be set to <code>application/json</code>.</td></tr><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>

### Body

<table><thead><tr><th width="245">Name</th><th width="97">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>clientId</code><mark style="color:red;">*</mark></td><td>string</td><td>The ID of the client associated with this document.</td></tr><tr><td><code>type</code><mark style="color:red;">*</mark></td><td>string</td><td>The type of document. Valid values include:<br>1. <code>passport</code><br>2. <code>driving_license</code><br>3. <code>national_insurance_number</code><br>4. <code>social_security_number</code><br>5. <code>tax_identification_number</code><br>6. <code>utility_bill</code><br>7. <code>national_identity_card</code><br>8. <code>visa</code><br>9. <code>polling_card</code><br>10. <code>residence_permit</code><br>11. <code>birth_certificate</code><br>12. <code>bank_statement</code><br>13. <code>change_of_name</code><br>14. <code>tax_document</code><br>15. <code>company_confirmation_statement</code><br>16. <code>company_annual_accounts</code><br>17. <code>company_statement_of_capital</code><br>18. <code>company_change_of_address</code><br>19. <code>company_incorporation</code><br>20. <code>company_change_of_officers</code><br>21. <code>company_change_of_beneficial_owners</code><br>22. <code>unknown</code><br>23. <code>other</code></td></tr><tr><td><code>documentNumber</code></td><td>string</td><td>The document's number.</td></tr><tr><td><code>classification</code></td><td>string</td><td>The classification or purpose of this document. Valid values include:<br>1. <code>proof_of_identity</code><br>2. <code>source_of_wealth</code><br>3. <code>source_of_funds</code><br>4. <code>proof_of_address</code><br>5. <code>company_filing</code><br>6. <code>other</code></td></tr><tr><td><code>issuingCountry</code></td><td>string</td><td>The document's issuing country. This will be the <a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">two-letter country ISO code</a>.</td></tr><tr><td><code>issuingState</code></td><td>string</td><td>The state that issued the document. This must be the <a href="https://pe.usps.com/text/pub28/28apb.htm">state's USPS abbreviation</a> (e.g. <code>NY</code>, <code>CA</code>, or <code>DE</code>).</td></tr></tbody></table>

### Example request

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

```bash
curl -X POST https://api.complycube.com/v1/documents \
     -H 'Authorization: <YOUR_API_KEY>' \
     -H 'Content-Type: application/json' \
     -d '{
          	"clientId":"5eb1276d96be4a0008713af5",
          	"type": "driving_license",
          	"classification": "proof_of_identity",
          	"issuingCountry": "GB" 
        }'
```

{% endtab %}

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

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

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

const document = await complycube.document.create("CLIENT_ID", {
    type: "driving_license",
    classification: "proof_of_identity",
    issuingCountry: "GB"
});
```

{% endtab %}

{% tab title="Python" %}

```python
from complycube import ComplyCubeClient
cc_api = ComplyCubeClient(api_key='<YOUR_API_KEY>')

new_document = {
    'type': 'driving_license',
    'classification': 'proof_of_identity',
    'issuingCountry': 'GB'
}

doc = cc_api.documents.create('CLIENT_ID', **new_document)
```

{% endtab %}

{% tab title="PHP" %}

```php
use ComplyCube\ComplyCubeClient;

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

$doc = $ccapi->documents()->create('CLIENT_ID', ['type' => 'passport']);
```

{% endtab %}

{% tab title=".NET" %}

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

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

var docRequest = new DocumentRequest {
  clientId = "CLIENT_ID",
  type = "passport",
  classification = "proof_of_identity",
  issuingCountry = "GB"
};

var document = await docApi.CreateAsync(docRequest);
```

{% endtab %}
{% endtabs %}

### Example responses

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

```json
{
    "id": "5eb158880c19580007310f22",
    "clientId": "5eb1276d96be4a0008713af5",
    "type": "driving_license",
    "classification": "proof_of_identity",
    "issuingCountry": "GB",
    "createdAt": "2020-01-04T17:24:29.146Z",
    "updatedAt": "2020-01-04T17:24:29.146Z"
}
```

{% endtab %}

{% tab title="Invalid Request (400)" %}

```json
{
    "type": "invalid_request",
    "message": "'classification' should be equal to one of the allowed values: proof_of_identity,source_of_wealth,source_of_funds,proof_of_address,company_filing,other",
    "param": "classification"
}
```

{% endtab %}

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

```json
{
    "type": "resource_not_found",
    "message": "Invalid client id '5eb1276d96be4a0008713af2'"
}
```

{% 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/create-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.
