LM-Kit OneDocs2026.8.10lm-kit.com
Document Utilities

PDF Edit

Reorders, rotates, and removes pages from a PDF.#

POST/lmkit/v1/pdf-edit

Creates a new PDF by selecting pages from the source document in the specified order, optionally applying rotation to each page. Pages not listed are excluded. This is a pure document processing operation that does not require an AI model. Returns 422 Unprocessable Entity with an ErrorResponse body if the input file cannot be processed. The 'error' field contains one of: 'password_required' (encrypted PDF), 'invalid_format' (not a valid PDF), 'unsupported_security' (unsupported encryption), 'page_error' (content error).

Request body

application/json ·

PropertyTypeDescription
inputrequiredstring

The source PDF document (base64 or file identifier).

input_format

How the input is provided. Defaults to 'Base64EncodedFile'.

pagesrequired[]

Ordered list of pages for the output PDF. Each entry specifies a source page index and optional rotation. Pages not listed are excluded. Duplicate source pages are allowed.

Responses

StatusTypeDescription
200

OK

202

Accepted

422

Unprocessable Entity

400

Bad Request

curl -X POST "$LMKIT_ONE_URL/lmkit/v1/pdf-edit" \
  -H "Authorization: Bearer $LMKIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "input": "",
  "input_format": "Base64EncodedFile",
  "pages": [
    {
      "page_index": "string",
      "rotation": 0
    }
  ]
}'