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

# POST /predictions

`POST /predictions`

## Headers

- `Content-Type` string, required

## Request body

- PostPredictions
  - `autoRotate` boolean
  - `documentId` string, required
  - `imageQuality` 'LOW' | 'HIGH'
  - `maxPages` integer
  - `modelId` string, required
  - `postprocessConfig` union
    - object
      - `strategy` 'BEST_FIRST', required
    - object
      - `parameters` object, required
        - `collapse` boolean
        - `n` integer, required
      - `strategy` 'BEST_N_PAGES', required
  - `preprocessConfig` object
    - `autoRotate` boolean
    - `imageQuality` 'LOW' | 'HIGH'
    - `maxPages` integer
    - `pages` integer[]
    - `rotation` 0 | 90 | 180 | 270
  - `rotation` 0 | 90 | 180 | 270
  - `trainingId` string

## Response `200`

200 response

- Prediction
  - `createdBy` string, nullable
  - `createdTime` string, nullable
  - `documentId` string, required
  - `inferenceTime` number, required
  - `modelId` string, required
  - `postprocessConfig` union
    - object
      - `strategy` 'BEST_FIRST', required
    - object
      - `parameters` object, required
        - `collapse` boolean
        - `n` integer, required
      - `strategy` 'BEST_N_PAGES', required
  - `predictionId` string, required
  - `predictions` union[], required
    - union
      - object
        - `confidence` number, required
        - `label` string, required
        - `location` number[]
        - `page` integer
        - `value` string, nullable, required
      - object
        - `label` string, required
        - `page` integer
        - `value` array[], required
          - object[]
            - `confidence` number, required
            - `label` string, required
            - `location` number[]
            - `page` integer
            - `value` string, nullable, required
  - `preprocessConfig` object, nullable
    - `autoRotate` boolean
    - `imageQuality` 'LOW' | 'HIGH'
    - `maxPages` integer
    - `pages` integer[]
    - `rotation` 0 | 90 | 180 | 270
  - `trainingId` string, nullable

## Other responses

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

## Changes

- **2023-06-14** `2af8d1616889` — 3 breaking, 3 info
  - the response property `preprocessConfig/autoRotate` became optional for the status `200`
  - the response property `preprocessConfig/imageQuality` became optional for the status `200`
  - the response property `preprocessConfig/maxPages` became optional for the status `200`
  - added the new optional request property `preprocessConfig`
  - …2 more
- **2023-03-28** `6f04f3b3738e` — 2 info
  - added the optional property `postprocessConfig` to the response with the `200` status
  - added the optional property `preprocessConfig` to the response with the `200` status
- **2023-02-27** `38ef4f3feaaf` — 3 info
  - added the new optional request property `rotation`
  - added `subschema #1, subschema #2` to the `predictions/items/` response property `anyOf` list for the response status `200`
  - removed `subschema #1, subschema #2` from the `predictions/items/` response property `anyOf` list for the response status `200`
- …earlier changes not shown

[Full history](https://skmtc.dev/lucidtechai/apis/lucidtech-api/changes/predictions/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/c8551bfdd99f/schema)
