# Get a single agent execution

> Fetch full details for one execution — including errorMessage, errorCode, and responseText. Use this to debug failures surfaced by the list endpoint.

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

Fetch full details for one execution — including `errorMessage`, `errorCode`, and `responseText`. Use this to debug failures surfaced by the list endpoint.

## Parameters

- `senderId` (path, string, required)
- `executionId` (path, string, required)

## Responses

### 200

Execution details.

- `execution` (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.

### 401

Unauthorized.

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

### 404

Agent or execution 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/execution_abc123" \
  -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.retrieve("execution_abc123", {
  senderId: "sender_abc123",
});

console.log(result);
```
