# Notifications

> G1: one notification service: 19 endpoints of the Teemli API.

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

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.

G1: one notification service. Every module writes inbox rows; the worker delivers each once by the person's
preferences: web push (VAPID, encrypted) and phone push (Expo) when the module's push is on and do-not-disturb
isn't, emails "right away" (urgent kinds, after a delay, only if still unread, batched) or in an hourly/daily
digest, with one-click unsubscribe. Per project / page levels. Also global search (⌘K) and held inbound mail.

## The unified inbox (every module), newest first

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

**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. |
| `module` | query | `agents`, `tasks`, `chat`, `docs`, `calls` |  |
| `filter` | query | `unread`, `all`, `archived` |  |
| `limit` | query | integer | Page size. |
| `cursor` | query | string | Opaque cursor from a previous page's `next_cursor`. |

**Responses**

- `200` A page — object
- `401` Missing, invalid or expired token — Problem
- `422` Invalid input — Problem

## Unread counts per module (badges)

```http
GET /v1/orgs/{org}/notifications/counts
```

**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` Counts — UnreadCounts
- `401` Missing, invalid or expired token — Problem

## Mark read (or unread with read=false) by ids, a module, or all

```http
POST /v1/orgs/{org}/notifications/read
```

Live `notification.read {ids, all, module, read, unread}` goes to the person's other devices.

**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 |
|---|---|---|
| `ids` | array of string (uuid) |  |
| `module` | `agents`, `tasks`, `chat`, `docs`, `calls` |  |
| `all` | boolean |  |
| `read` | boolean |  |

**Responses**

- `200` Done — object
- `401` Missing, invalid or expired token — Problem
- `422` Invalid input — Problem

## Archive (or unarchive) notifications

```http
POST /v1/orgs/{org}/notifications/archive
```

**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 |
|---|---|---|
| `ids` (required) | array of string (uuid) |  |
| `archived` | boolean |  |

**Responses**

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

## My notification preferences

```http
GET /v1/orgs/{org}/settings/notifications
```

**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` Settings — NotificationSettings
- `401` Missing, invalid or expired token — Problem

## Change some preferences (module entries merge)

```http
PUT /v1/orgs/{org}/settings/notifications
```

`{modules: {chat: {push, email: off|immediate|digest}}, email: {digest: off|hourly|daily, digest_hour, unsubscribed_all},
dnd: {enabled, start, end, days, paused_until}}`. Do-not-disturb applies to every module.

**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` Settings — NotificationSettings
- `401` Missing, invalid or expired token — Problem
- `422` Invalid input — Problem

## The server's VAPID public key (applicationServerKey)

```http
GET /v1/orgs/{org}/web-push/key
```

**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` Key — object
- `401` Missing, invalid or expired token — Problem

## My browsers registered for web push

```http
GET /v1/orgs/{org}/web-push-subscriptions
```

**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` Browsers — object
- `401` Missing, invalid or expired token — Problem

## Register this browser (PushSubscription JSON)

```http
POST /v1/orgs/{org}/web-push-subscriptions
```

Endpoints must be a real push service (FCM, Mozilla, Apple, Windows); anything else is 422. An endpoint moves to
whoever registers it last (a shared computer never shows the previous person's notifications). Payloads are
encrypted (RFC 8291) with VAPID (RFC 8292): `{title, body, url, tag, notification_ids, module, count, 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. |

**Request body** (JSON)

| Field | Type | Description |
|---|---|---|
| `endpoint` (required) | string |  |
| `keys` (required) | object |  |
| `name` | string |  |

**Responses**

- `201` Registered — WebPushSubscription
- `401` Missing, invalid or expired token — Problem
- `422` Invalid input — Problem

## Forget this browser

```http
DELETE /v1/orgs/{org}/web-push-subscriptions/{id}
```

**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. |
| `id` (required) | path | string (uuid) |  |

**Responses**

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

## Send a test notification to my browsers

```http
POST /v1/orgs/{org}/web-push-subscriptions/{id}/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. |
| `id` (required) | path | string (uuid) |  |

**Responses**

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

## My notification level for a project

```http
PUT /v1/orgs/{org}/tasks/projects/{id}/notify
```

`default | all | mentions` (only assigned / @mentions / due) `| none` (inbox only, read, no push or email).

**API keys:** needs the `tasks:write` scope.

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

**Request body** (JSON)

| Field | Type | Description |
|---|---|---|
| `level` (required) | `default`, `all`, `mentions`, `none` |  |

**Responses**

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

## My notification level for a page

```http
PUT /v1/orgs/{org}/docs/pages/{id}/notify
```

**API keys:** needs the `docs:write` scope.

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

**Request body** (JSON)

| Field | Type | Description |
|---|---|---|
| `level` (required) | `default`, `all`, `mentions`, `none` |  |

**Responses**

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

## Unsubscribe page (from an email link; confirms before changing anything)

```http
GET /v1/unsubscribe
```

**Auth:** none (public endpoint).

| Parameter | In | Type | Description |
|---|---|---|---|
| `t` (required) | query | string | Signed token: org, person and scope |

**Responses**

- `200` HTML confirm page
- `400` Invalid link

## One-click unsubscribe (RFC 8058) — the module's emails, a routine's result emails, or all

```http
POST /v1/unsubscribe
```

**Auth:** none (public endpoint).

| Parameter | In | Type | Description |
|---|---|---|---|
| `t` | query | string |  |

**Responses**

- `200` HTML done page
- `400` Invalid link

## Global search and switcher (⌘K)

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

Agents, agent tasks and chats, work items and projects, chat channels and messages, docs pages and meetings, in
the caller's own tenant transaction: row-level security and each module's own search decide what exists, so
private channels, restricted pages, private projects and other people's agent chats never appear (not even to
admins). Modules switched off are skipped. Empty `q` returns recents. Snippets are HTML-escaped text with
matches wrapped in `<mark>…</mark>`.

**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. |
| `q` | query | string |  |
| `limit` | query | integer | Per group |

**Responses**

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

## Mail to this AI employee (or its routines) held after failing sender checks

```http
GET /v1/orgs/{org}/agents/{agent}/held-mail
```

Inbound mail is checked with SPF, DKIM and DMARC. Only a verified colleague reaches their private conversation;
unverified senders are outside mail (manager's inbox); DMARC `p=reject` failures are refused at SMTP; `p=quarantine`
failures are held here for the manager (or routine owner), with a `mail_held` notification.

**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. |
| `agent` (required) | path | string (uuid) |  |

**Responses**

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

## Delete a held email

```http
DELETE /v1/orgs/{org}/held-mail/{id}
```

**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. |
| `id` (required) | path | string (uuid) |  |

**Responses**

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

## Deliver a held email after all (as mail from an unverified outsider)

```http
POST /v1/orgs/{org}/held-mail/{id}/release
```

**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. |
| `id` (required) | path | string (uuid) |  |

**Responses**

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