# List agent executions

> List recent agent executions with pagination.

`GET https://api.zavu.dev/v1/senders/{senderId}/agent/executions`

List recent agent executions with pagination.

An execution is one inbound message answered by the agent, so this covers the messaging channels only. Voice calls are never listed here regardless of how many the agent handled. Use `GET /v1/calls` (and `GET /v1/calls/{callId}` for the transcript) for voice.

## Parameters

- `senderId` (path, string, required)
- `status` (query, string) One of: `success`, `error`, `filtered`, `rate_limited`, `balance_insufficient`.
- `limit` (query, integer)
- `cursor` (query, string)

## Responses

### 200

List of executions.

- `items` (object[], required)
  - `id` (string, required)
  - `agentId` (string, required)
  - `inboundMessageId` (string)
  - `responseMessageId` (string, nullable)
  - `responseText` (string, nullable)
  - `status` (string, required): Status of an agent execution. One of: `success`, `error`, `filtered`, `rate_limited`, `balance_insufficient`.
  - `errorMessage` (string, nullable)
  - `inputTokens` (integer, required)
  - `outputTokens` (integer, required)
  - `latencyMs` (integer, required)
  - `cost` (number, required): Cost in USD.
  - `createdAt` (string<date-time>, required)
  - `knowledgeChunksUsed` (integer, nullable): Knowledge-base chunks retrieved for this answer. Zero on an agent that has documents attached means the reply was not grounded in them, which is otherwise indistinguishable from a correct answer in this record. Absent on executions recorded before this field existed, which is not the same as zero.
  - `toolCalls` (integer, nullable): Tools the agent called while producing this reply. Zero on an agent that has tools configured means it answered without calling any — the case where a reply says it will look something up and nothing ever reaches your endpoint. Absent on executions recorded before this field existed, which is not the same as zero.
- `nextCursor` (string, nullable)

### 400

Invalid query parameters, such as a `status` that is not an execution status.

- `code` (string, required)
- `message` (string, required)
- `details` (object)

### 401

Unauthorized.

- `code` (string, required)
- `message` (string, required)
- `details` (object)

### 404

Agent not found.

- `code` (string, required)
- `message` (string, required)
- `details` (object)

## Example

```bash
curl -X GET "https://api.zavu.dev/v1/senders/sender_abc123/agent/executions" \
  -H "Authorization: Bearer $ZAVUDEV_API_KEY"
```

```typescript
import Zavudev from "@zavudev/sdk";

const zavu = new Zavudev({ apiKey: process.env.ZAVUDEV_API_KEY });

const result = await zavu.senders.agent.executions.list("sender_abc123");

console.log(result);
```
