For the complete documentation index, see llms.txt. This page is also available as Markdown.
Generation

Generation

Produce a finished document from structured input.

Generation runs the pipeline in reverse. Where extraction reads a document and returns data, generation takes data — sections, styling, a document type — and returns a rendered file with a download URL.

/generate is asynchronous and answers 201 with an ID; /generate/sync returns the document on the same connection; GET /generate/{_id} retrieves a job you started earlier, including its downloadUrl and storage details once it completes.

Generated endpoint reference

The generated reference is the source of truth for schemas and responses.

This guide keeps product-specific behavior and known endpoint limitations.

Generation is the one capability whose request carries its own webhookUrl. You can point an individual generation job at an endpoint without touching account settings — which the extraction and classification requests do not let you do.

For the templates, sections and styling options as they appear in the product, see Document Generation.

Generate document (Async)

POST /generate

Requires the X-Api-Key header. See Authentication.

Request bodyapplication/json, required: GenerateRequest

Property
Type
Required
Default
Description

data

array<SectionItem>

Yes

Array of sections (minimum 1 required)

format

string

"docx"

Output format (currently only 'docx' supported)

metadata

object | null

Business context metadata

style

StyleConfig | null

Styling configuration

webhookUrl

string | null

Completion webhook URL (must be HTTPS)

Nested objects

SectionItem

Property
Type
Required
Default
Description

sectionData

object

Yes

Section-specific data

sectionKey

string

Yes

Section identifier (must be unique within the data array)

StyleConfig

Property
Type
Required
Default
Description

fontFamily

string | null

"Calibri"

Font family

fontSize

integer | null

11

Font size (8-72)

headerFooter

boolean | null

true

Include header and footer

lenderName

string | null

Lender/company name

pageNumbers

boolean | null

true

Include page numbers

primaryColor

string | null

"1F4E79"

Primary color (hex with or without #)

secondaryColor

string | null

Secondary color (hex with or without #)

tableOfContents

boolean | null

false

Include table of contents

Responses

Status
Description
Schema

201

Created

GenerateResponse

400

Bad Request

ValidationError

401

Authentication required — the X-Api-Key header is missing or invalid.

Example

Synchronous document generation

POST /generate/sync

Requires the X-Api-Key header. See Authentication.

Request bodyapplication/json, required: GenerateRequest

Property
Type
Required
Default
Description

data

array<SectionItem>

Yes

Array of sections (minimum 1 required)

format

string

"docx"

Output format (currently only 'docx' supported)

metadata

object | null

Business context metadata

style

StyleConfig | null

Styling configuration

webhookUrl

string | null

Completion webhook URL (must be HTTPS)

Nested objects

SectionItem

Property
Type
Required
Default
Description

sectionData

object

Yes

Section-specific data

sectionKey

string

Yes

Section identifier (must be unique within the data array)

StyleConfig

Property
Type
Required
Default
Description

fontFamily

string | null

"Calibri"

Font family

fontSize

integer | null

11

Font size (8-72)

headerFooter

boolean | null

true

Include header and footer

lenderName

string | null

Lender/company name

pageNumbers

boolean | null

true

Include page numbers

primaryColor

string | null

"1F4E79"

Primary color (hex with or without #)

secondaryColor

string | null

Secondary color (hex with or without #)

tableOfContents

boolean | null

false

Include table of contents

Responses

Status
Description
Schema

200

The generated document itself, returned as application/vnd.openxmlformats-officedocument.wordprocessingml.document with Content-Disposition: attachment; filename="document.docx". This response is a binary file, not JSON — write the body to disk rather than parsing it.

400

The request body is missing or invalid.

401

Authentication required — the X-Api-Key header is missing or invalid.

Example

Get document generation details

GET /generate/{_id}

Requires the X-Api-Key header. See Authentication.

Path and query parameters

Parameter
In
Type
Required
Description

_id

path

string

Yes

Responses

Status
Description
Schema

200

OK

GetGenerationResponse

400

Bad Request

ValidationError

401

Authentication required — the X-Api-Key header is missing or invalid.

500

Returned for every input, with "Invalid generation ID format" — including the exact generationId returned by POST /generate. Verified against the issued UUID, a hyphen-stripped form, a prefixed form and a nil UUID. This endpoint is currently unusable; collect generated documents via POST /generate/sync or a completion webhook. Known defect.

Example

Last updated