Generated from api/openapi.yaml (OpenAPI 3.1). Base URL: https://api.teemli.com. Auth: Authorization: Bearer <token or tml_ API key>. Errors are application/problem+json; writes accept an Idempotency-Key header.
The signed-in person, live updates, ChatGPT sign-in
What deleting my account would delete (for the confirm dialog)
Section titled “What deleting my account would delete (for the confirm dialog)”GET /v1/me/deletionAPI keys: not available (needs a person signed in to the app).
Responses
200Counts, whether the organisation goes too, whether ownership must be handed over, and candidates — object401Missing, invalid or expired token — Problem
Invitations from other organisations waiting for me (S1, they never apply by themselves)
Section titled “Invitations from other organisations waiting for me (S1, they never apply by themselves)”GET /v1/me/invitationsAPI keys: not available (needs a person signed in to the app).
Responses
200{items: [{id, org_id, org_name, org_domain, domain_verified, role, invited_by_name, invited_at, refused}]};refused: domain_verified_elsewherewhen my email domain is verified by another organisation — object401Missing, invalid or expired token — Problem
Accept an invitation. My account moves to that organisation; my current workspace (my agents, chats, memory) is deleted, so leave_current must be true
Section titled “Accept an invitation. My account moves to that organisation; my current workspace (my agents, chats, memory) is deleted, so leave_current must be true”POST /v1/me/invitations/{id}/acceptAPI keys: not available (needs a person signed in to the app).
| Parameter | In | Type | Description |
|---|---|---|---|
id (required) |
path | string (uuid) |
Request body (JSON)
| Field | Type | Description |
|---|---|---|
leave_current (required) |
boolean |
Responses
200{org_id, person_id, role, org_name, left_org_deleted} — object404Not found (also returned for rows the caller may not see, and for disabled features) — Problem409My email domain is verified by another organisation, or I’m the last owner of an organisation with other people422leave_current wasn’t confirmed
Decline an invitation (it and any access it carried go away)
Section titled “Decline an invitation (it and any access it carried go away)”POST /v1/me/invitations/{id}/declineAPI keys: not available (needs a person signed in to the app).
| Parameter | In | Type | Description |
|---|---|---|---|
id (required) |
path | string (uuid) |
Responses
200OK — object404Not found (also returned for rows the caller may not see, and for disabled features) — Problem
Dismiss the “your AI requests now go to …” notice (audit M-17; GET /v1/me returns model_notice until then)
Section titled “Dismiss the “your AI requests now go to …” notice (audit M-17; GET /v1/me returns model_notice until then)”POST /v1/me/model-notice/seenAPI keys: not available (needs a person signed in to the app).
Responses
204Dismissed
Finish the welcome (idempotent; the first time wins)
Section titled “Finish the welcome (idempotent; the first time wins)”POST /v1/me/onboardedAPI keys: not available (needs a person signed in to the app).
Responses
204Done
The signed-in person and their organisation
Section titled “The signed-in person and their organisation”GET /v1/meProvisions the person (and organisation, and their first agent) on first call. Safe to
call on every app start. Use organisation.id as {org} in tenant routes.
API keys: any key.
Responses
200The person and organisation — Me401Missing, invalid or expired token — Problem403Authenticated but not allowed (e.g. unverified email, not the agent’s controller, card routed to someone else) — Problem503A dependency (e.g. the sign-in service) is unavailable — Problem
Edit my name and time zone
Section titled “Edit my name and time zone”PATCH /v1/meBoth fields optional; omitted fields keep their value. time_zone must be an IANA name
Postgres knows (e.g. Asia/Kolkata), else 422. Role, email and organisation can’t be
changed here.
API keys: not available (needs a person signed in to the app).
Request body (JSON)
| Field | Type | Description |
|---|---|---|
display_name |
string | |
time_zone |
string | |
ai_email_footer |
boolean | “Sent with AI via Teemli” on emails my agents send as me. Stays on where the law expects it (EU/EEA, UK…). |
Responses
200The updated person — Person401Missing, invalid or expired token — Problem422Invalid input — Problem
Delete my account and everything I own (app-store requirement)
Section titled “Delete my account and everything I own (app-store requirement)”DELETE /v1/meDeletes my agents, conversations, memory, meetings, connections (revoked at Composio), computer, devices,
phones and my Keycloak account. AI employees I manage pause until an admin reassigns them. The last owner of
an organisation with other people must name transfer_to (409 otherwise); a person alone deletes the
organisation too.
API keys: not available (needs a person signed in to the app).
Request body (JSON)
| Field | Type | Description |
|---|---|---|
confirm (required) |
string | My email address (type-to-confirm) |
transfer_to |
string (uuid) |
Responses
200{deleted, org_deleted} — object409Conflicting state (card already answered, duplicate in flight, name taken) — Problem422Invalid input — Problem
Live updates (WebSocket)
Section titled “Live updates (WebSocket)”GET /v1/wsUpgrade to a WebSocket. Authenticate with an Authorization: Bearer header (native
clients) or, from browsers, send {"type":"auth","access_token":"..."} as the first
message within 10 seconds. Re-send auth with a refreshed token before expiry; the
server closes with code 4401 when the token expires or is invalid.
Server messages: ready, live events ({type, org_id, person_id, conversation_id?, data, at}),
lagged (reload from REST), pong. Live updates are not stored.
Every event type and its data is specified in api/asyncapi.yaml.
Auth: none (public endpoint).
Responses
101Switching protocols
My ChatGPT plan (status)
Section titled “My ChatGPT plan (status)”GET /v1/me/chatgpt“Use my ChatGPT plan” (product.md 7.5): the person signs in with ChatGPT the way the
Codex CLI does (OpenAI’s public Codex OAuth client; not an OpenAI-approved integration,
risk accepted by the founder), and only their own agents run on their plan, never AI
employees or anyone else’s requests. When the plan fails or hits its usage limit, agents
use the organisation’s own model access (fallback) and the conversation gets a note.
Tokens live only in OpenBao; this endpoint never returns them. Only the person can read
their own sign-in (admins can’t). Live changes: chatgpt.updated on /v1/ws.
API keys: not available (needs a person signed in to the app).
Responses
200Status — ChatgptStatus401Missing, invalid or expired token — Problem
Choose the plan model my agents use
Section titled “Choose the plan model my agents use”PUT /v1/me/chatgptAn agent’s own model wins when the plan offers it (openai/<slug> or <slug>).
API keys: not available (needs a person signed in to the app).
Request body (JSON)
| Field | Type | Description |
|---|---|---|
model (required) |
string | One of models[].slug |
Responses
200Status — ChatgptStatus401Missing, invalid or expired token — Problem404Not found (also returned for rows the caller may not see, and for disabled features) — Problem422Invalid input — Problem
Disconnect my ChatGPT plan
Section titled “Disconnect my ChatGPT plan”DELETE /v1/me/chatgptAgents stop using the plan at once. The worker then revokes the refresh token at
OpenAI (POST https://auth.openai.com/oauth/revoke) and deletes it from OpenBao (the
api role can’t read sign-ins, audit M-19). The same happens when a person is removed or
deletes their account.
API keys: not available (needs a person signed in to the app).
Responses
200Status (connected false) — ChatgptStatus401Missing, invalid or expired token — Problem
Start a device-code sign-in
Section titled “Start a device-code sign-in”POST /v1/me/chatgpt/deviceFor every surface (web, phone, extension). Returns a code the person enters at OpenAI’s
device page (verification_url, https://auth.openai.com/codex/device). Requires the
person’s consent from the consent screen. Then poll
POST /v1/me/chatgpt/device/{id}/poll every interval seconds. The code is valid for 15
minutes. The desktop app also offers the browser sign-in over its device socket
(chatgpt.start / chatgpt.code, asyncapi deviceSocket).
API keys: not available (needs a person signed in to the app).
Request body (JSON)
| Field | Type | Description |
|---|---|---|
consent (required) |
boolean | The person agreed on the consent screen |
Responses
200The code to show — object401Missing, invalid or expired token — Problem403Authenticated but not allowed (e.g. unverified email, not the agent’s controller, card routed to someone else) — Problem404Not found (also returned for rows the caller may not see, and for disabled features) — Problem422Invalid input — Problem503OpenAI’s sign-in service is unreachable (problem+json)
Poll a device-code sign-in
Section titled “Poll a device-code sign-in”POST /v1/me/chatgpt/device/{id}/pollpending until the person approves at OpenAI (OpenAI is asked at most once per
interval); connected (with the new status) once the server has exchanged the code and
stored the tokens; denied or expired end it. Only the person who started it can poll.
API keys: not available (needs a person signed in to the app).
| Parameter | In | Type | Description |
|---|---|---|---|
id (required) |
path | string (uuid) |
Responses
200State — object401Missing, invalid or expired token — Problem404Not found (also returned for rows the caller may not see, and for disabled features) — Problem
My Grok plan (status)
Section titled “My Grok plan (status)”GET /v1/me/grok“Use my Grok plan” (product.md 7.5): the person signs in with xAI (SuperGrok / X
Premium) through xAI’s device-code sign-in with its shared public client, identified as
Teemli (referrer=teemli, a Teemli/… User-Agent); only their own agents run on the
plan, never AI employees or anyone else’s requests. When the plan fails or hits its
limit, agents use the organisation’s own model access and the conversation gets a note.
Tokens live only in OpenBao; only the person can read their sign-in. Off for everyone
with TEEMLI_GROK_PLAN=false; per organisation with allow_grok_plan.
API keys: not available (needs a person signed in to the app).
Responses
200Status — GrokStatus401Missing, invalid or expired token — Problem
Choose the plan model my agents use
Section titled “Choose the plan model my agents use”PUT /v1/me/grokAPI keys: not available (needs a person signed in to the app).
Request body (JSON)
| Field | Type | Description |
|---|---|---|
model (required) |
string | One of models[].slug |
Responses
200Status — GrokStatus401Missing, invalid or expired token — Problem404Not found (also returned for rows the caller may not see, and for disabled features) — Problem422Invalid input — Problem
Disconnect my Grok plan
Section titled “Disconnect my Grok plan”DELETE /v1/me/grokAgents stop using it at once; the worker revokes the refresh token at xAI (when xAI offers revocation) and deletes it from OpenBao.
API keys: not available (needs a person signed in to the app).
Responses
200Status (connected false) — GrokStatus401Missing, invalid or expired token — Problem
Start a Grok device-code sign-in
Section titled “Start a Grok device-code sign-in”POST /v1/me/grok/deviceRequires the person’s consent. Returns a code and xAI’s page (verification_url, with the code filled in); then poll every interval seconds. No localhost callback, so it works on every surface.
API keys: not available (needs a person signed in to the app).
Request body (JSON)
| Field | Type | Description |
|---|---|---|
consent (required) |
boolean |
Responses
200The code to show — object401Missing, invalid or expired token — Problem403Authenticated but not allowed (e.g. unverified email, not the agent’s controller, card routed to someone else) — Problem404Not found (also returned for rows the caller may not see, and for disabled features) — Problem422Invalid input — Problem503xAI’s sign-in service is unreachable (problem+json)
Poll a Grok device-code sign-in
Section titled “Poll a Grok device-code sign-in”POST /v1/me/grok/device/{id}/pollpending (with a longer interval after xAI’s slow_down) until approved; connected once tokens are stored; denied / expired end it. Only the person who started it can poll.
API keys: not available (needs a person signed in to the app).
| Parameter | In | Type | Description |
|---|---|---|---|
id (required) |
path | string (uuid) |
Responses
200State — object401Missing, invalid or expired token — Problem404Not found (also returned for rows the caller may not see, and for disabled features) — Problem
My own model access (plans, keys) and which one my agents use
Section titled “My own model access (plans, keys) and which one my agents use”GET /v1/me/model-accessEverything a person has connected for their own agents: ChatGPT plan, Grok plan,
and their own Anthropic / Gemini / OpenRouter keys; in_use is what their agents run on
now (org = the organisation’s access), source their explicit choice (null =
automatic: the most recently connected). Never returns a key or token. Live changes:
model_access.updated on /v1/ws.
API keys: not available (needs a person signed in to the app).
Responses
200View — ModelAccess401Missing, invalid or expired token — Problem
Choose what my agents run on
Section titled “Choose what my agents run on”PUT /v1/me/model-accessAPI keys: not available (needs a person signed in to the app).
Request body (JSON)
| Field | Type | Description |
|---|---|---|
source |
org, chatgpt, grok, anthropic, gemini, openrouter, null |
null = automatic |
Responses
200View — ModelAccess401Missing, invalid or expired token — Problem422Invalid input — Problem
Add (or replace) my own API key
Section titled “Add (or replace) my own API key”PUT /v1/me/model-keys/{provider}Validated first with the provider’s free endpoint (Anthropic GET /v1/models, Gemini
GET /v1beta/models, OpenRouter GET /api/v1/key), then stored only in OpenBao (the
api can’t read it back). Used only for the person’s own agents. Spend on it is the
person’s (usage_records.personal_cost_usd), never the organisation’s budget. It becomes
what their agents run on.
API keys: not available (needs a person signed in to the app).
| Parameter | In | Type | Description |
|---|---|---|---|
provider (required) |
path | anthropic, gemini, openrouter |
Request body (JSON)
| Field | Type | Description |
|---|---|---|
api_key (required) |
string | |
consent (required) |
boolean | |
model |
string \ | null |
Responses
200View — ModelAccess401Missing, invalid or expired token — Problem403Authenticated but not allowed (e.g. unverified email, not the agent’s controller, card routed to someone else) — Problem404Not found (also returned for rows the caller may not see, and for disabled features) — Problem422Invalid input — Problem
Choose the model my agents use on this key
Section titled “Choose the model my agents use on this key”PATCH /v1/me/model-keys/{provider}API keys: not available (needs a person signed in to the app).
| Parameter | In | Type | Description |
|---|---|---|---|
provider (required) |
path | anthropic, gemini, openrouter |
Request body (JSON)
| Field | Type | Description |
|---|---|---|
model (required) |
string |
Responses
200View — ModelAccess404Not found (also returned for rows the caller may not see, and for disabled features) — Problem422Invalid input — Problem
Remove my key (the worker deletes the vault copy)
Section titled “Remove my key (the worker deletes the vault copy)”DELETE /v1/me/model-keys/{provider}API keys: not available (needs a person signed in to the app).
| Parameter | In | Type | Description |
|---|---|---|---|
provider (required) |
path | anthropic, gemini, openrouter |
Responses
200View — ModelAccess401Missing, invalid or expired token — Problem
Check a pasted key (nothing is saved)
Section titled “Check a pasted key (nothing is saved)”POST /v1/me/model-keys/{provider}/validateAPI keys: not available (needs a person signed in to the app).
| Parameter | In | Type | Description |
|---|---|---|---|
provider (required) |
path | anthropic, gemini, openrouter |
Request body (JSON)
| Field | Type | Description |
|---|---|---|
api_key (required) |
string |
Responses
200The key works — object403Authenticated but not allowed (e.g. unverified email, not the agent’s controller, card routed to someone else) — Problem404Not found (also returned for rows the caller may not see, and for disabled features) — Problem422Invalid input — Problem
Finish a browser sign-in as the signed-in person (audit M-9)
Section titled “Finish a browser sign-in as the signed-in person (audit M-9)”POST /v1/me/oauth/{provider}/finishThe web app’s /oauth/finish/{provider} page posts the callback’s query here with the
person’s bearer token. Only the person who started the flow can finish it; otherwise
nothing is connected or linked (a consented Composio account is deleted) and the flow
can’t be reused.
API keys: not available (needs a person signed in to the app).
| Parameter | In | Type | Description |
|---|---|---|---|
provider (required) |
path | composio, mcp, slack, teams, openrouter |
Request body (JSON)
| Field | Type | Description |
|---|---|---|
params |
object | The callback’s query (code, state, error, iss) |
Responses
200Result for the person — object401Missing, invalid or expired token — Problem404Not found (also returned for rows the caller may not see, and for disabled features) — Problem