# Mobile

> The mobile app (M4d): 7 endpoints of the Teemli API.

Source: https://docs.teemli.com/developers/reference/mobile/

Generated from [`api/openapi.yaml`](/developers/api/) (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 mobile app (M4d). Phones register an Expo push token; the worker pushes "needs you" (open cards routed
to the person, a turn waiting for an offline laptop), finished tasks, and replies in an agent's main chat after
a long turn, each switchable per phone. Notifications deep-link with `data.url` (`/conversation/<id>?card=<id>`,
`/needs-you`). Voice notes are transcribed in memory through the organisation's OpenRouter key.

## My phones registered for push notifications

```http
GET /v1/orgs/{org}/push-devices
```

Only the caller's own (row-level security; never admins, never an AI employee's turn).

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

| Parameter | In | Type | Description |
|---|---|---|---|
| `org` (required) | path | string (uuid) | The caller's organisation id. |

**Responses**

- `200` Phones — object
- `401` Missing, invalid or expired token — Problem

## Register this phone (idempotent per token)

```http
POST /v1/orgs/{org}/push-devices
```

Call after sign-in and whenever the token changes. A token belongs to one app install: if someone else had
registered it (another person signed in on this phone before), their registration is removed so their
notifications stop reaching it. `prefs` is optional (default all on); when omitted, existing prefs are kept.

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

| Parameter | In | Type | Description |
|---|---|---|---|
| `org` (required) | path | string (uuid) | The caller's organisation id. |

**Request body** (JSON)

| Field | Type | Description |
|---|---|---|
| `token` (required) | string |  |
| `install_secret` | string | A random secret this app install keeps in secure storage. The first registration binds the token to it; another person can take the token over only with the same secret (the same phone). Knowing a token isn't owning the phone (409 otherwise). |
| `platform` (required) | `ios`, `android` |  |
| `name` | string | e.g. "Maya's iPhone" |
| `app_version` | string |  |
| `prefs` | PushPrefs | What this phone is told about (all default to true). |

**Responses**

- `200` Registered — PushDevice
- `401` Missing, invalid or expired token — Problem
- `409` The token is bound to another app install
- `422` Invalid input — Problem

## Change this phone's notification preferences

```http
PATCH /v1/orgs/{org}/push-devices/{device}
```

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

| Parameter | In | Type | Description |
|---|---|---|---|
| `org` (required) | path | string (uuid) | The caller's organisation id. |
| `device` (required) | path | string (uuid) |  |

**Request body** (JSON)

| Field | Type | Description |
|---|---|---|
| `prefs` (required) | PushPrefs | What this phone is told about (all default to true). |

**Responses**

- `200` Updated — PushDevice
- `404` Not found (also returned for rows the caller may not see, and for disabled features) — Problem
- `422` Invalid input — Problem

## Forget this phone (signing out)

```http
DELETE /v1/orgs/{org}/push-devices/{device}
```

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

| Parameter | In | Type | Description |
|---|---|---|---|
| `org` (required) | path | string (uuid) | The caller's organisation id. |
| `device` (required) | path | string (uuid) |  |

**Responses**

- `204` Forgotten
- `404` Not found (also returned for rows the caller may not see, and for disabled features) — Problem

## Send "Notifications are on" to my phones

```http
POST /v1/orgs/{org}/push-devices/{device}/test
```

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

| Parameter | In | Type | Description |
|---|---|---|---|
| `org` (required) | path | string (uuid) | The caller's organisation id. |
| `device` (required) | path | string (uuid) |  |

**Responses**

- `200` How many phones the push service accepted it for — object
- `404` Not found (also returned for rows the caller may not see, and for disabled features) — Problem
- `503` A dependency (e.g. the sign-in service) is unavailable — Problem

## Transcribe a voice message

```http
POST /v1/orgs/{org}/transcriptions
```

The raw recording is the body (≤ 8 MB, the apps stop at 3 minutes). It is relayed in memory and never
stored. The app puts the text in the composer for the person to check and send.

**Teemli Cloud (ELEVENLABS_API_KEY set):** ElevenLabs Scribe v3 with Teemli's own key, language detected
automatically (or the `language` hint), filler words dropped. Teemli pays: the organisation's spend and
budgets are untouched (usage kind `voice_message` with `audio_seconds` and `platform_cost_usd`, `cost_usd`
0). Each person has a monthly allowance by plan (`GET …/voice`); once it's used up → 429 with a friendly
message and nothing sent. Guests get 403. Rate limited per person (10 at once, then 12 a minute) and
organisation (429, the `Voice` bucket). ElevenLabs problems → 503 ("unavailable right now", "busy") or
422 (unreadable recording).

**Self-hosted without that key:** speech-to-text on the organisation's OpenRouter key (the meeting-notes
model), usage kind `transcription`; budgets are checked first (422, nothing sent). Re-audit R-4.

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

| Parameter | In | Type | Description |
|---|---|---|---|
| `org` (required) | path | string (uuid) | The caller's organisation id. |
| `format` (required) | query | `m4a`, `mp4`, `aac`, `wav`, `mp3`, `webm`, `ogg`, `flac` |  |
| `language` | query | string | ISO 639-1 hint |

**Request body:** `application/octet-stream`.

**Responses**

- `200` The text — 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
- `422` Invalid input — Problem
- `429` Rate limited (search, link previews, imports, uploads, model key checks): per person and per organisation token buckets. Retry after `Retry-After` seconds. — Problem
- `503` A dependency (e.g. the sign-in service) is unavailable — Problem

## My voice-message allowance this month

```http
GET /v1/orgs/{org}/voice
```

Minutes per person per calendar month (UTC) by the organisation's plan (Free 60, Startup 600 per seat by
default; `TEEMLI_VOICE_MINUTES_*`). The apps show it in Usage and next to the mic when it runs low.

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

| Parameter | In | Type | Description |
|---|---|---|---|
| `org` (required) | path | string (uuid) | The caller's organisation id. |

**Responses**

- `200` The allowance — VoiceAllowance
- `401` Missing, invalid or expired token — Problem
