Skip to main content
POST
This endpoint supports two methods, selected by the method field:
  • file-upload - import an existing file from a URL or multipart upload
  • template - generate a PDF from a Lumin PDF template and optionally prefill fields
Copy examples from the dropdown to quickly get the sample request body for each method. The response returns a document_id in the id field. Use that ID with PDF operation endpoints such as Merge Documents or Compress Document.

Upload from file

Set method to file-upload and provide the file via document_data.file_url or a multipart document_data.file upload.

Supported file formats

PDF, DOCX, XLSX, PPTX, DOC, XLS, PNG, JPEG/JPG

File size limits

Create from template

Set method to template, provide a pdf_ template ID, and optionally prefill form fields.
  1. List templates with List Templates and find a template whose ID starts with pdf_.
  2. Optionally inspect fields with Get Template Details.
Only PDF templates (pdf_ prefix) are supported for document creation.
This endpoint requires the following scope:pdf:files

Authorizations

X-API-Key
string
header
required

Provide your API key in the X-API-Key header, e.g., X-API-Key: YOUR_API_KEY.

Body

method
enum<string>
required

Import from a file (PDF or other supported formats).

Available options:
file-upload
document_name
string
required

Human-friendly title of the document (1–255 characters).

Required string length: 1 - 255
location
object
required
document_data
object
required

Payload for file-upload method.

Response

Returns the summary of the created document.

id
string
required

Unique identifier of the document in Lumin.

name
string
required

Human-friendly name of the document.

created_at
integer<unix-epoch>
required

Unix timestamp (milliseconds) when the document was created.

updated_at
integer<unix-epoch>
required

Unix timestamp (milliseconds) when the document was last updated.

location
object
required

Where the document is stored.

size
integer
required

Size of the PDF file in bytes.

mime_type
string
required

MIME type of the file (e.g. application/pdf).

preview_url
string<uri>
required

URL to open the document in Lumin's viewer.