---
title: "Upload PDF to Book"
method: POST
path: "/v1/book/upload"
tags: ["File Uploads"]
---

# Upload PDF to Book

`POST /v1/book/upload`

## Request

- Base URL: `https://api.ocrolus.com`
- URL: `https://api.ocrolus.com/v1/book/upload`
- Auth: OAuth 2
  - Client credentials
  - Token URL: `https://auth.ocrolus.com/oauth/token`

Upload a PDF file to a <<glossary:Book>> for processing.

---

You can upload a file to this endpoint as a `multipart/form-data` encoded payload. To learn more, see [multipart/form-data](https://docs.ocrolus.com/reference/multipartform-data-payloads) guide.

Direct document upload is not permitted for Books configured with the Classify-only processing type. Attempting to upload to such a Book returns an error indicating that direct document upload is not allowed for that Book type. 

For all Documents *except* bank statements, the optional `form_type` parameter can be used to specify the type of <<glossary:Document>>. You can see form types we support in our [forms directory](https://docs.ocrolus.com/docs/all-supported-documents). 

For more information, please contact your Account Executive or Customer Success Executive to discuss other options for your organization.

  > 📘 
    > The maximum file size for upload is 200 MB.

## Request body `multipart/form-data`

- object
  - `upload` string, binary, required: One or more PDF files to upload. Each file should be attached as its own part in the `multipart/form-data` body. When multiple files are uploaded together, each is processed independently and the response contains one entry per file in `uploaded_docs`. A partial failure, such as one duplicate file among several, does not prevent the other files from uploading successfully.
  - `book_uuid` string: The unique identifier of the <<glossary:Book>> that the uploaded <<glossary:Document>> will be saved to. Mutually exclusive with `pk`.
  - `pk` integer: A unique primary key <<glossary:PK>> of the <<glossary:Book>> that the uploaded <<glossary:Document>> will be saved to. Mutually exclusive with `book_uuid`.
  - `form_type` string: The code identifying the type of <<glossary:Document>> that you're uploading.
  - `doc_name` string: The name of the <<glossary:Document>> that will be created from the imported file. Defaults to the name of the file if not given.

## Response `200`

200

- union
  - object
    - `status` integer: A numerical code that indicates the status of the request.
    - `response` object: An object received from the server that potentially contains data.
      - `uploaded_docs` object[]: An array of objects containing information about the uploaded documents.
        - `pk` integer: Primary key of the uploaded document.
        - `id` integer: ID of the uploaded document. Same value as `pk`.
        - `uuid` string: UUID of the uploaded document.
        - `name` string: Name of the uploaded document.
        - `page_count` integer: Total number of pages in the uploaded document.
        - `checksum` string: MD5 checksum of the uploaded document.
        - `created_ts` string: Timestamp when the Mixed Document was created.
    - `message` string: A textual description that indicates details about this response's status.
  - object
    - `status` integer: A numerical code that indicates the status of the request.
    - `response` object: An object received from the server that potentially contains data.
      - `status` integer: A numerical code that indicates the nature of the error within the response.
      - `message` string: A textual description of the error.
      - `original_existing_doc_pks` integer[]: An array of primary keys of Documents that already exist in the Book.
      - `original_existing_doc_uuids` string[]: An array of UUIDs of Documents that already exist in the Book.
      - `uploaded_docs` object[]: An array of objects containing information about the uploaded documents.
        - `pk` integer: Primary key of the uploaded document.
        - `id` integer: ID of the uploaded document. Same value as `pk`.
        - `uuid` string: UUID of the uploaded document.
        - `name` string: Name of the uploaded document.
        - `page_count` integer: Total number of pages in the uploaded document.
        - `checksum` string: MD5 checksum of the uploaded document.
        - `created_ts` string: Timestamp when the Mixed Document was created.
    - `message` string: A textual description that indicates details about this response's status.
  - object
    - `status` integer: A numerical code that indicates the status of the request.
    - `response` object: An object received from the server that potentially contains data.
      - `status` integer: A numerical code that indicates the nature of the error within the response.
      - `message` string: A textual description of the error.
      - `original_existing_doc_pks` integer[]: An array of primary keys of Documents that already exist in the Book.
      - `original_existing_doc_uuids` string[]: An array of UUIDs of Documents that already exist in the Book.
      - `uploaded_docs` object[]: An array of objects containing information about the uploaded documents.
        - `pk` integer: Primary key of the uploaded document.
        - `id` integer: ID of the uploaded document. Same value as `pk`.
        - `uuid` string: UUID of the uploaded document.
        - `name` string: Name of the uploaded document.
        - `page_count` integer: Total number of pages in the uploaded document.
        - `checksum` string: MD5 checksum of the uploaded document.
        - `created_ts` string: Timestamp when the Mixed Document was created.
    - `message` string: A textual description that indicates details about this response's status.

## Other responses

- `400`: Client Errors
- `500`: Internal server error

---

[API](https://skmtc.dev/ocrolus/apis/file-uploads.md) - [All operations](https://skmtc.dev/ocrolus/apis/file-uploads/llms.txt) - [OpenAPI document](https://skmtc.dev/ocrolus/apis/file-uploads/revisions/f5da69c79aff?raw)
