# Ai employees

> AI employees (M5a, product.md 7.4): 6 endpoints of the Teemli API.

Source: https://docs.teemli.com/developers/reference/ai-employees/

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.

AI employees (M5a, product.md 7.4). Hire with `POST /agents {kind: "ai_employee"}` (a setup chat; you become
its manager). Its setup card carries `details.identity` (email address `<name>@<org slug>.<agent domain>`,
Slack/Teams display name); applying the card creates the mailbox. Sharing: organisation / teams / people;
each person's conversation and memory with it are private (its manager gets cards, activity and spend only).
Mail to its address becomes a task: from a person it's shared with → in their conversation; anyone else →
the manager's inbox. Lifecycle: setting_up → active → paused → retired.

## An AI employee's identity, sharing and manager (its manager only)

```http
GET /v1/orgs/{org}/agents/{agent}/employee
```

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

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

**Responses**

- `200` {agent, identity, shared_with_org, teams[], people[], reach, mail_domain, manager} — 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

## Who may message the AI employee (replaces the list)

```http
PUT /v1/orgs/{org}/agents/{agent}/sharing
```

**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) |  |

**Request body** (JSON)

| Field | Type | Description |
|---|---|---|
| `org` | boolean | Everyone in the organisation |
| `team_ids` | array of string (uuid) |  |
| `person_ids` | array of string (uuid) |  |

**Responses**

- `200` The employee view — object
- `403` Authenticated but not allowed (e.g. unverified email, not the agent's controller, card routed to someone else) — Problem

## Create or change the AI employee's identity (email local part, Slack/Teams display name)

```http
PUT /v1/orgs/{org}/agents/{agent}/identity
```

**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) |  |

**Request body** (JSON)

| Field | Type | Description |
|---|---|---|
| `email_local` | string |  |
| `display_name` | string |  |

**Responses**

- `200` The employee view; a taken name gets a number (riya2) — object
- `422` Invalid input — Problem

## Retire an AI employee (its manager or an admin)

```http
POST /v1/orgs/{org}/agents/{agent}/retire
```

Work stops, routines are disabled, its app accounts are revoked, its memory/files/conversations are archived and (optionally) handed over to `hand_over_to`, who becomes its manager of record.

**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) |  |

**Request body** (JSON)

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

**Responses**

- `200` {retired, id, connections_revoked, agent} — object
- `403` Authenticated but not allowed (e.g. unverified email, not the agent's controller, card routed to someone else) — Problem

## The organisation's directory (sharing pickers)

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

**API keys:** any key.

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

**Responses**

- `200` {items: [{id, display_name, email, role, status}]} — object

## Teams with their members (everyone reads them; admins change them)

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

**API keys:** any key.

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

**Responses**

- `200` {items: [{id, name, description, budget_monthly_usd, member_ids, scim, created_at}]} — object
