# Cards

> Approvals, hand-offs, questions and setup-change confirms: 4 endpoints of the Teemli API.

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

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.

Approvals, hand-offs, questions and setup-change confirms

## Cards in a conversation (oldest first)

```http
GET /v1/orgs/{org}/conversations/{conversation}/cards
```

Render inline in the thread. Answered and superseded cards collapse to one line.

**API keys:** needs the `agents:read` scope.

| Parameter | In | Type | Description |
|---|---|---|---|
| `org` (required) | path | string (uuid) | The caller's organisation id. |
| `conversation` (required) | path | string (uuid) |  |
| `status` | query | `open`, `answered`, `superseded` |  |

**Responses**

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

## Cards routed to me

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

Default `status=open`. At most 200, oldest first.

**API keys:** needs the `agents:read` scope.

| Parameter | In | Type | Description |
|---|---|---|---|
| `org` (required) | path | string (uuid) | The caller's organisation id. |
| `status` | query | `open`, `answered`, `superseded` |  |

**Responses**

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

## One card

```http
GET /v1/orgs/{org}/cards/{card}
```

**API keys:** needs the `agents:read` scope.

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

**Responses**

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

## Answer a card

```http
POST /v1/orgs/{org}/cards/{card}/answer
```

Only the person the card is routed to (`route_to_person_id`) may answer (403
otherwise); an answered or superseded card answers 409. The answer must be valid for
the card kind (422): permission → one of `options`; handoff → `done`/`skip`;
question → `answer` (with `text`) / `skip`; setup_change → `apply`/`dismiss`.
`allow_task` / `allow_always` also save an allow rule (keyed by agent, tool, class and
account); `allow_always` also answers other open cards for the same action. `apply`
updates the agent at once (a `setting_up` agent with a name and charter becomes
`active`), creates the card's routines (`details.routines`, or only the indexes in
`routines`) and applies a routine change (`details.routine_change`). connect_app cards
accept only `skip` here: connecting goes through `POST …/connections` with `card_id`.
Then a `card.answered` event resumes the waiting turn (watch `/v1/ws`).

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

**Request body** (JSON)

| Field | Type | Description |
|---|---|---|
| `answer` (required) | CardAnswer |  |
| `text` | string | question cards: the answer |
| `routines` | array of integer | setup_change with suggested routines: which ones to create (indexes into details.routines); default all |

**Responses**

- `200` The answered card — Card
- `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
- `409` Conflicting state (card already answered, duplicate in flight, name taken) — Problem
- `422` Invalid input — Problem
