---
title: "Upload a PDF (multipart 'file', or JSON with pdf_url / pdf_base64) and run the print check"
method: POST
path: "/documents"
---

# Upload a PDF (multipart 'file', or JSON with pdf_url / pdf_base64) and run the print check

`POST /documents`

## Request

- Base URL: `https://printandmailcompany.com/api/v1`
- URL: `https://printandmailcompany.com/api/v1/documents`
- Auth: HTTP bearer

A4 or US Letter PDF up to 4 MB and 250 pages, not password-protected. Printed on the paper size uploaded (printedOn): A4 on A4, US Letter on US Letter; a PDF mixing A4 and US Letter pages on A4, its Letter pages centred (usLetterPages, usLetterNote). pdf_base64 makes the request a third larger: for files over 3 MB, upload multipart or pass pdf_url.

## Request body

- object
  - `pdf_url` string, uri
  - `pdf_base64` string
  - `file_name` string

## Response `201`

Document with print check (compliant, analysis per page)

- Document
  - `id` string
  - `fileName` string
  - `pageCount` integer
  - `sizeBytes` integer: Size of the uploaded file
  - `compliant` boolean: Every page of the print file has the size of its paper (A4, or US Letter for a US Letter document) and keeps the free margin: the document can be sent
  - `hasColor` boolean
  - `fixed` boolean: A margin fix (shrink or crop) is applied
  - `fixMode` 'shrink' | 'crop' | 'null', nullable
  - `fixedAt` string, date-time, nullable
  - `source` 'upload' | 'url' | 'compose'
  - `printedOn` 'A4' | 'US Letter': The paper size uploaded is the paper printed on: "US Letter" when every page is US Letter (8.5 × 11 in), else "A4" (A4 documents, and documents mixing A4 and US Letter pages). A letter with a US Letter document to a destination outside the US, Canada and US territories is printed on the paper the customer chose (Letter paperSize).
  - `usLetterPages` integer: Uploaded US Letter pages: every page of a US Letter document (printed on US Letter paper, checked with the same margin), or the US Letter pages of a mixed document, which the print file centres on A4 sheets at 100 % or scales down just enough when their content would otherwise come within the margin (analysis.pages[].usLetter.scale, 1 = 100 %). The original upload is kept.
  - `usLetterNote` string, nullable: How the US Letter pages are printed, e.g. "The document is printed on US Letter paper, as uploaded. …" or "The US Letter page is printed on A4 paper, centred at 100%."; null without any
  - `analysis` object: Print check of the print file: marginMm, compliant (decides whether it can be printed), allA4 (literally every page A4: false for a printable US Letter document), paper ("a4" or "us_letter"), usLetterPages, a4Version (a US Letter document's version on A4: compliant, scales per page), and per page (pages[]) widthMm, heightMm, isA4, isUsLetter, orientation, contentBox, violations (side, depthMm), usLetter ({ scale } on US Letter pages placed on A4)
  - `createdAt` string, date-time
  - `deleteAfter` string, date-time

---

[API](https://skmtc.dev/printandmailcompany/apis/print-and-mail-company-api.md) · [All operations](https://skmtc.dev/printandmailcompany/apis/print-and-mail-company-api/llms.txt) · [OpenAPI document](https://skmtc.dev/printandmailcompany/apis/print-and-mail-company-api/revisions/0d0b97806499?raw)
