# Manage documents by APIs

nCore platform’s document management feature enables you to upload and manage user identification documents (passport, visa, national ID etc.) for identity verification.

You can create and manage user’s supporting identification documents by using our following APIs available as nCore platform.&#x20;

* Create a user identification
* Get a user identification
* Get a specific user identification
* Update a user identification&#x20;
* Upload a user identification
* Upload a single image of a user identification
* Return a file metadata
* Return a file
* Download a file
* Delete a file

### **Create a user identification**

You can create a user identification by sending a **POST** request to **/users/{user\_id}/identifications** endpoint as shown below.

<details>

<summary><a href="https://nymcard.com/docs/api#tag/User-documents/operation/createIdentification">POST /users/{user_id}/identifications</a></summary>

**`{`**\
`    `**`"type": "PASSPORT",`**\
`    `**`"number": "132123123",`**\
`    `**`"expiration_date": "2021-09-20T10:10:40.182Z",`**\
\&#xNAN;**`}`**

</details>

### **Get a user identifications**

You can retrieve a list of user identifications by sending a **GET** request to **/users/{user\_id}/identifications** endpoint as shown below.

> [**GET /users/{user\_id}/identifications**](https://nymcard.com/docs/api#tag/User-documents/operation/getIdentifications)

### **Get a specific user identification**

You can retrieve a specific user identification info by sending a **GET** request to **/users/{user\_id}/identifications/{identification\_id}** endpoint as shown below.

> [**GET /users/{user\_id}/identifications/{identification\_id}**](https://nymcard.com/docs/api#tag/User-documents/operation/getIdentification)

### **Update a user identification**

You can update any user identification by sending a **PUT** request **/users/{user\_id}/identifications/{identification\_id}** endpoint as shown below.

> [**PUT /users/{user\_id}/identifications/{identification\_id}**](https://nymcard.com/docs/api#tag/User-documents/operation/updateIdentification)

### **Upload a user identification**

You can upload more than one identification files by sending a **PUT** request to **/users/{user\_id}/identifications/{identification\_id}** endpoint as shown below.

> [**PUT /users/{user\_id}/identifications/{identification\_id}/files**](https://nymcard.com/docs/api#tag/User-documents/operation/UploadIdentification)

Please note:

* Using this API, you can upload maximum 5 files at a time.&#x20;
* The maximum size of the file is 128 Mb.
* Allowed extensions are .pdf, .jpg, .jpeg, .png, .bmp, .doc, and .docx.&#x20;
* A single user identification can have maximum 10 files.

### **Upload a single image of user identification**

You can upload a single user identification file by sending a **PUT** request to **/users/{user\_id}/identifications/{identification\_id}/files** endpoint as shown below.

> [**PUT /users/{user\_id}/identifications/{identification\_id}/files**](https://nymcard.com/docs/api#tag/User-documents/operation/uploadSingleFile)

Please note:&#x20;

* Using this API, you can upload a single file at a time.&#x20;
* The maximum size of the file is 128 Mb.
* Allowed extensions are .pdf, .jpg, .jpeg, .png, .bmp, .doc, and .docx.&#x20;
* A single user identification can have maximum 10 files.

{% hint style="info" %}
Note, that these APIs contain 'identification\_type' and 'identification\_document\_type' parameters, which can have the following values:&#x20;

a) identification\_type = NATIONAL\_ID&#x20;

identification\_document\_type = NATIONAL\_ID\_FRONT & NATIONAL\_ID\_BACK&#x20;

b) identification\_type = PASSPORT&#x20;

identification\_document\_type = PASSPORT\_PAGE1 & PASSPORT\_PAGE2

c) identification\_type = VISA&#x20;

identification\_document\_type = VISA&#x20;

d) identification\_type = TRADE\_LICENSE, COMMERCIAL\_LICENSE, INCORPORATION\_CERT, INCUMBENCY\_CERT, MEMORANDUM\_ARTICLES, BANK\_STATEMENT, ADDITIONAL&#x20;

identification\_document\_type = NOT APPLICABLE
{% endhint %}

### **Return a file metadata**

You can retrieve a specific file metadata info by sending a **GET** request to **/users/{user\_id}/identifications/{identification\_id}/files/{file\_id}** endpoint as shown below.

> [**GET /users/{user\_id}/identifications/{identification\_id}/files/{file\_id}**](https://nymcard.com/docs/api#tag/User-documents/operation/getFile)

### **Return a file**&#x20;

You can browse a specific user identification file by sending a **GET** request to **/users/{user\_id}/identifications/{identification\_id}/files/{file\_id}:browse** endpoint as shown below.

> [**GET /users/{user\_id}/identifications/{identification\_id}/files/{file\_id}:browse**](https://nymcard.com/docs/api#tag/User-documents/operation/browseFile)

### **Download a file**&#x20;

You can download a specific file by sending a **GET** request to **/users/{user\_id}/identifications/{identification\_id}/files/{file\_id}:download** endpoint as shown below.

> [**GET /users/{user\_id}/identifications/{identification\_id}/files/{file\_id}:download**](https://nymcard.com/docs/api#tag/User-documents/operation/downloadFile)

### **Delete a file**&#x20;

You can delete a specific user identification file by sending a **DELETE** request to **/users/{user\_id}/identifications/{identification\_id}/files/{file\_id}** endpoint as shown below.

> [**DELETE /users/{user\_id}/identifications/{identification\_id}/files/{file\_id}**](https://nymcard.com/docs/api#tag/User-documents/operation/deleteFile)
