# Read an organisation's call history

> Page: https://docs.plotwork.dev/api/get-orgs-org-calls. Index of every page: https://docs.plotwork.dev/llms.txt

One page of the calls made with the organisation keys and connected agents, newest first: when, who, which agent, which tool, how it ended, how long it took.

`GET /orgs/{org}/calls`

## TL;DR

| Question | Answer |
|---|---|
| What does it do? | Read an organisation's call history. |
| What does it take? | `org` in the path, and `member`, `key`, `tool`, `group`, `outcome`, `from`, `to`, `cursor`, `limit` in the query string. |
| What does it return? | Status 200 with a body of type [`OrgCallPage`](https://docs.plotwork.dev/api/schemas.md#orgcallpage). |
| What can go wrong? | `400` a filter or the cursor is not valid; `401` not signed in, or the key is not valid; `403` an organisation key without `audit:read`, or an agent connection (orgs.forbidden); `404` no such organisation, the caller is not a member of it, or the key is another organisation's; `429` too many requests; `503` organisations are not set up on this server. Every failure uses the one error envelope. |

## What it does

One page of the calls made with the organisation keys and connected agents, newest first: when, who, which agent, which tool, how it ended, how long it took. Never the diagram content. The owner, admins and the people the owner chose see every call; other members their own agents. Kept 90 days.

## Path parameters

| Field | Type | Required | Description |
|---|---|---|---|
| `org` | `string` | yes | The organisation's id or its slug. |

## Query parameters

| Field | Type | Required | Description |
|---|---|---|---|
| `member` | `string` | no | A member's account id: the calls of the agents they connected. |
| `key` | `string` | no | An organisation key, or the key behind an agent connection, by id. |
| `tool` | `"compare_diagrams" \| "convert_mermaid" \| "delete_diagram" \| "draw_diagram" \| "draw_from_pattern" \| "edit_diagram" \| "find_pattern" \| "get_diagram_syntax" \| "get_pattern" \| "import_source" \| "list_diagrams" \| "map_icons" \| "outline_diagram" \| "plan_document_diagrams" \| "publish_diagram" \| "read_diagram" \| "render_diagram" \| "search_icons" \| "suggest_diagram" \| "sync_markdown" \| "validate_diagram" \| "GET /v1/icons" \| "GET /v1/vocabulary" \| "POST /v1/diagrams/compare" \| "POST /v1/diagrams/convert-mermaid" \| "POST /v1/diagrams/draw" \| "POST /v1/diagrams/edit" \| "POST /v1/diagrams/outline" \| "POST /v1/diagrams/publish" \| "POST /v1/diagrams/read" \| "POST /v1/diagrams/render" \| "POST /v1/diagrams/suggest" \| "POST /v1/diagrams/validate" \| "POST /v1/icons/map" \| "POST /v1/import" \| "POST /v1/markdown/plan" \| "POST /v1/markdown/sync" \| "POST /v1/patterns/draw" \| "POST /v1/patterns/find" \| "POST /v1/patterns/get"` | no | An MCP tool, or a `/v1` route as `METHOD path`. |
| `group` | `"draw" \| "import" \| "publish" \| "library" \| "check" \| "icons" \| "docs" \| "help"` | no | What the calls did. |
| `outcome` | `"ok" \| "invalid" \| "refused" \| "error"` | no | How the calls ended. |
| `from` | `string` | no | From this time on (inclusive). |
| `to` | `string` | no | Before this time (exclusive). |
| `cursor` | `string` | no | The page's `nextCursor` from the page before, for the next, older page. |
| `limit` | `integer` | no | Calls in the page, 1 to 200. Default 50. |

## Responses

| Status | Meaning | Body |
|---|---|---|
| 200 | The page. | [`OrgCallPage`](https://docs.plotwork.dev/api/schemas.md#orgcallpage) |
| 400 | A filter or the cursor is not valid. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 401 | Not signed in, or the key is not valid. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 403 | An organisation key without `audit:read`, or an agent connection (orgs.forbidden). | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 404 | No such organisation, the caller is not a member of it, or the key is another organisation's. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 429 | Too many requests. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 503 | Organisations are not set up on this server. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |

## Response body

A 200 answer has the type [`OrgCallPage`](https://docs.plotwork.dev/api/schemas.md#orgcallpage).

| Field | Type | Required | Description |
|---|---|---|---|
| `available` | `boolean` | yes | False when the call history is not set up on this server, or could not be read. |
| `items` | `OrgCall[]` | yes |  |
| `items[].at` | `string` | yes | When the call ended: an ISO 8601 time in UTC with milliseconds. |
| `items[].surface` | `"mcp" \| "api"` | yes | `mcp` for the hosted MCP server, `api` for the REST API. |
| `items[].via` | `"connection" \| "key"` | yes | `connection` for an agent a member connected with a browser sign-in, `key` for a key from the Keys tab. |
| `items[].member` | `object \| null` | yes | The member who connected the agent; null for a key from the Keys tab. |
| `items[].member.userId` | `string` | yes |  |
| `items[].member.email` | `string \| null` | yes |  |
| `items[].key` | `object` | yes | The key behind the call, with its name; the name is null once the key is gone. |
| `items[].key.id` | `string` | yes |  |
| `items[].key.name` | `string \| null` | yes |  |
| `items[].agent` | `string \| null` | yes | The name the agent gave itself, for a connection; null for a key. |
| `items[].tool` | `string` | yes | The MCP tool, or the `/v1` route as `METHOD path`. |
| `items[].group` | `"draw" \| "import" \| "publish" \| "library" \| "check" \| "icons" \| "docs" \| "help"` | yes |  |
| `items[].outcome` | `"ok" \| "invalid" \| "refused" \| "error"` | yes | `ok`, `invalid` (the input was refused: a source with errors, arguments that do not fit), `refused` (a limit, a plan or a rule said no) or `error`. |
| `items[].durationMs` | `integer` | yes |  |
| `items[].requestId` | `string \| null` | yes | The request id or Cloudflare ray id, for support. |
| `nextCursor` | `string \| null` | yes | Send as `cursor` for the next, older page; null when this is the last. |
| `scope` | `"organisation" \| "own"` | yes | `organisation`: every member's calls. `own`: the calls of the agents the caller connected, for someone the owner has not let read the history. |
| `retentionDays` | `integer` | yes | Days the history keeps a call. |
| `canExport` | `boolean` | yes | Whether the caller may download the history as CSV (the owner and admins). |

## See also

| Doc | Why |
|---|---|
| [API reference](https://docs.plotwork.dev/api/reference.md) | Every endpoint, and the error envelope |
| [Schemas](https://docs.plotwork.dev/api/schemas.md) | Every request and response type |
| [Tool reference](https://docs.plotwork.dev/mcp/tools.md) | The operations as callable tools |
