Skip to main content
POST
/
documents
/
summarize
curl --request POST \ --url https://api.luminpdf.com/v1/documents/summarize \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <api-key>' \ --data ' { "document_id": "695dd6880d951f4de70a7c5d" } '
{
  "document_id": "695dd6880d951f4de70a7c5d",
  "document_name": "Patient Information Form.pdf",
  "summary": "This document is a patient information form for a prescription medication. It collects personal details including name, date of birth, address, and insurance information.",
  "language": "en",
  "character_count": 12480,
  "cached": false,
  "remaining_requests": 7
}
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

application/json
document_id
string

Lumin document ID of the PDF to summarize. Required when file_url is not provided. Takes priority if both are provided.

To obtain a document ID, upload the file to Lumin first using Upload Document.

file_url
string<uri>

Publicly accessible URL of the PDF file to summarize. Required when document_id is not provided. Ignored if document_id is also provided.

regenerate
boolean
default:false

If true, bypass the cached summary and generate a fresh one. This counts against the rate limit.

Response

Returns the AI-generated summary.

document_id
string
required

ID of the document that was summarized.

document_name
string
required

Name of the document.

summary
string
required

The AI-generated summary text.

language
enum<string>
required

Detected language of the document content.

Available options:
en,
es,
fr,
vi,
pt
character_count
integer
required

Total number of characters in the source document (including spaces).

cached
boolean
required

true if the response was served from cache; false if a fresh summary was generated.

remaining_requests
integer
required

Number of summarize requests the user has remaining for today.