Skip to main content
POST
/
documents
Create Document
curl --request POST \
  --url https://api.luminpdf.com/v1/documents \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "document_name": "<string>",
  "location": {
    "space_id": "<string>",
    "folder_id": "<string>"
  },
  "document_data": {
    "file": "<string>",
    "file_url": "<string>"
  }
}
'
{
  "id": "doc_abc123def456",
  "name": "Patient Form",
  "created_at": 1748456885430,
  "updated_at": 1748456885430,
  "location": {
    "type": "workspace",
    "workspace_id": "123456",
    "folder_id": "789"
  },
  "size": 245678,
  "mime_type": "application/pdf",
  "preview_url": "https://app.luminpdf.com/viewer/doc_abc123def456"
}

Documentation Index

Fetch the complete documentation index at: https://developers.luminpdf.com/llms.txt

Use this file to discover all available pages before exploring further.

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

Creation method. One of:

  • file-upload — import from a file (PDF or other supported formats).
  • template — create from a PDF template.
Available options:
file-upload,
template
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

Method-specific payload. Schema depends on the method chosen:

  • For file-upload: Use DocumentDataFileUpload schema.
  • For template: Use DocumentDataTemplate schema.

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.