> For the complete documentation index, see [llms.txt](https://docs.vida.id/identity-stack/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.vida.id/identity-stack/sign/digital-signature/vsp-openapi/api-reference/document-upload.md).

# Document Upload

The **Upload Document API** is used when multiple documents need to be uploaded and grouped within a single envelope. Each document is uploaded individually, generating a unique `document_ids` for each file. These `document_ids` can then be added to a single envelope via the Create Envelope API, enabling all documents to be signed collectively within the same transaction by one or more recipients

{% hint style="info" %}
If the envelope only uses **1 document** You can skip this step and continue to the [Create Envelope](broken://pages/pTQorKzqnISI4zOYDWZ5) API.
{% endhint %}

***

### API Description

<mark style="color:blue;">`POST`</mark> `{environment-url}/document/external-api/rest/v1/document`

***

#### Headers

<table><thead><tr><th>Name</th><th width="251">Type</th><th>Description</th></tr></thead><tbody><tr><td>Content-Type<mark style="color:red;">*</mark></td><td>String</td><td>multipart/form-data</td></tr><tr><td>Authorization<mark style="color:red;">*</mark></td><td>String</td><td><p>Bearer Access Token<br></p><p>Get the access token by calling the</p><p><a href="/pages/XOKnwALziwtzopCd8Bb1#api-description"><strong>Authentication</strong></a> API</p></td></tr></tbody></table>

***

#### Request Body

| Name                                             | Type   | Description                                                                            |
| ------------------------------------------------ | ------ | -------------------------------------------------------------------------------------- |
| file<mark style="color:red;">\*</mark>           | File   | Upload the file to the VIDA Sign Open Platform (max 50 MB, 500 pages).                 |
| creator\_email<mark style="color:red;">\*</mark> | String | Assign document to your member (email must be a registered member under the workspace) |

***

#### Response Body

#### Document Upload Success

HTTP Status Code: `200`

Status : `SUCCESS`

JSON Response:

```json
{
    "success": true,
    "data": {
        "id": "{document_id}"
    }
}
```

#### Forbidden

HTTP Status Code: `403`

Status : `ERROR`

**JSON Response**

```json
{
    "message": "Unable to operate via the integration API.",
    "code": "ES.105011"
}
```

#### Bad Request - PDF Doesn't exist

Bad Request Incase of the PDF file

HTTP Status Code: `400`

Status : `ERROR`

**JSON Response**

```json
{
    "message": "File is empty.",
    "code": "ES.10508"
}
```

#### Bad Request - Large file size

Bad request Incase of large file size

HTTP Status Code: `400`

Status : `ERROR`

**JSON Response**

```json
{
    "code":"ES.10509",
    "message":"File upload too large"
}
```

#### Bad Request - Unsupported file type

Bad request Incase of unsupported file size

HTTP Status Code: `400`

Status : `ERROR`

**JSON Response**

```json
{
    "code":"ES.10505",
    "message":"Unsupported file types."
}
```

#### Bad Request - Invalid Parameter

Incase of invalid parameter. (eg: `creator_email`)

HTTP Status Code: `400`

Status : `ERROR`

**JSON Response**

```json
{
    "message": "Please enter a valid email address",
    "code": "MG.10303"
}
```

#### Bad Request - Invalid Data

The email id provided in the `creator_email` is not a member of the workspace.

HTTP Status Code: `400`

Status : `ERROR`

**JSON Response**

```json
{
    "message": "The `creator_email` is not a member of the current workspace.",
    "code": "MG.20707"
}
```

#### Bad Request - The document page number too large

HTTP Status Code: `400`

Status : `ERROR`

**JSON Response**

```json
{
    "code":"ES.1053",
    "message":"File page count should not be more than 500"
}
```
