---
title: "Upload a document"
method: POST
path: "/v1/documents"
tags: ["Documents"]
---

# Upload a document

`POST /v1/documents`

## Request

- Base URL: `https://api.documentpro.ai`
- URL: `https://api.documentpro.ai/v1/documents`
- Auth: API key in header `x-api-key`

Uploads a document up to 6MB via multipart/form-data. For files over 6MB, first request a pre-signed URL from `GET /v1/documents/upload_url`, PUT the file there, then confirm the upload by calling this same endpoint with `application/json` and the `document_id` from that step.

## Request body

- object: Used only to confirm a large-file upload after PUTting to the pre-signed URL from GET /v1/documents/upload_url.
  - `document_id` string, uuid, required
  - `file_name` string, required

## Response `200`

Document uploaded (or confirmed).

- Document
  - `document_id` string, uuid
  - `user_id` string, uuid
  - `source_name` string
  - `s3_key` string: Temporary S3 URL for the source file.
  - `file_name` string
  - `file_extension` string
  - `num_pages` integer
  - `meta_tags` object
  - `parser_runs` object[]
    - `template_id` string, uuid
    - `template_title` string
    - `request_id` string, uuid
    - `params` object
    - `datetime` string, date-time
  - `created_at` string, date-time
  - `updated_at` string, date-time

## Other responses

- `400`: Malformed request or invalid arguments.
- `403`: API key does not have access to the requested resource, or a plan limit was hit.
- `500`: Something went wrong on DocumentPro's side.

---

[API](https://skmtc.dev/documentpro/apis/documentpro-api.md) · [All operations](https://skmtc.dev/documentpro/apis/documentpro-api/llms.txt) · [OpenAPI document](https://skmtc.dev/documentpro/apis/documentpro-api/revisions/05d6bd485e28?raw)
