> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs-beta.getzep.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs-beta.getzep.com/_mcp/server.

# Append Agent Trajectory Event

POST https://api.getzep.com/api/v4/agents/{agent_uuid}/trajectories/{trajectory_uuid}/events
Content-Type: application/json

Reference: https://docs-beta.getzep.com/sdk-reference/agent/trajectory/append-event

## Authentication

- `Authorization` header (required) (prefixed with ` Api-Key  `) — Type "Api-Key" followed by a space and the project API key.

## Request

### Path parameters

- `agent_uuid` (string, required) — Agent UUID
- `trajectory_uuid` (string, required) — Trajectory UUID

### Body (application/json)

This endpoint expects a v4.AppendAgentTrajectoryEventRequest.

- `event_type` (enum, required)
  - Allowed values: `input_reference`, `observation`, `decision`, `tool_call`, `tool_result`, `artifact`, `checkpoint`, `feedback`, `correction`, `reflection`, `verification`
- `content` (string, optional)
- `context` (v4.AgentTrajectoryEventContext, optional)
- `event_id` (string, optional)
- `metadata` (map from string to any, optional)
- `occurred_at` (string, optional)
- `sequence` (integer, optional)
- `sources` (list of v4.AgentTrajectoryEventSource, optional)

## Response

### 200

OK

- `agent_uuid` (string, optional)
- `content` (string, optional)
- `context` (v4.AgentTrajectoryEventContext, optional)
- `created_at` (string, optional)
- `event_id` (string, optional)
- `event_type` (enum, optional)
  - Allowed values: `input_reference`, `observation`, `decision`, `tool_call`, `tool_result`, `artifact`, `checkpoint`, `feedback`, `correction`, `reflection`, `verification`
- `failed_at` (string, optional)
- `metadata` (map from string to any, optional)
- `occurred_at` (string, optional)
- `processed_at` (string, optional)
- `processing_state` (enum, optional)
  - Allowed values: `pending`, `processing`, `processed`, `failed`
- `sequence` (integer, optional)
- `sources` (list of v4.AgentTrajectoryEventSource, optional)
- `trajectory_uuid` (string, optional)
- `updated_at` (string, optional)
- `uuid` (string, optional)

### 201

Created

- `agent_uuid` (string, optional)
- `content` (string, optional)
- `context` (v4.AgentTrajectoryEventContext, optional)
- `created_at` (string, optional)
- `event_id` (string, optional)
- `event_type` (enum, optional)
  - Allowed values: `input_reference`, `observation`, `decision`, `tool_call`, `tool_result`, `artifact`, `checkpoint`, `feedback`, `correction`, `reflection`, `verification`
- `failed_at` (string, optional)
- `metadata` (map from string to any, optional)
- `occurred_at` (string, optional)
- `processed_at` (string, optional)
- `processing_state` (enum, optional)
  - Allowed values: `pending`, `processing`, `processed`, `failed`
- `sequence` (integer, optional)
- `sources` (list of v4.AgentTrajectoryEventSource, optional)
- `trajectory_uuid` (string, optional)
- `updated_at` (string, optional)
- `uuid` (string, optional)

## Errors

### 400 Bad Request Error

Bad Request

- `error` (v4.ErrorBody, optional)

### 403 Forbidden Error

Forbidden

- `error` (v4.ErrorBody, optional)

### 409 Conflict Error

Conflict

- `error` (v4.ErrorBody, optional)

### 503 Service Unavailable Error

Service Unavailable

- `error` (v4.ErrorBody, optional)

## Types

### v4.AgentTrajectoryEventContext

- `artifacts` (list of v4.AgentTrajectoryResourceRef, optional)
- `environments` (list of v4.AgentTrajectoryResourceRef, optional)
- `model` (v4.AgentTrajectoryResourceRef, optional)
- `tools` (list of v4.AgentTrajectoryResourceRef, optional)
- `verification` (string, optional)

### v4.AgentTrajectoryEventSource

- `kind` (string, required)
- `uuid` (string, required)
- `copy_mode` (enum, optional)
  - Allowed values: `reference`, `copied`
- `retention_mode` (enum, optional)
  - Allowed values: `delete_with_source`, `keep`

### v4.ErrorBody

- `code` (string, optional)
- `details` (map from string to any, optional)
- `message` (string, optional)
- `param` (string, optional)
- `request_id` (string, optional)

### v4.AgentTrajectoryResourceRef

- `name` (string, required)
- `version` (string, optional)

## Examples

### Example 1

**Request**

```json
{
  "event_type": "input_reference"
}
```

**Response**

```json
{
  "agent_uuid": "string",
  "content": "string",
  "context": {
    "artifacts": [
      {
        "name": "string",
        "version": "string"
      }
    ],
    "environments": [
      {
        "name": "string",
        "version": "string"
      }
    ],
    "model": {
      "name": "string",
      "version": "string"
    },
    "tools": [
      {
        "name": "string",
        "version": "string"
      }
    ],
    "verification": "string"
  },
  "created_at": "string",
  "event_id": "string",
  "event_type": "input_reference",
  "failed_at": "string",
  "metadata": {},
  "occurred_at": "string",
  "processed_at": "string",
  "processing_state": "pending",
  "sequence": 1,
  "sources": [
    {
      "kind": "string",
      "uuid": "string",
      "copy_mode": "reference",
      "retention_mode": "delete_with_source"
    }
  ],
  "trajectory_uuid": "string",
  "updated_at": "string",
  "uuid": "string"
}
```

### Example 2

**Request**

```json
{
  "event_type": "input_reference"
}
```

**Response**

```json
{
  "agent_uuid": "string",
  "content": "string",
  "context": {
    "artifacts": [
      {
        "name": "string",
        "version": "string"
      }
    ],
    "environments": [
      {
        "name": "string",
        "version": "string"
      }
    ],
    "model": {
      "name": "string",
      "version": "string"
    },
    "tools": [
      {
        "name": "string",
        "version": "string"
      }
    ],
    "verification": "string"
  },
  "created_at": "string",
  "event_id": "string",
  "event_type": "input_reference",
  "failed_at": "string",
  "metadata": {},
  "occurred_at": "string",
  "processed_at": "string",
  "processing_state": "pending",
  "sequence": 1,
  "sources": [
    {
      "kind": "string",
      "uuid": "string",
      "copy_mode": "reference",
      "retention_mode": "delete_with_source"
    }
  ],
  "trajectory_uuid": "string",
  "updated_at": "string",
  "uuid": "string"
}
```