Skip to content

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/deletion

API keys: not available (needs a person signed in to the app).

Responses

  • 200 Counts, whether the organisation goes too, whether ownership must be handed over, and candidates — object
  • 401 Missing, 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/invitations

API 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_elsewhere when my email domain is verified by another organisation — object
  • 401 Missing, 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}/accept

API 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} — object
  • 404 Not found (also returned for rows the caller may not see, and for disabled features) — Problem
  • 409 My email domain is verified by another organisation, or I’m the last owner of an organisation with other people
  • 422 leave_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}/decline

API keys: not available (needs a person signed in to the app).

Parameter In Type Description
id (required) path string (uuid)

Responses

  • 200 OK — object
  • 404 Not 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/seen

API keys: not available (needs a person signed in to the app).

Responses

  • 204 Dismissed

Finish the welcome (idempotent; the first time wins)

Section titled “Finish the welcome (idempotent; the first time wins)”
POST /v1/me/onboarded

API keys: not available (needs a person signed in to the app).

Responses

  • 204 Done

The signed-in person and their organisation

Section titled “The signed-in person and their organisation”
GET /v1/me

Provisions 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

  • 200 The person and organisation — Me
  • 401 Missing, invalid or expired token — Problem
  • 403 Authenticated but not allowed (e.g. unverified email, not the agent’s controller, card routed to someone else) — Problem
  • 503 A dependency (e.g. the sign-in service) is unavailable — Problem
PATCH /v1/me

Both 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

  • 200 The updated person — Person
  • 401 Missing, invalid or expired token — Problem
  • 422 Invalid 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/me

Deletes 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} — object
  • 409 Conflicting state (card already answered, duplicate in flight, name taken) — Problem
  • 422 Invalid input — Problem
GET /v1/ws

Upgrade 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

  • 101 Switching protocols
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

  • 200 Status — ChatgptStatus
  • 401 Missing, invalid or expired token — Problem
PUT /v1/me/chatgpt

An 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

  • 200 Status — ChatgptStatus
  • 401 Missing, invalid or expired token — Problem
  • 404 Not found (also returned for rows the caller may not see, and for disabled features) — Problem
  • 422 Invalid input — Problem
DELETE /v1/me/chatgpt

Agents 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

  • 200 Status (connected false) — ChatgptStatus
  • 401 Missing, invalid or expired token — Problem
POST /v1/me/chatgpt/device

For 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

  • 200 The code to show — object
  • 401 Missing, invalid or expired token — Problem
  • 403 Authenticated but not allowed (e.g. unverified email, not the agent’s controller, card routed to someone else) — Problem
  • 404 Not found (also returned for rows the caller may not see, and for disabled features) — Problem
  • 422 Invalid input — Problem
  • 503 OpenAI’s sign-in service is unreachable (problem+json)
POST /v1/me/chatgpt/device/{id}/poll

pending 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

  • 200 State — object
  • 401 Missing, invalid or expired token — Problem
  • 404 Not found (also returned for rows the caller may not see, and for disabled features) — Problem
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

  • 200 Status — GrokStatus
  • 401 Missing, invalid or expired token — Problem
PUT /v1/me/grok

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

  • 200 Status — GrokStatus
  • 401 Missing, invalid or expired token — Problem
  • 404 Not found (also returned for rows the caller may not see, and for disabled features) — Problem
  • 422 Invalid input — Problem
DELETE /v1/me/grok

Agents 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

  • 200 Status (connected false) — GrokStatus
  • 401 Missing, invalid or expired token — Problem
POST /v1/me/grok/device

Requires 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

  • 200 The code to show — object
  • 401 Missing, invalid or expired token — Problem
  • 403 Authenticated but not allowed (e.g. unverified email, not the agent’s controller, card routed to someone else) — Problem
  • 404 Not found (also returned for rows the caller may not see, and for disabled features) — Problem
  • 422 Invalid input — Problem
  • 503 xAI’s sign-in service is unreachable (problem+json)
POST /v1/me/grok/device/{id}/poll

pending (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

  • 200 State — object
  • 401 Missing, invalid or expired token — Problem
  • 404 Not 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-access

Everything 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

  • 200 View — ModelAccess
  • 401 Missing, invalid or expired token — Problem
PUT /v1/me/model-access

API 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

  • 200 View — ModelAccess
  • 401 Missing, invalid or expired token — Problem
  • 422 Invalid input — Problem
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

  • 200 View — ModelAccess
  • 401 Missing, invalid or expired token — Problem
  • 403 Authenticated but not allowed (e.g. unverified email, not the agent’s controller, card routed to someone else) — Problem
  • 404 Not found (also returned for rows the caller may not see, and for disabled features) — Problem
  • 422 Invalid 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

  • 200 View — ModelAccess
  • 404 Not found (also returned for rows the caller may not see, and for disabled features) — Problem
  • 422 Invalid 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

  • 200 View — ModelAccess
  • 401 Missing, invalid or expired token — Problem
POST /v1/me/model-keys/{provider}/validate

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

Responses

  • 200 The key works — object
  • 403 Authenticated but not allowed (e.g. unverified email, not the agent’s controller, card routed to someone else) — Problem
  • 404 Not found (also returned for rows the caller may not see, and for disabled features) — Problem
  • 422 Invalid 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}/finish

The 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

  • 200 Result for the person — object
  • 401 Missing, invalid or expired token — Problem
  • 404 Not found (also returned for rows the caller may not see, and for disabled features) — Problem