Skip to main content

Generate

Generates a PDF document from a template and input data.

This is the primary endpoint used for document generation.

  • HTTP Method: POST
  • Endpoint: https://eledo.online/api/RESTv1/Generate

Request body

NameTypeRequiredDescription
templateIdStringYesTemplate identifier
templateVersionIntegerNoTemplate version
fileObjectYes*Input data for the template

Minimal example

The following payload is the minimal reliably working request:

{
"templateId": "...",
"file": null
}

Response

Success

  • Content-Type: application/pdf
  • Body: Binary PDF data

Headers

HeaderDescription
Content-DispositionContains the generated filename

Example:

content-disposition: attachment; filename="0_0.pdf"; filename*=UTF-8''0_0.pdf

Error

  • Content-Type: application/json
NameTypeDescription
errorsArrayList of errors

Observed behavior

The following behavior has been observed in real integrations.

File parameter

  • The file field must be present in the request
  • file: null is accepted
  • {} (empty object) is also accepted
  • Omitting the file field may result in errors

Recommendation:
Always include the file field (use null if no data is required)


Input validation

  • Partial payloads are accepted
  • Missing fields do not cause failure
  • Incorrect types may still produce a PDF with missing values

Recommendation:
Do not rely on strict validation — validate inputs on the client side if needed


Response handling

  • Successful responses return binary PDF data
  • Errors return JSON
  • Response type should be detected via Content-Type

Filename handling

  • The filename is provided in Content-Disposition
  • Two variants may be present:
    • filename="..."
    • filename*=UTF-8''...

Recommendation:
Handle both formats when extracting filenames


How it works

  1. Select a template (templateId)
  2. Provide input data (file)
  3. The API renders and returns a PDF

Next steps

  • List templates → List
  • Retrieve schema → Schema

Was this article helpful?

Yes
No