API & personal access tokens

tela has a JSON REST API under /api, plus a built-in MCP server so agents are first-class.

Authentication

Personal access tokens (PATs)

Every user creates and manages their own tokens in Settings → API Keys. Reach for one to [[Sync your vault (WebDAV)|sync a space to a local folder]], script against the REST API, or connect an agent on a host without OAuth. The raw token (tela_pat_…) is shown once — store it safely; tela keeps only an HMAC.

Each token carries a scope (a ceiling, not a floor):

Scope Grants
read Read-only — GETs on pages, spaces, search
write Read + create/edit pages and comments, imports
admin Full instance admin — instance admins only

A token can be pinned to a single space (clamps everything, incl. search and "ask", to that space), carry an expiry, and be revoked anytime.

The API surface (orientation)

MCP

Agents connect to {your-instance}/api/mcp (Streamable HTTP). Most clients — Claude, ChatGPT, Cursor, Claude Code — authenticate via OAuth with no token at all; a PAT as the bearer token also works (and is needed for the stdio proxy). Full client setup in [[Agents & MCP]].