Skip to content
Svanja

Docs API reference

Connections

Connected services: list them, connect new ones, check them, and read or write in them.

Connections are the services Svanja works with for you, like GitHub, Google Drive, or your own API. You can manage them in Connections, or use these endpoints to check a connection’s health and read or write in a connected service from your own code. Reading requires the Connections area, which is included in Full access and Read-only. Making changes requires Full access or Connections set to Read and write, and every write to another service waits for someone to approve it. For more details, see Connections.

GET /connections lists your connections along with their health status, and GET /connections/{id} returns a single connection and the operations it supports. To start a new connection, send POST /connections with a provider, which requires approval in the app first. If the service requires a sign-in, the response includes a link to finish signing in through a browser. A Custom API connection returns right away.

Use PATCH /connections/{id} to change a connection’s settings. For everything else, send POST /connections/{id}/actions with action set to read, write, check, or disconnect. Writing to a connected service takes three steps:

  1. Prepare the exact write with POST /authorization-requests, using the connection.action operation and the same input you plan to send.
  2. Have a person approve the request in the app using the approval_url.
  3. Send the write along with the authorization_request_id.

See The REST API for more on the API, or use svanja connection if you are working from a terminal.

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.

connection.action Acts outside Svanja

Run a declared provider action.

POST /connections/{id}/actions

connection.connect Changes access or automation

Connect or reconnect a provider.

POST /connections

connection.read Reads only

Read provider connections.

GET /connections GET /connections/{id}

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 /connections List provider connections

Status codes: 200, 401, 403, 429

POST /connections Start provider connection handoff

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

GET /connections/{id} Read a provider connection
Parameter In Type Required Notes
id path string yes

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

PATCH /connections/{id} Update provider connection settings
Parameter In Type Required Notes
id path string yes

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

POST /connections/{id}/actions Run a provider connection 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: connections.md

Try Svanja with your own mailbox

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