# Document Management

## Overview

The document management system has been restructured to align with the entity-role architecture separation, providing more precise document categorization based on the associated entity or role type.

## Document Endpoints

The document management API uses the following key endpoints:

* **Upload Document**: `POST /v2/documents/` - Used to upload documents for entities and roles with appropriate `resourceType` and `resourceId`
* **Sign Document**: `POST /v2/documents/sign` - Used to sign documents by natural persons
* **Get Document**: `GET /v2/documents/{documentId}` - Used to retrieve document metadata
* **Get Document File**: `GET /v2/documents/{documentId}/file` - Used to download document file content

When uploading or managing documents, always specify the correct resource type that matches the entity or role the document belongs to.

## Document Types

### Complete Document Types Overview

| Document Group                | Document Type                                                                                                                                                                                                                                    | Entities/Roles                                                                                                                                                               |
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Company documents             | <p><code>CURRENT\_REGISTRY\_EXTRACT</code><br><code>CHRONOLOGICAL\_REGISTRY\_EXTRACT</code><br><code>SHAREHOLDER\_LIST</code><br><code>PARTNERSHIP\_AGREEMENT</code><br><code>TRANSPARENCY\_REGISTER\_EXTRACT</code><br><code>STATUTE</code></p> | `LEGAL_ENTITY`                                                                                                                                                               |
| Company documents             | `BUSINESS_REGISTRATION`                                                                                                                                                                                                                          | <p><code>NATURAL\_PERSON</code><br><code>LEGAL\_ENTITY</code></p>                                                                                                            |
| Kyc documents                 | <p><code>IDENTIFICATION\_CERTIFICATE</code><br><code>PROOF\_OF\_RESIDENCE</code><br><code>KYC</code></p>                                                                                                                                         | <p><code>NATURAL\_PERSON</code><br><code>PARTNER\_USER</code></p>                                                                                                            |
| Kyc documents                 | `BIRTH_CERTIFICATE`                                                                                                                                                                                                                              | `NATURAL_PERSON` (Minor)                                                                                                                                                     |
| Kyc documents                 | `DEATH_CERTIFICATE`                                                                                                                                                                                                                              | `NATURAL_PERSON`                                                                                                                                                             |
| Tax documents                 | `TIN_NA_CONFIRMATION`                                                                                                                                                                                                                            | `NATURAL_PERSON`                                                                                                                                                             |
| Tax documents                 | `W_8BEN_E`                                                                                                                                                                                                                                       | `LEGAL_ENTITY`                                                                                                                                                               |
| Financial situation documents | <p><code>SOURCE\_OF\_INCOME</code><br><code>SOURCE\_OF\_FUNDS</code></p>                                                                                                                                                                         | `CUSTOMER`                                                                                                                                                                   |
| Proxy documents               | <p><code>PROOF\_OF\_SINGLE\_CUSTODY</code><br><code>PROOF\_OF\_CUSTODY</code></p>                                                                                                                                                                | `PROXY` (Guardian)                                                                                                                                                           |
| Proxy documents               | `INSOLVENCY_ORDER`                                                                                                                                                                                                                               | `PROXY` (Liquidator)                                                                                                                                                         |
| Proxy documents               | `INHERITANCE_LEGITIMATION`                                                                                                                                                                                                                       | `PROXY` (Power of Attorney in case of death)                                                                                                                                 |
| General documents             | `OTHER`                                                                                                                                                                                                                                          | <p><code>NATURAL\_PERSON</code><br><code>JOINT\_PERSON</code><br><code>LEGAL\_ENTITY</code><br><code>PARTNER\_USER</code><br><code>CUSTOMER</code><br><code>PROXY</code></p> |

## Document Status and Notifications

During the onboarding process, documents go through various status changes:

* **CREATED** - Document has been uploaded
* **PENDING** - Document is being processed during onboarding
* **APPROVED** - Document has been approved and validated
* **REJECTED** - Document failed validation

Partners receive `Document Notification` webhooks for all status changes throughout the document lifecycle.

{% hint style="warning" %}
**Important: Document processing is asynchronous.** After uploading a document via `POST /v2/documents/`, the document does not immediately reach `CREATED` status. Partners **must wait** for the `Document Notification` webhook confirming the `CREATED` status before initiating onboarding. Starting the onboarding process before all required documents have reached `CREATED` status will result in onboarding rejection with a validation error indicating that required documents do not exist for the entity.
{% endhint %}


---

# 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.tradevest.ai/documentation/entity_role_management_after_refactor/document_management.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.
