# Teamwork

> Agents working together — sub-agents, agent-to-agent threads, templates such as the chief of staff: 3 endpoints of the Teemli API.

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

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.

Agents working together — sub-agents, agent-to-agent threads, templates such as the chief of staff

## Agent templates (create one with POST …/agents {template})

```http
GET /v1/orgs/{org}/agent-templates
```

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

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

**Responses**

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

## Conversations between my agents (and AI employees they asked), grouped by the task they belong to

```http
GET /v1/orgs/{org}/agent-threads
```

Always visible to the person the agents act for, never to anyone else (an AI employee's manager doesn't
see the threads your agents had with it). Open one with the usual conversation endpoints (read-only:
the person doesn't post in agent threads). Group by `parent_conversation_id`.

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

| Parameter | In | Type | Description |
|---|---|---|---|
| `org` (required) | path | string (uuid) | The caller's organisation id. |
| `conversation_id` | query | string (uuid) | Only threads started from this task |
| `agent_id` | query | string (uuid) | Only threads this agent is in |

**Responses**

- `200` Threads, most recent first — object
- `401` Missing, invalid or expired token — Problem

## Sub-agents and agent messages under a task (flat, ordered by depth; build the tree by parent_conversation_id)

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

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

**Responses**

- `200` Delegations — 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
