StrataDocs

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.

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; 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:

HeaderValue
Content-TypeThe format's MIME type (see each endpoint)
Content-Dispositionattachment; filename="…"
Content-LengthByte length of the file
X-Strata-File-IdA fresh UUID for this generated file
X-Strata-Api-Key-IdThe 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 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
  • 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
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.

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

HeaderRequiredValue
AuthorizationyesBearer sk_strata_live_... (scope: excel)
Content-Typeyesapplication/json

Body

FieldTypeRequiredDescription
columnsarrayyesColumn 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.
rowsarrayyesArray of row objects, each keyed by the column key. May be empty.
titlestringnoWorkbook/sheet title
filenamestringnoOverrides the download filename
stylesobjectnoHeader/row appearance (headerBg, headerColor, altRowBg, fontSize, accentColor)
formulasarraynoDeclarative formula objects, e.g. {type:"SUM", columns:["…"], label:"Total"}
conditionalFormattingarraynoConditional-formatting rules bound to ranges
freezePanesbool/stringnotrue/"row" freezes the header row; "col" freezes the first column; "both" freezes both
chartTypestringnoWith 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.

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_invalidcolumns is missing or empty, or rows is not an array

POST /v1/pdf

Generate a styled PDF from an ordered list of sections.

Headers

HeaderRequiredValue
AuthorizationyesBearer sk_strata_live_... (scope: pdf)
Content-Typeyesapplication/json

Body

FieldTypeRequiredDescription
titlestringyesDocument title, shown in the header band
sectionsarrayyesOrdered content blocks (may be empty)
subtitlestringnoOptional subtitle shown under the title
palettestringnoColor theme (see below). Default corporate.
filenamestringnoOverrides 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 fieldRenders
headingA bold section heading with an accent underline
textA paragraph of body text
summaryAn array of {label, value} metric cards (up to 5)
bulletsA bulleted list (array of strings)
columns + rowsA styled table (columns are strings or {key, header}; rows are objects keyed by column)
chartAn embedded chart — a Chart.js-style object with type, labels, and datasets
calloutA 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 — missing title, sections is 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

HeaderRequiredValue
AuthorizationyesBearer sk_strata_live_... (scope: pptx)
Content-Typeyesapplication/json

Body

FieldTypeRequiredDescription
slidesarrayyesOrdered slide objects. Must be non-empty.
titlestringnoDeck title, used for document metadata. Default "Strata Presentation".
subtitlestringnoDeck subtitle, used for document metadata
palettestringnoColor theme. Default corporate.
filenamestringnoOverrides the download filename

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

Slide fieldTypeRequiredDescription
elementsarraynoPositioned element objects, each with a type of text, shape, image, table, chart, or line, plus its position and content
backgroundstring/objectnoA color string, {color}, or an image background
notesstringnoSpeaker notes
showPageNumberbooleannoSet 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.

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_invalidslides is missing or empty

POST /v1/docx

Generate a styled Word document from structured sections.

Headers

HeaderRequiredValue
AuthorizationyesBearer sk_strata_live_... (scope: docx)
Content-Typeyesapplication/json

Body

FieldTypeRequiredDescription
titlestringnoDocument title, set in the title style. Defaults to "Document".
sectionsarraynoOrdered section objects
subtitlestringnoOptional subtitle shown under the title
palettestringnoColor theme. Default corporate.
filenamestringnoOverrides the download filename

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

Section fieldRenders
headingA section heading (level set by section.level: 1, 2 (default), or 3)
textOne or more body paragraphs (split on newlines)
summaryAn inline label: value summary line (array of {label, value})
bulletsA bulleted list (array of strings)
numberedA numbered list (array of strings)
columns + rowsA table for the section
chartA 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

Related