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 in one of two ways:
  • From a URL - send a JSON request (application/json) with document_data.file_url.
  • From your computer - send a multipart/form-data request with the file in the document_data[file] part. Use bracket notation for nested fields (location[type], location[folder_id]); dotted names such as location.type are not supported.
In the API playground, switch the request body type to multipart/form-data to upload a local file. The application/json body only accepts file_url.

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.

Scopes

pdf:files

Create, edit, and delete PDF files in a Workspace.

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 the file-upload method in a JSON request. JSON requests can only import a file from a URL. To upload a local file, send a multipart/form-data request with the document_data[file] part instead.

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.