Skip to content
Svanja

Docs API reference

Templates

Document templates: list them, add starters to a Space, import Word files and render PDFs.

A template turns your details into a branded PDF, such as a letter or a report. You’ll find your templates under Skills, Templates, alongside the starters Svanja ships with. Use these endpoints to render a document from your own data or turn Word files into templates. To read templates, you need the Templates area, which is included in Full access and Read-only. To render or save them, you need Full access or Templates set to Read and write. See Skills, tools and templates.

Call GET /templates to list the starter templates and your own, or GET /templates/{id} to view a single template along with its fields. Your own templates use the ID format SPACE_ID:path.

Use POST /templates to add templates to a Space. Set action to add_to_space (with space_id and starter_key) to copy a starter into a Space. Set action to import_word (with space_id and paths) to convert Word or OpenDocument files already in a Space into templates.

To render a PDF, call POST /templates/{id}/actions with your own operation_id and the template’s fields under data:

{
  "action": "render",
  "operation_id": "offer-2026-11",
  "data": { "client": "Example Ltd" }
}

Rendering usually runs in the background, and the response returns an operation with its current status. To check the status, send the same request again with the same operation_id (and a new idempotency key, if you use one). Once the status is completed, the response also includes the artifact, which is the finished document under Artifacts. If you’re working from a terminal, see svanja template.

Operations

An operation is one thing you can do, like reading a task or starting one. Its effect says what it changes. Some operations that act outside Svanja or change access wait for a person's approval; the approval flow is on the API overview.

template.import_word Changes data in Svanja

Import a Word template.

POST /templates

template.read Reads only

Read templates.

GET /templates GET /templates/{id}

template.render Changes data in Svanja

Render a template.

POST /templates/{id}/actions

Endpoints

Paths start at https://app.svanja.com/api/v1. Every endpoint needs an API key unless it says otherwise. A required Idempotency-Key header is listed with the parameters.

GET /templates List templates

Status codes: 200, 401, 403, 429

POST /templates Add or import templates

Status codes: 202, 401, 403, 422, 429

GET /templates/{id} Read a template
Parameter In Type Required Notes
id path string yes

Status codes: 200, 401, 403, 404, 429

PATCH /templates/{id} Update a template
Parameter In Type Required Notes
id path string yes

Status codes: 202, 401, 403, 404, 422, 429

POST /templates/{id}/actions Render a template
Parameter In Type Required Notes
id path string yes

Status codes: 202, 401, 403, 404, 422, 429

This page as plain Markdown, for AI tools: templates.md

Try Svanja with your own mailbox

Sign up now, and you get an email when your account is ready.