generation block inline. Sections and the wrapping template are created as auto-generated resources and immediately published — and like all auto-generated aggregates, are retained for 30 days only (see Auto-generated template aggregates — 30-day retention).
Mapping response section IDs back to your inline sections — Path 4 gotcha
Path 4 is the one place where mapping response keys back to your request sections is non-trivial. Your request supplies an ordered list ofSectionGeneration objects with no IDs of your own, but the response’s stringDocument / structuredDocument are keyed by server-generated section UUIDs. To attach the right heading to each rendered section:
- Take the
templateVersionIdreturned in the response. - Call
GET /documents/templates/{templateId}/versions/{templateVersionId}. - The version’s
sections[]array preserves your request order and carries the resolved section IDs. Build aposition → sectionId → headingmapping from that response, then key the rendered output against it.
This is a known DX gap for Path 4 specifically. The roadmap includes returning client-supplied identifiers (or section ordering) directly on the response so the follow-up GET isn’t needed.
When to use this path
Related
Guided Synthesis overview
Shared concepts: input context, response shape, errors, 30-day retention.
Section Schemas
Schema patterns for the
outputSchema shapes you’ll define inline.