# Apps

> The app catalogue (Composio toolkits, Zapier MCP, remote MCP servers), connections (several labelled accounts per app, one default), the connect flow and its callbacks, and the organisation's app policy: 14 endpoints of the Teemli API.

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

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 app catalogue (Composio toolkits, Zapier MCP, remote MCP servers), connections (several labelled
accounts per app, one default), the connect flow and its callbacks, and the organisation's app policy.

## App catalogue with my connection state

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

Zapier first (on the first page, matching `q`), then Composio toolkits people can connect without
setup (Composio-managed sign-in or no auth), most used first. Each app says whether the admin allows
it and my state: ready (a working connection), not_connected, reconnect (expired/failed), pending.
"Add an MCP server" is a separate action (POST …/mcp-servers) when `custom_mcp_allowed`.

**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 | Search by name or description |
| `cursor` | query | string | Opaque cursor from a previous page's `next_cursor`. |
| `limit` | query | integer |  |
| `agent_id` | query | string (uuid) | An AI employee I manage (its own connections); default mine |

**Responses**

- `200` Apps — 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
- `503` A dependency (e.g. the sign-in service) is unavailable — Problem

## One app — my connections and its main actions (with their action class)

```http
GET /v1/orgs/{org}/apps/{app}
```

**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. |
| `app` (required) | path | string | Toolkit slug (e.g. gmail) or zapier |
| `agent_id` | query | string (uuid) | An AI employee I manage (its own connections); default mine |

**Responses**

- `200` The app — 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 connections (or an AI employee's I manage)

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

**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_id` | query | string (uuid) | An AI employee I manage (its own connections); default mine |

**Responses**

- `200` Connections, by app, default first — 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

## Connect an app (Composio app or Zapier)

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

Starts the sign-in: open `redirect_url` in a new tab (the app's own consent page through Composio, or
Zapier's sign-in). The browser comes back to `/v1/integrations/composio/callback` (or
`/v1/oauth/mcp/callback`), which checks the account and shows "Connected"; a `connection.updated` live
event follows. With `card_id`, the connect card is answered and the waiting turn continues.
A second account of the same app gets its own label ("Work", "Personal"; default "Gmail 2").

**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 |
|---|---|---|
| `app` (required) | string |  |
| `label` | string |  |
| `agent_id` | string (uuid) | Connect for an AI employee I manage |
| `card_id` | string (uuid) | The connect_app card this answers |

**Responses**

- `201` Started (status pending) — ConnectStarted
- `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

## Rename, make default, or trust an MCP server's tool hints

```http
PATCH /v1/orgs/{org}/connections/{connection}
```

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

**Request body** (JSON)

| Field | Type | Description |
|---|---|---|
| `label` | string |  |
| `is_default` | boolean | true: agents use this account unless they pick another |
| `trusted` | boolean | MCP only: its read-only hints count (otherwise they're treated as writes) |

**Responses**

- `200` The connection — Connection
- `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

## Disconnect (revoked at Composio, tokens removed from the vault)

```http
DELETE /v1/orgs/{org}/connections/{connection}
```

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

**Responses**

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

## Sign in again (expired or revoked); same label and default

```http
POST /v1/orgs/{org}/connections/{connection}/reconnect
```

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

**Request body** (JSON)

| Field | Type | Description |
|---|---|---|
| `card_id` | string (uuid) |  |

**Responses**

- `200` Started — ConnectStarted
- `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

## What agents can do with this connection (name, title, description, class)

```http
GET /v1/orgs/{org}/connections/{connection}/tools
```

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

**Responses**

- `200` Tools — 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
- `503` A dependency (e.g. the sign-in service) is unavailable — Problem

## My MCP connections (custom servers and Zapier)

```http
GET /v1/orgs/{org}/mcp-servers
```

**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_id` | query | string (uuid) | An AI employee I manage (its own connections); default mine |

**Responses**

- `200` Connections with source mcp or zapier — object
- `401` Missing, invalid or expired token — Problem

## Add a remote MCP server by URL

```http
POST /v1/orgs/{org}/mcp-servers
```

Streamable HTTP servers only. The URL must be https and public (private addresses are refused).
`auth.kind`: oauth → the server's own sign-in (OAuth 2.1 + PKCE; tokens kept in the vault per person):
open `redirect_url`; header → a static header such as an API key (checked now; status ready or
failed with `last_error`); none. Off when the admin disallows custom MCP servers.

**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 |
|---|---|---|
| `url` (required) | string (uri) |  |
| `name` (required) | string |  |
| `label` | string |  |
| `auth` (required) | object |  |
| `agent_id` | string (uuid) |  |
| `card_id` | string (uuid) |  |

**Responses**

- `201` Added (ready/failed) or sign-in started (pending + redirect_url) — ConnectStarted
- `401` Missing, invalid or expired token — Problem
- `422` Invalid input — Problem

## The organisation's app policy

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

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

## Set the app policy (admins)

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

mode `all` (default) or `allow_list` (only `allowed` app slugs). `custom_mcp`/`zapier` switch those
sources. `ask_classes` ⊆ [write, send]: those always ask first (fixed rules can't be loosened).

**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 |
|---|---|---|
| `mode` (required) | `all`, `allow_list` |  |
| `allowed` | array of string |  |
| `custom_mcp` (required) | boolean |  |
| `zapier` (required) | boolean |  |
| `ask_classes` | array of `write`, `send` |  |

**Responses**

- `200` Policy — AppSettings
- `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

## Browser redirect after connecting a Composio app; hands off to the web app

```http
GET /v1/integrations/composio/callback
```

Does nothing itself (no bearer token, and a connect link can be forwarded); redirects to `/oauth/finish/composio?…`, finished with `POST /v1/me/oauth/composio/finish` by the person who started it.

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

| Parameter | In | Type | Description |
|---|---|---|---|
| `state` (required) | query | string |  |

**Responses**

- `303` Redirect to the web app's /oauth/finish/composio

## Browser redirect after an MCP server's sign-in; hands off to the web app

```http
GET /v1/oauth/mcp/callback
```

Redirects to `/oauth/finish/mcp?…`; `POST /v1/me/oauth/mcp/finish` exchanges the code (PKCE, issuer checked) only for the person who started it.

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

| Parameter | In | Type | Description |
|---|---|---|---|
| `code` | query | string |  |
| `state` | query | string |  |
| `iss` | query | string |  |
| `error` | query | string |  |

**Responses**

- `303` Redirect to the web app's /oauth/finish/mcp
