Skip to the content
API reference Get an API key

Document generators

For users7 min readReviewed Sep 13, 2026
On this page
  1. Common response
  2. Common errors
  3. POST /v1/excel
  4. POST /v1/pdf
  5. POST /v1/pptx
  6. POST /v1/docx
  7. Related

The /v1/excel, /v1/pdf, /v1/pptx, and /v1/docx endpoints expose the same engines that power in-app chat downloads. You post a JSON spec and receive a styled binary file in the response — no AI is involved, so they're fast and cost no tokens (they never touch your monthly token budget). Each generator has its own scope, so you can grant an integration only the formats it needs.

Each generated document does, however, count as one delivered document toward your organization's monthly usage — it records a credit event you can read back through GET /v1/usage, and the same organization usage ceiling the chat surfaces respect applies here. An org that has exhausted its monthly allowance gets 429 usage_limit_exceeded from these endpoints, byte-identical to the refusal POST /v1/chat returns.

Tip

The fastest way to author a spec is to ask Strata for the artifact inside chat, open the resulting code block, and copy the JSON. The shape you copy is the same shape these endpoints accept, including styles, palettes, and chart definitions.

Each request body is the file spec — a single JSON object. The request body is capped at 1 MB; a larger body gets a 413 payload_too_large, and a spec that would build an oversized document (too many rows, cells, slides, or elements) gets a 413 spec_too_large before the engine allocates.

Unlike POST /v1/chat, these endpoints do not replay a prior response — a retry always generates a fresh file. An Idempotency-Key header, if you send one, is honored only for billing: a retried, identical request under the same key is not charged a second document credit (scoped to your organization, over a 24-hour window). Server-to-server callers can send the header; a browser caller cannot, because the API's CORS preflight allows only Authorization, Content-Type, and Accept request headers.

#Common response

On success every generator returns the binary directly with these headers:

Content-Type
The format's MIME type (see each endpoint)
Content-Disposition
attachment; filename="…"
Content-Length
Byte length of the file
X-Strata-File-Id
A fresh UUID for this generated file
X-Strata-Api-Key-Id
The ID of the key that made the request

The download filename comes from an optional top-level filename field on the spec (characters other than letters, digits, underscore, dot, and hyphen are replaced with underscores, capped at 80 chars). If you omit it, Strata names the file <type>_<timestamp> with the format's extension.

#Common errors

These apply to all four generators. Format-specific cases are listed per endpoint.

  • 400 invalid_request — the request body is not a JSON object
  • 400 unsafe_image_ref — the spec references a local filesystem path or a non-public URL for an image or slide background (blocked before the engine runs)
  • 403 insufficient_scope — the key was not granted the format's scope
  • 413 payload_too_large — the request body exceeds 1 MB
  • 413 spec_too_large — the spec would build an oversized document (too many rows, cells, slides, or elements); split it or trim it
  • 422 spec_invalid — the engine rejected the spec (missing required fields, exceeding a structural limit, etc.); the response title names the offending engine and reason
  • 429 usage_limit_exceeded — the organization's monthly usage allowance is exhausted; honor Retry-After
  • 500 engine_returned_empty — the engine produced an empty file; safe to retry, and if it persists, simplify the spec
Warning

Image and slide-background references are validated before the engine runs. Only inline data: URIs and https:// URLs to public hosts are allowed — local file paths and internal URLs are rejected with 400 unsafe_image_ref.

POSThttps://app.strata.kronisys.com/v1/excel

Generate a styled .xlsx workbook. The spec mirrors the chat ```excel block schema — top-level columns and rows, plus optional styling, formulas, conditional formatting, and charts.

#Headers

AuthorizationRequired
Bearer sk_strata_live_... (scope: excel)
Content-TypeRequired
application/json

#Body

columnsarrayRequired
Column definitions — each is a header string or an object {key, header, format, width, align}. Must contain at least one column. Per-column number formats (currency, percent, etc.) are set with the column's format field.
rowsarrayRequired
Array of row objects, each keyed by the column key. May be empty.
titlestringOptional
Workbook/sheet title
filenamestringOptional
Overrides the download filename
stylesobjectOptional
Header/row appearance (headerBg, headerColor, altRowBg, fontSize, accentColor)
formulasarrayOptional
Declarative formula objects, e.g. {type:"SUM", columns:["…"], label:"Total"}
conditionalFormattingarrayOptional
Conditional-formatting rules bound to ranges
freezePanesbool/stringOptional
true/"row" freezes the header row; "col" freezes the first column; "both" freezes both
chartTypestringOptional
With includeChart: true, adds a chart sheet (bar, line, pie, doughnut, area, stacked, combo, waterfall)
Note

The full styling, conditional-formatting, and chart vocabulary matches the in-app engine. See Exports and Special code blocks for the field-level reference.

#Errors

  • 422 spec_invalid — columns is missing or empty, or rows is not an array
curl
curl -X POST <API_BASE_URL>/v1/excel \
  -H "Authorization: Bearer sk_strata_live_..." \
  -H "Content-Type: application/json" \
  -o q3-revenue.xlsx \
  -d '{
    "title": "Q3 Revenue",
    "columns": [
      { "key": "Region", "header": "Region" },
      { "key": "Revenue", "header": "Revenue", "format": "$#,##0" },
      { "key": "YoY", "header": "YoY", "format": "0.0%" }
    ],
    "rows": [
      { "Region": "NA", "Revenue": 4200000, "YoY": 0.12 },
      { "Region": "EMEA", "Revenue": 2800000, "YoY": 0.08 },
      { "Region": "APAC", "Revenue": 1900000, "YoY": 0.21 }
    ]
  }'
Response200
HTTP/1.1 200 OK
Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
Content-Disposition: attachment; filename="Q3 Revenue.xlsx"
X-Strata-File-Id: 2f8c1a30-9b6e-4d2c-8f01-7a3e5c9d1b44

POSThttps://app.strata.kronisys.com/v1/pdf

Generate a styled PDF from an ordered list of sections.

#Headers

AuthorizationRequired
Bearer sk_strata_live_... (scope: pdf)
Content-TypeRequired
application/json

#Body

titlestringRequired
Document title, shown in the header band
sectionsarrayRequired
Ordered content blocks (may be empty)
subtitlestringOptional
Optional subtitle shown under the title
palettestringOptional
Color theme (see below). Default corporate.
filenamestringOptional
Overrides the download filename

Sections are field-driven, not type-tagged — each section renders whatever recognized fields it carries, in a fixed order. A section may combine several:

heading
A bold section heading with an accent underline
text
A paragraph of body text
summary
An array of {label, value} metric cards (up to 5)
bullets
A bulleted list (array of strings)
columns + rows
A styled table (columns are strings or {key, header}; rows are objects keyed by column)
chart
An embedded chart — a Chart.js-style object with type, labels, and datasets
callout
A callout box ({label, text})

Available palettes: corporate (default), ocean, forest, sunset, slate, finance, modern. (theme is accepted as an alias for palette.)

#Errors

  • 422 spec_invalid — missing title, sections is not an array, or a structural limit is exceeded (too many sections, table columns, or total cells)
curl
curl -X POST <API_BASE_URL>/v1/pdf \
  -H "Authorization: Bearer sk_strata_live_..." \
  -H "Content-Type: application/json" \
  -o board-report.pdf \
  -d '{
    "title": "Board Report — June 2026",
    "palette": "slate",
    "sections": [
      { "summary": [
        { "label": "ARR", "value": "$48.2M" },
        { "label": "NRR", "value": "118%" }
      ]},
      { "heading": "Executive summary",
        "text": "Pipeline expanded 22% quarter over quarter." },
      { "heading": "Revenue by segment",
        "columns": ["Segment", "ACV"],
        "rows": [
          { "Segment": "Enterprise", "ACV": 38400000 },
          { "Segment": "Mid-market", "ACV": 9800000 }
        ] }
    ]
  }'
Response200
HTTP/1.1 200 OK
Content-Type: application/pdf
Content-Disposition: attachment; filename="Board Report — June 2026.pdf"

POSThttps://app.strata.kronisys.com/v1/pptx

Generate a .pptx deck from a list of slides.

#Headers

AuthorizationRequired
Bearer sk_strata_live_... (scope: pptx)
Content-TypeRequired
application/json

#Body

slidesarrayRequired
Ordered slide objects. Must be non-empty.
titlestringOptional
Deck title, used for document metadata. Default "Strata Presentation".
subtitlestringOptional
Deck subtitle, used for document metadata
palettestringOptional
Color theme. Default corporate.
filenamestringOptional
Overrides the download filename

Each slide is composed of positioned elements — there is no fixed-layout selector. A slide object takes:

elementsarrayOptional
Positioned element objects, each with a type of text, shape, image, table, chart, or line, plus its position and content
backgroundstring/objectOptional
A color string, {color}, or an image background
notesstringOptional
Speaker notes
showPageNumberbooleanOptional
Set false to hide the slide-number footer (shown by default)
Tip

The element format positions every item in inches on a 13.3×7.5″ widescreen slide, so it's verbose to author by hand. The fastest path is to ask Strata to build the deck in chat, then copy the spec from the resulting code block — it's exactly the shape this endpoint accepts.

#Errors

  • 422 spec_invalid — slides is missing or empty
  • 413 spec_too_large — the deck exceeds 500 slides, or the spec's total node count is too large
curl
curl -X POST <API_BASE_URL>/v1/pptx \
  -H "Authorization: Bearer sk_strata_live_..." \
  -H "Content-Type: application/json" \
  -o pitch.pptx \
  -d '{
    "title": "Series B Pitch",
    "slides": [
      { "elements": [
        { "type": "text", "content": "Strata", "x": 0.7, "y": 2.4, "w": 11, "h": 1.4, "fontSize": 54, "bold": true },
        { "type": "text", "content": "Enterprise intelligence, end to end.", "x": 0.7, "y": 3.8, "w": 11, "h": 0.8, "fontSize": 22 }
      ]},
      { "elements": [
        { "type": "text", "content": "Traction", "x": 0.7, "y": 0.5, "w": 11, "h": 1, "fontSize": 36, "bold": true },
        { "type": "text", "content": "48M ARR\n118% NRR\n92 enterprise logos", "x": 0.7, "y": 1.8, "w": 11, "h": 3, "fontSize": 22, "bullet": true }
      ],
        "notes": "Mention the three Fortune 500 wins from May." }
    ]
  }'
Response200
HTTP/1.1 200 OK
Content-Type: application/vnd.openxmlformats-officedocument.presentationml.presentation
Content-Disposition: attachment; filename="Series B Pitch.pptx"

POSThttps://app.strata.kronisys.com/v1/docx

Generate a styled Word document from structured sections.

#Headers

AuthorizationRequired
Bearer sk_strata_live_... (scope: docx)
Content-TypeRequired
application/json

#Body

titlestringOptional
Document title, set in the title style. Defaults to "Document".
sectionsarrayOptional
Ordered section objects
subtitlestringOptional
Optional subtitle shown under the title
palettestringOptional
Color theme. Default corporate.
filenamestringOptional
Overrides the download filename

Like the PDF engine, sections are field-driven. A section renders whichever recognized fields it carries:

heading
A section heading (level set by section.level: 1, 2 (default), or 3)
text
One or more body paragraphs (split on newlines)
summary
An inline label: value summary line (array of {label, value})
bullets
A bulleted list (array of strings)
numbered
A numbered list (array of strings)
columns + rows
A table for the section
chart
A text placeholder noting the chart (DOCX charts aren't rendered natively)

#Errors

  • 422 spec_invalid — the spec is malformed for the engine
curl
curl -X POST <API_BASE_URL>/v1/docx \
  -H "Authorization: Bearer sk_strata_live_..." \
  -H "Content-Type: application/json" \
  -o policy.docx \
  -d '{
    "title": "Vendor Onboarding Policy",
    "sections": [
      {
        "heading": "Scope",
        "text": "This policy applies to all third-party vendors handling customer data."
      },
      {
        "heading": "Requirements",
        "text": "Each vendor must complete the following:",
        "numbered": ["Sign the MSA", "Pass a SOC 2 review", "Enroll in SSO"]
      }
    ]
  }'
Response200
HTTP/1.1 200 OK
Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document
Content-Disposition: attachment; filename="Vendor Onboarding Policy.docx"