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.
| Route | What it does |
|---|---|
GET /conversations | List cases the account can read. |
GET, POST /conversations/:id/messages | Read messages or send a reply. |
GET, POST /conversations/:id/workflow | Read workflow, add notes, hand off or write a draft. |
GET /conversations/:id/diagnosis | Read available transaction checks. |
POST /conversations/:id/diagnosis | Start a transaction check with current team permission. |
GET /conversations/knowledge/guidance | Read AI guidance as the owner, a current human Admin or a registered AI agent. |
POST /conversations/knowledge/guidance | Save AI guidance as the owner or a current human Admin after confirmation. |
POST /conversations/knowledge/search | Search sources under current workspace permission. |
POST /conversations/:id/resolve | Resolve or reopen a case with current permission. |
GET /events | Read authorized workspace events. |
POST /conversations/workspace-export | Start a workspace export with current manager permission. |
GET /conversations/workspace-export?cursor=… | Read the next authorized workspace export page. |
GET /conversations/:id/export | Export 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
| Resource | Use it for |
|---|---|
| Manual widget integration | Add the chat with your app's wallet and failed-action handlers. |
| Widget types | Check options and mounted-widget or headless-client methods. |
| JavaScript agent client | Read and answer cases from your server under current team permissions. |
| Python agent client | Use the separately enabled Python API client. |
| App status | Check 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.