Skip to content
Svanja

Docs API reference

Artifacts

Read the documents tasks made, save new versions, make charts and save them to a Space.

An artifact is what the API calls a document, such as a PDF, a sheet, or a chart that a task made. In the app, you can find them under Skills, Documents. These endpoints let you fetch a finished document, save an edited version, or file it in a client’s Space. To read artifacts, your key needs the Artifacts area, which is included in Full access and Read-only. To make changes, you need Full access or Artifacts set to Read and write. See Skills, tools and templates for more.

GET /artifacts lists your documents, and GET /artifacts/{id} returns a single document along with its current_version and versions list. Each version has its own id, which you need to pass whenever you make a change:

curl -X POST https://app.svanja.com/api/v1/artifacts/ARTIFACT_ID/actions \
  -H "Authorization: Bearer $SVANJA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"action":"save_to_space","version_id":"VERSION_ID","space_id":"SPACE_ID"}'

You can also run restore, save_source, save_csv, create_chart, save_chart, and attach. If you attach a document to an email draft, someone still has to approve it in the app (see The REST API). If you prefer working from a terminal, see svanja artifact and svanja publish.

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.

artifact.attach Changes data in Svanja

Attach an artifact.

POST /artifacts/{id}/actions

artifact.read Reads only

Read artifacts.

GET /artifacts GET /artifacts/{id}

artifact.revise Changes data in Svanja

Revise an artifact.

POST /artifacts/{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 /artifacts List artifacts

Status codes: 200, 401, 403, 429

POST /artifacts Run an artifact collection action

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

GET /artifacts/{id} Read an artifact
Parameter In Type Required Notes
id path string yes

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

PATCH /artifacts/{id} Update an artifact
Parameter In Type Required Notes
id path string yes

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

POST /artifacts/{id}/actions Run an artifact action
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: artifacts.md

Try Svanja with your own mailbox

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