Skip to main content

Templ API overview

Use Templ's API to build a custom client or connect an AI agent. The server checks the account's current permission on every route.

Choose routes​

Workspace routes start with /rooms/:workspaceId.

RouteWhat it does
GET /conversationsList cases the account can read.
GET, POST /conversations/:id/messagesRead messages or send a reply.
GET, POST /conversations/:id/workflowRead workflow, add notes, hand off or write a draft.
GET /conversations/:id/diagnosisRead available transaction checks.
POST /conversations/:id/diagnosisStart a transaction check with current team permission.
GET /conversations/knowledge/guidanceRead AI guidance as the owner, a current human Admin or a registered AI agent.
POST /conversations/knowledge/guidanceSave AI guidance as the owner or a current human Admin after confirmation.
POST /conversations/knowledge/searchSearch sources under current workspace permission.
POST /conversations/:id/resolveResolve or reopen a case with current permission.
GET /eventsRead authorized workspace events.
POST /conversations/workspace-exportStart a workspace export with current manager permission.
GET /conversations/workspace-export?cursor=…Read the next authorized workspace export page.
GET /conversations/:id/exportExport messages from a case the account can read.

The Agent API reference gives methods, fields and error reasons. Your own AI agent gives working client examples.

Sign in​

Use an EVM wallet session through SIWE. Solana SIWS has its own availability gate. Check the domain, URI, chain, nonce and expiry before signing. Verified email sign-in uses a one-time code and a separate account. An alert email grants no account access. Email sign-in merges no accounts. Manager and billing changes still require a valid wallet session. Team access explains teammate sign-in and invitations. Widget sessions carry only the member role and cannot use team routes. Never follow a redirect with a session cookie.

Client resources​

ResourceUse it for
Manual widget integrationAdd the chat with your app's wallet and failed-action handlers.
Widget typesCheck options and mounted-widget or headless-client methods.
JavaScript agent clientRead and answer cases from your server under current team permissions.
Python agent clientUse the separately enabled Python API client.
App statusCheck enabled features, networks, client versions and published file hashes.

The agent guides show required status checks and file-hash validation before importing a client. Use a widget session for a user and a staff session for a team account. Your app's existing SIWE session cannot become a Templ widget or staff session.

Follow limits and errors​

Each account sends at most 1 message or note every 5 seconds. A message holds at most 4,000 UTF-8 bytes. Read Retry-After on rate limits and follow the returned wait. Stop on lost permission or a stopped case. Sign in again after an expired session. Save reply IDs before sending. Retry an uncertain send with the same ID. Transaction checks explain the facts a reply can cite.

The API never signs or sends a transaction. Never put a user's private key or recovery phrase in a case.