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

# Upload Mixed Document PDF to Book

`POST /v1/book/upload/mixed`

## Request

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

Upload a PDF file containing more than one <<glossary:Document>> to a <<glossary:Book>>.

---
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.

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

## Request body `multipart/form-data`

- object
  - `upload` string, binary, required: The PDF file to upload.
  - `book_uuid` string: The unique identifier of the <<glossary:Book>> that the uploaded <<glossary:Document>>s will be saved to. Mutually exclusive with `pk`.
  - `pk` integer: Unique primary key of the Book that the uploaded Mixed Document will be saved to. Mutually exclusive with `book_uuid`
  - `doc_name` string: The name of the Mixed <<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.
      - `mixed_uploaded_docs` object[]: An array of objects containing information about the uploaded Mixed Documents.
        - `pk` integer: Primary key of the uploaded Mixed Document.
        - `id` integer: ID of the uploaded Mixed Document. Same value as `pk`.
        - `uuid` string: UUID of the uploaded Mixed Document.
        - `name` string: Name of the uploaded Mixed Document.
        - `page_count` integer: Total number of pages in the uploaded Mixed Document.
        - `checksum` string: MD5 checksum of the uploaded Mixed 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 Mixed Documents that already exist in the Book.
      - `original_existing_doc_uuids` string[]: An array of UUIDs of Mixed Documents that already exist in the Book.
      - `mixed_uploaded_docs` object[]: An array of objects containing information about the uploaded Mixed Documents.
        - `pk` integer: Primary key of the uploaded Mixed Document.
        - `id` integer: ID of the uploaded Mixed Document. Same value as `pk`.
        - `uuid` string: UUID of the uploaded Mixed Document.
        - `name` string: Name of the uploaded Mixed Document.
        - `page_count` integer: Total number of pages in the uploaded Mixed Document.
        - `checksum` string: MD5 checksum of the uploaded Mixed 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 Mixed Documents that already exist in the Book.
      - `original_existing_doc_uuids` string[]: An array of UUIDs of Mixed Documents that already exist in the Book.
      - `mixed_uploaded_docs` object[]: An array of objects containing information about the uploaded Mixed Documents.
        - `pk` integer: Primary key of the uploaded Mixed Document.
        - `id` integer: ID of the uploaded Mixed Document. Same value as `pk`.
        - `uuid` string: UUID of the uploaded Mixed Document.
        - `name` string: Name of the uploaded Mixed Document.
        - `page_count` integer: Total number of pages in the uploaded Mixed Document.
        - `checksum` string: MD5 checksum of the uploaded Mixed 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)
