Document generators
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. Each generator has its own scope, so you can grant an integration only the formats it needs.
TipThe 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; uploads larger than that get a 413. There is no AI round-trip, so these endpoints do not support the Idempotency-Key header (only POST /v1/chat does). A retry generates a fresh file.
Common response
On success every generator returns the binary directly with these headers:
| Header | Value |
|---|---|
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 strata_<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 object400 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 scope413 payload_too_large— the request body exceeds 1 MB422 spec_invalid— the engine rejected the spec (missing required fields, exceeding a structural limit, etc.); the response title names the offending engine and reason
WarningImage and slide-background references are validated before the engine runs. Only inline
data:URIs andhttps://URLs to public hosts are allowed — local file paths and internal URLs are rejected with400 unsafe_image_ref.
POST /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
| Header | Required | Value |
|---|---|---|
Authorization | yes | Bearer sk_strata_live_... (scope: excel) |
Content-Type | yes | application/json |
Body
| Field | Type | Required | Description |
|---|---|---|---|
columns | array | yes | 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. |
rows | array | yes | Array of row objects, each keyed by the column key. May be empty. |
title | string | no | Workbook/sheet title |
filename | string | no | Overrides the download filename |
styles | object | no | Header/row appearance (headerBg, headerColor, altRowBg, fontSize, accentColor) |
formulas | array | no | Declarative formula objects, e.g. {type:"SUM", columns:["…"], label:"Total"} |
conditionalFormatting | array | no | Conditional-formatting rules bound to ranges |
freezePanes | bool/string | no | true/"row" freezes the header row; "col" freezes the first column; "both" freezes both |
chartType | string | no | With includeChart: true, adds a chart sheet (bar, line, pie, doughnut, area, stacked, combo, waterfall) |
NoteThe full styling, conditional-formatting, and chart vocabulary matches the in-app engine. See Exports and Special code blocks for the field-level reference.
Example request
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 }
]
}'
Example response
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
Errors
422 spec_invalid—columnsis missing or empty, orrowsis not an array
POST /v1/pdf
Generate a styled PDF from an ordered list of sections.
Headers
| Header | Required | Value |
|---|---|---|
Authorization | yes | Bearer sk_strata_live_... (scope: pdf) |
Content-Type | yes | application/json |
Body
| Field | Type | Required | Description |
|---|---|---|---|
title | string | yes | Document title, shown in the header band |
sections | array | yes | Ordered content blocks (may be empty) |
subtitle | string | no | Optional subtitle shown under the title |
palette | string | no | Color theme (see below). Default corporate. |
filename | string | no | 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:
| Section field | Renders |
|---|---|
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.)
Example request
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 }
] }
]
}'
Example response
HTTP/1.1 200 OK
Content-Type: application/pdf
Content-Disposition: attachment; filename="Board Report — June 2026.pdf"
Errors
422 spec_invalid— missingtitle,sectionsis not an array, or a structural limit is exceeded (too many sections, table columns, or total cells)
POST /v1/pptx
Generate a .pptx deck from a list of slides.
Headers
| Header | Required | Value |
|---|---|---|
Authorization | yes | Bearer sk_strata_live_... (scope: pptx) |
Content-Type | yes | application/json |
Body
| Field | Type | Required | Description |
|---|---|---|---|
slides | array | yes | Ordered slide objects. Must be non-empty. |
title | string | no | Deck title, used for document metadata. Default "Strata Presentation". |
subtitle | string | no | Deck subtitle, used for document metadata |
palette | string | no | Color theme. Default corporate. |
filename | string | no | Overrides the download filename |
Each slide is composed of positioned elements — there is no fixed-layout selector. A slide object takes:
| Slide field | Type | Required | Description |
|---|---|---|---|
elements | array | no | Positioned element objects, each with a type of text, shape, image, table, chart, or line, plus its position and content |
background | string/object | no | A color string, {color}, or an image background |
notes | string | no | Speaker notes |
showPageNumber | boolean | no | Set false to hide the slide-number footer (shown by default) |
TipThe 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.
Example request
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." }
]
}'
Example response
HTTP/1.1 200 OK
Content-Type: application/vnd.openxmlformats-officedocument.presentationml.presentation
Content-Disposition: attachment; filename="Series B Pitch.pptx"
Errors
422 spec_invalid—slidesis missing or empty
POST /v1/docx
Generate a styled Word document from structured sections.
Headers
| Header | Required | Value |
|---|---|---|
Authorization | yes | Bearer sk_strata_live_... (scope: docx) |
Content-Type | yes | application/json |
Body
| Field | Type | Required | Description |
|---|---|---|---|
title | string | no | Document title, set in the title style. Defaults to "Document". |
sections | array | no | Ordered section objects |
subtitle | string | no | Optional subtitle shown under the title |
palette | string | no | Color theme. Default corporate. |
filename | string | no | Overrides the download filename |
Like the PDF engine, sections are field-driven. A section renders whichever recognized fields it carries:
| Section field | Renders |
|---|---|
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) |
Example request
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"]
}
]
}'
Example response
HTTP/1.1 200 OK
Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document
Content-Disposition: attachment; filename="Vendor Onboarding Policy.docx"
Errors
422 spec_invalid— the spec is malformed for the engine