Documents

Document Upload

POST
/documents/document/upload

Uploads a document to Storage using multipart/form-data. Accepted extensions are .docx and .xlsx. The uploaded document receives a storage id that can be referenced in later operations such as document merging or signing. Maximum file size is 20 MB in Production and 10 MB in Staging. A file over that limit is rejected by the web server before the operation runs, so it surfaces as a 500 rather than a validation error.

Authorization

AuthorizationBearer <token>

JWT token to authenticate the request.

In: header

X-Api-Key<token>

API key, sent as a request header.

In: header

Request Body

multipart/form-data

TypeScript Definitions

Use the request body type in TypeScript.

body?unknown

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/documents/document/upload" \  -F file="string"
{  "result": {    "data": {      "files": [        {          "id": "7c2f5a91-3e44-4b0d-a6f8-1b2c3d4e5f60",          "fileName": "quarterly-report.docx"        }      ]    },    "statusCode": 201,    "message": "Created"  },  "origin": "POST https://api.doctavian.com/v1/documents/document/upload",  "dateTime": "2026-07-14T09:32:15.000Z",  "operationId": "3a4b5c6d7e8f90112233445566778899",  "userId": "75de96f7-10e3-4a47-9b51-e138462df8b5"}
{  "error": {    "innerErrors": [      {        "code": "VALIDATION_ERROR",        "message": "Name is required.",        "userMessage": "Name is required."      }    ],    "message": "One or more validation errors occurred.",    "statusCode": 400  },  "dateTime": "2026-01-02T12:34:56.000Z",  "operationId": "678928b88de140ac2fb790fedf349b0f",  "origin": "POST https://api.doctavian.com/v1/documents/document/upload",  "userId": "0eb08cbb-4b14-40b1-896e-b679ee2da385"}
{  "error": {    "innerErrors": [      {        "code": "VALIDATION_ERROR",        "message": "Name is required.",        "userMessage": "Name is required."      }    ],    "message": "One or more validation errors occurred.",    "statusCode": 401  },  "dateTime": "2026-01-02T12:34:56.000Z",  "operationId": "100020bac1640e44650abefb5bc96bf0",  "origin": "POST https://api.doctavian.com/v1/documents/document/upload",  "userId": "d113882c-edb5-4675-ac1f-029f1950447d"}
{  "error": {    "innerErrors": [      {        "code": "VALIDATION_ERROR",        "message": "Name is required.",        "userMessage": "Name is required."      }    ],    "message": "One or more validation errors occurred.",    "statusCode": 500  },  "dateTime": "2026-01-02T12:34:56.000Z",  "operationId": "85af533938e6d06fdb6859c461685101",  "origin": "POST https://api.doctavian.com/v1/documents/document/upload",  "userId": "6b480fbe-1bdb-4d35-a80d-0d19ea6f0374"}