Skip to content
Svanja

Docs API reference

Discovery and account

Who the key belongs to, what it may do, the team's plan and credits, and approvals.

These endpoints tell your code where it stands before it does anything. GET /whoami returns the team, the key, and its access. GET /capabilities lists every operation and tells you whether this key can use it right now. GET /capabilities/{name} gives the details for a single operation. Agents that explore the API on their own start here.

The account endpoints show your plan, what it includes, and what you’ve used, much like Credits and usage in the app. They require the Account, Credits, and Team areas, which are included in both Full access and Read-only keys. For more on how these work, see The REST API and Plans, credits and prices.

The account endpoints are GET /account, /account/entitlements, and /account/usage. Credits have separate endpoints for the balance and the list of transactions. The team endpoints list the members and the team’s invitations, along with each one’s status.

POST /authorization-requests sets up an operation that needs a person’s approval before it runs, such as turning on a rule:

{ "operation": "rule.enable", "input": { "id": "RULE_ID" } }

The response includes an approval_url to send to the person and an id. Once they approve it, send the operation itself with authorization_request_id set to that id. You can check the status in the meantime with GET /authorization-requests/{id}. Sending email uses its own flow and isn’t prepared here.

You can also fetch the OpenAPI document without a key. If you prefer the terminal, svanja whoami, svanja capabilities, svanja account, and svanja credits do the same things. See Sign-in and setup commands and Account, credits and API keys.

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.

account.read Reads only

Read account state and entitlements.

GET /account GET /account/entitlements GET /account/usage

capability.discover Reads only

Search available operations.

GET /capabilities

capability.read Reads only

Read one operation contract.

GET /capabilities/{name}

credit.read Reads only

Read credit balances and transactions.

GET /credits/balance GET /credits/transactions

team.read Reads only

Read team directory.

GET /team/members GET /team/invitations

whoami Reads only

Read authenticated caller identity.

GET /whoami

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 /openapi.yaml Download the OpenAPI YAML document

This endpoint works without an API key.

Status codes: 200

GET /openapi.json Download the OpenAPI JSON document

This endpoint works without an API key.

Status codes: 200

GET /capabilities Search public API operation capabilities

Returns family summaries, operation summaries, examples and the authenticated key's current availability for matching public operations. Discovery is descriptive and does not grant authority.

Parameter In Type Required Notes
q query string no
family query string no
effect_class query one of read, internal, external, owner no
available query boolean no
include_examples query boolean no

Status codes: 200, 401, 403, 429

GET /capabilities/{name} Read one public API operation capability

Returns full operation metadata including schemas, examples, endpoints, failure reasons, effect class, undo metadata and current availability.

Parameter In Type Required Notes
name path string yes

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

GET /whoami Show the authenticated team API key context

Returns the team, API key metadata, effective public API capabilities, and selected-project scope summary for the bearer key.

Status codes: 200, 401, 403, 429

GET /account Show account summary

Returns compact account, key, plan, subscription, API access, credit, billing availability, auto top-up, and related endpoint links for any valid team API key.

Status codes: 200, 401, 403, 429

GET /account/entitlements Show account entitlements

Returns account-level capability, feature, limit, and project-scope entitlement state for a key with Account read access.

Status codes: 200, 401, 403, 429

GET /account/usage Show account usage

Returns bounded credit, purchased-credit, usage-window, and recent transaction summaries for a key with Account read access.

Status codes: 200, 401, 403, 429

GET /credits/balance Show credit balance

Returns the team-level credit balance, normalized subscription summary, and last credit update timestamp.

Status codes: 200, 401, 403, 429

GET /credits/transactions List credit transactions

Lists the team-level credit ledger with public transaction type labels. Selected-project keys with Credits read access see the full team ledger.

Parameter In Type Required Notes
page query integer no Page number. Defaults to 1.
per_page query integer no Page size. Defaults to 25 and is capped at 100.
type query one of credit_added, credit_spent, debt, adjustment, other no Public credit transaction type.
created_from query string no Inclusive created_at lower bound. Must include seconds and Z or an explicit UTC offset.
created_to query string no Inclusive created_at upper bound. Must include seconds and Z or an explicit UTC offset.
sort query one of created_at, -created_at no Sort credit transactions by creation time.

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

GET /team/members List team members

Lists active team members for the authenticated team. The owner appears first with the owner role, followed by active pivot members ordered by join time. Removed and soft-deleted users are excluded.

Parameter In Type Required Notes
page query integer no Page number. Defaults to 1.
per_page query integer no Page size. Defaults to 25 and is capped at 100.

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

GET /team/members/{member} Show a team member

Shows one active team member by public user ID. Missing, malformed, cross-team, removed, and soft-deleted users return the same public not-found error once the key has Team read access.

Parameter In Type Required Notes
member path string yes Team member public user ULID. This is not the legacy numeric user id.

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

GET /team/invitations List pending team invitations

Lists non-deleted pending invitations for the authenticated team, ordered newest first with id as a stable tie-breaker.

Parameter In Type Required Notes
page query integer no Page number. Defaults to 1.
per_page query integer no Page size. Defaults to 25 and is capped at 100.

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

GET /team/invitations/{invitation} Show a pending team invitation

Shows one pending team invitation by public invitation ID. Missing, malformed, cross-team, and deleted invitations return the same public not-found error once the key has Team read access.

Parameter In Type Required Notes
invitation path string yes Team invitation public ULID. This is not the legacy numeric invitation id.

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

POST /authorization-requests Create a human authorization request

Prepare an operation that requires human approval using the same target resolution as execution. Supply input.id for an existing resource and input.action when choosing among actions. Other input fields are the intended execution body. The server binds current target versions; caller-supplied _target is ignored. After browser approval, execute the matching route/body with authorization_request_id before expires_at. Approval is bound to this API key and visibility user. Changed targets or inputs require new approval. Operations without an action handoff return validation_failed.

Body field Type Required Notes
operation string yes
family string no Optional compatibility hint; the operation determines the family.
input object yes
message string no

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

GET /authorization-requests/{authorization_request} Read a human authorization request
Parameter In Type Required Notes
authorization_request path string yes

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

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

Try Svanja with your own mailbox

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