---
title: "POST /documents"
method: POST
path: "/documents"
---

# POST /documents

`POST /documents`

## Headers

- `Content-Type` string, required

## Request body

- PostDocuments
  - `consentId` string
  - `content` string
  - `contentType` 'application/pdf' | 'image/jpeg' | 'image/png' | 'image/tiff' | 'image/webp', nullable
  - `datasetId` string
  - `description` string, nullable
  - `groundTruth` object[]
    - `confidence` number
    - `label` string, required
    - `pages` integer[]
    - `value` union, required
      - string, nullable
      - boolean, nullable
      - number, nullable
      - union
        - object[]
          - `confidence` number
          - `label` string, required
          - `pages` integer[]
          - `value` union, required
            - string
            - boolean
            - number
            - GroundTruthList — recursive
        - array[]
          - object[]
            - `confidence` number
            - `label` string, required
            - `pages` integer[]
            - `value` union, required
              - …
  - `metadata` object
  - `name` string, nullable
  - `retentionInDays` integer

## Response `200`

200 response

- Document
  - `consentId` string
  - `content` string, nullable
  - `contentMD5` string, nullable
  - `contentType` 'application/pdf' | 'image/jpeg' | 'image/png' | 'image/tiff' | 'image/webp', nullable
  - `createdBy` string, nullable, required
  - `createdTime` string, nullable, required
  - `datasetId` string
  - `description` string, nullable, required
  - `documentId` string, required
  - `fileUrl` string, nullable
  - `groundTruth` object[]
    - `confidence` number
    - `label` string, required
    - `pages` integer[]
    - `value` union, required
      - string, nullable
      - boolean, nullable
      - number, nullable
      - union
        - object[]
          - `confidence` number
          - `label` string, required
          - `pages` integer[]
          - `value` union, required
            - string
            - boolean
            - number
            - GroundTruthList — recursive
        - array[]
          - object[]
            - `confidence` number
            - `label` string, required
            - `pages` integer[]
            - `value` union, required
              - …
  - `metadata` object, nullable, required
  - `name` string, nullable, required
  - `retentionInDays` integer, required
  - `updatedBy` string, nullable, required
  - `updatedTime` string, nullable, required

## Other responses

- `400` — 400 response
- `403` — 403 response
- `404` — 404 response
- `415` — 415 response
- `500` — 500 response

## Changes

- **2026-07-13** `d5fe190026be` — 2 breaking, 1 warning, 7 info
  - removed `subschema #1, subschema #2` from the `groundTruth/items/value/anyOf[#/components/schemas/groundTruthList]/` request property `anyOf` list
  - the `groundTruth/items/value/anyOf[subschema #1]/` response property's maxLength was increased from `512` to `1024` for the response status `200`
  - added the new `image/webp` enum value to the `contentType` response property for the response status `200`
  - added the new optional request property `groundTruth/items/confidence`
  - …6 more
- **2023-10-02** `7856756ecb64` — 1 breaking, 5 info
  - removed `subschema #1, subschema #2` from the `groundTruth/items/value/anyOf[#/components/schemas/groundTruthList]/` request property `anyOf` list
  - added the new optional request property `groundTruth/items/pages`
  - added `subschema #1, subschema #2` to the `groundTruth/items/value/anyOf[#/components/schemas/groundTruthList]/` request property `anyOf` list
  - added the optional property `groundTruth/items/pages` to the response with the `200` status
  - …2 more
- **2023-06-27** `654101a6bca7` — 4 breaking, 3 info
  - the response property `content` became nullable for the status `200`
  - the response property `contentType` became nullable for the status `200`
  - the response property `contentMD5` became optional for the status `200`
  - the response property `contentType` became optional for the status `200`
  - …3 more
- …earlier changes not shown

[Full history](https://skmtc.dev/lucidtechai/apis/lucidtech-api/changes/documents/post.md)

---

[API](https://skmtc.dev/lucidtechai/apis/lucidtech-api.md) · [All operations](https://skmtc.dev/lucidtechai/apis/lucidtech-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/lucidtechai/lucidtech-api/revisions/d5fe190026be/schema)
