> This page is for version v4 (default).
> For other versions, use one of these documentation indexes:
> - v4 (default): https://help.getzep.com/v4/llms.txt
> - v3: https://help.getzep.com/v3/llms.txt
> - v2: https://help.getzep.com/v2/llms.txt

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

# Delete Agent Trace

DELETE https://api.getzep.com/api/v4/agents/{agent_uuid}/traces/{trace_uuid}
Content-Type: application/json

Reference: https://help.getzep.com/sdk-reference/agent/traces/delete

## 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
- `trace_uuid` (string, required) — Trace UUID

### Body (application/json)

This endpoint expects a v4.DeleteAgentTraceRequest.

- `expected_revision` (integer, required)

## Response

### 202

Accepted

- `affected_skills` (integer, optional)
- `deletion_uuid` (string, optional)
- `skill_repair_task` (v4.Task, optional)
- `summary_repair_task` (v4.Task, optional)
- `trace` (v4.AgentTrace, optional)

## Types

### v4.Task

- `completed_at` (string, optional) — The time the task reached a terminal status; absent while it is still in progress.
- `created_at` (string, optional) — The time the task was created.
- `error` (v4.ErrorBody, optional) — The error that caused the task to fail; also present on a partial task when the worker can name a single cause.
- `progress` (v4.TaskProgress, optional) — The last processing stage a worker reported for this task. It is not cleared when the task finishes, so a completed task may still show its final stage.
- `result` (v4.TaskResult, optional) — Operation-specific output populated once the task reaches succeeded or partial, such as identifiers the operation could not return synchronously.
- `started_at` (string, optional) — The time a worker began processing the task; absent until then.
- `status` (enum, optional) — The task's current state: pending, processing, succeeded, partial, or failed.
  - Allowed values: `pending`, `processing`, `succeeded`, `partial`, `failed`
- `type` (string, optional) — The kind of asynchronous operation the task represents.
- `updated_at` (string, optional) — The time the task was last updated.
- `uuid` (string, optional) — The unique identifier of the task, used to poll its status.

### v4.AgentTrace

- `abandoned_at` (string, optional) — The time the Trace was abandoned.
- `agent_uuid` (string, optional) — The owning Agent UUID.
- `attempt_family_uuid` (string, optional) — The stable retry-family identity shared with declared child attempts.
- `closed_at` (string, optional) — The time the Trace closed.
- `created_at` (string, optional) — The time the Trace was created.
- `internal` (v4.AgentTraceInternal, optional) — Server-owned fields that are not part of the top-level capture contract.
- `learn_from` (boolean, optional) — Whether eligible evidence may participate in learning.
- `learn_from_reason` (string, optional) — Why the Trace is not eligible for learning.
- `metadata` (map from string to any, optional) — Developer metadata used for exact containment filters.
- `objective` (string, optional) — The task-instance objective captured for this attempt.
- `outcome` (enum, optional) — The caller-owned task outcome.
  - Allowed values: `succeeded`, `failed`, `partial`, `abandoned`, `unknown`
- `parent_trace_uuid` (string, optional) — The parent attempt when this Trace is a retry.
- `revision` (integer, optional) — The revision required by the next update or lifecycle command.
- `source` (v4.AgentTraceSource, optional) — The source record for an imported Trace.
- `status` (enum, optional) — The current lifecycle state.
  - Allowed values: `open`, `closing`, `closed`, `abandoned`, `deleted`
- `task_family` (string, optional) — The optional opaque task-family classification slug.
- `task_family_inference` (v4.AgentTraceTaskFamilyInference, optional) — The latest task-family inference outcome. Absent when inference never ran for this Trace.
- `task_family_source` (string, optional) — Who supplied task_family: the caller (declared), an import rule (import_rule), or the service classifier (inferred).
- `trace_id` (string, optional) — The optional customer-assigned identifier, unique within the Agent.
- `updated_at` (string, optional) — The time the Trace was last updated.
- `uuid` (string, optional) — The stable Trace UUID.
- `verification` (enum, optional) — The strength of the accepted outcome verification.
  - Allowed values: `none`, `agent`, `tool`, `customer`, `external`

### v4.ErrorBody

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

### v4.TaskProgress

- `stage` (string, optional) — The most recent processing stage reported by the worker handling the task.

### v4.TaskResult

- `content_policy` (v4.TaskResultContentPolicy, optional) — The content policy outcome of the task.
- `edge_uuid` (string, optional) — The UUID of the edge that the task wrote.
- `edges` (list of v4.TaskResultEdge, optional) — The edges that the task wrote.
- `episode_uuid` (string, optional) — The UUID of the episode that the task added.
- `episodes` (list of v4.TaskResultEpisode, optional) — The content policy outcome of each message that the task added.
- `hyperedge_uuid` (string, optional) — The UUID of the hyperedge that the task created.
- `skill_uuid` (string, optional) — The UUID of the skill that the task imported.
- `source_node_uuid` (string, optional) — The UUID of the source node of the edge that the task wrote.
- `target_node_uuid` (string, optional) — The UUID of the target node of the edge that the task wrote.

### v4.AgentTraceInternal

- `assertion_uuid` (string, optional)
- `closing_sequence` (integer, optional)
- `current_summary_version` (integer, optional)
- `last_task_uuid` (string, optional)
- `next_sequence` (integer, optional)
- `processing_state` (enum, optional)
  - Allowed values: `idle`, `pending`, `processing`, `failed`

### v4.AgentTraceSource

- `connection_uuid` (string, optional)
- `import_uuid` (string, optional)
- `imported_at` (string, optional)
- `kind` (enum, optional)
  - Allowed values: `trace_import`
- `provider` (string, optional)
- `provider_project_id` (string, optional)
- `run_uuid` (string, optional)
- `scores` (map from string to double, optional)
- `source_changed` (boolean, optional) — SourceChanged reports whether the provider trace changed after import.
- `source_revision` (string, optional)
- `source_url` (string, optional)
- `trace_ended_at` (string, optional)
- `trace_id` (string, optional)
- `trace_started_at` (string, optional)

### v4.AgentTraceTaskFamilyInference

- `assigned_at` (string, optional) — The time the outcome was recorded.
- `classifier_version` (string, optional) — The classifier version that produced the outcome.
- `confidence` (double, optional) — The classifier confidence of the accepted or top candidate.
- `descriptor_version` (integer, optional) — The descriptor set version the classifier ran against.
- `learning_reusable` (boolean, optional) — Whether the classifier marked the Trace reusable for learning.
- `state` (string, optional) — The inference state: pending, assigned, or unassigned.

### v4.TaskResultContentPolicy

- `category_keys` (list of string, optional) — The keys of the categories with a matched rule.
- `dropped_count` (integer, optional) — The number of derived candidates of the episode that were dropped.
- `failed_count` (integer, optional) — The number of episodes in the batch whose evaluation failed.
- `retained_count` (integer, optional) — The number of derived candidates of the episode that were published to the graph.
- `revision` (integer, optional) — The project revision number of the policy that the graph bound.
- `status` (enum, optional) — The evaluation status of the episode. pending means the evaluation has not finished, complete means every candidate was evaluated, and failed means ingestion retries were exhausted.
  - Allowed values: `pending`, `complete`, `failed`
- `violated` (boolean, optional) — Whether at least one derived candidate of the episode matched a rule.
- `violated_count` (integer, optional) — The number of episodes in the batch that a content policy flagged.

### v4.TaskResultEdge

- `edge_uuid` (string, optional) — The UUID of the edge.
- `source_node_uuid` (string, optional) — The UUID of the source node of the edge.
- `target_node_uuid` (string, optional) — The UUID of the target node of the edge.

### v4.TaskResultEpisode

- `content_policy` (v4.TaskResultContentPolicy, optional) — The content policy state of the episode.
- `episode_uuid` (string, optional) — The UUID of the episode of the message.

## Examples

**Request**

```json
{
  "expected_revision": 1
}
```

**Response**

```json
{
  "affected_skills": 1,
  "deletion_uuid": "string",
  "skill_repair_task": {
    "completed_at": "string",
    "created_at": "string",
    "error": {
      "code": "string",
      "details": {},
      "message": "string",
      "param": "string",
      "request_id": "string"
    },
    "progress": {
      "stage": "string"
    },
    "result": {
      "content_policy": {
        "category_keys": [
          "health"
        ],
        "dropped_count": 0,
        "failed_count": 1,
        "retained_count": 7,
        "revision": 3,
        "status": "complete",
        "violated": false,
        "violated_count": 2
      },
      "edge_uuid": "7a1f3c2e-4b5d-4e6f-8a9b-0c1d2e3f4a5b",
      "edges": [
        {
          "edge_uuid": "7a1f3c2e-4b5d-4e6f-8a9b-0c1d2e3f4a5b",
          "source_node_uuid": "b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e",
          "target_node_uuid": "c3d4e5f6-a7b8-4c9d-8e1f-2a3b4c5d6e7f"
        }
      ],
      "episode_uuid": "f6a7b8c9-d0e1-4f2a-9b4c-5d6e7f8091a2",
      "episodes": [
        {
          "content_policy": {
            "category_keys": [
              "health"
            ],
            "dropped_count": 0,
            "failed_count": 1,
            "retained_count": 7,
            "revision": 3,
            "status": "complete",
            "violated": false,
            "violated_count": 2
          },
          "episode_uuid": "f6a7b8c9-d0e1-4f2a-9b4c-5d6e7f8091a2"
        }
      ],
      "hyperedge_uuid": "d4e5f6a7-b8c9-4d0e-9f2a-3b4c5d6e7f80",
      "skill_uuid": "e5f6a7b8-c9d0-4e1f-8a3b-4c5d6e7f8091",
      "source_node_uuid": "b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e",
      "target_node_uuid": "c3d4e5f6-a7b8-4c9d-8e1f-2a3b4c5d6e7f"
    },
    "started_at": "string",
    "status": "pending",
    "type": "string",
    "updated_at": "string",
    "uuid": "string"
  },
  "summary_repair_task": {
    "completed_at": "string",
    "created_at": "string",
    "error": {
      "code": "string",
      "details": {},
      "message": "string",
      "param": "string",
      "request_id": "string"
    },
    "progress": {
      "stage": "string"
    },
    "result": {
      "content_policy": {
        "category_keys": [
          "health"
        ],
        "dropped_count": 0,
        "failed_count": 1,
        "retained_count": 7,
        "revision": 3,
        "status": "complete",
        "violated": false,
        "violated_count": 2
      },
      "edge_uuid": "7a1f3c2e-4b5d-4e6f-8a9b-0c1d2e3f4a5b",
      "edges": [
        {
          "edge_uuid": "7a1f3c2e-4b5d-4e6f-8a9b-0c1d2e3f4a5b",
          "source_node_uuid": "b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e",
          "target_node_uuid": "c3d4e5f6-a7b8-4c9d-8e1f-2a3b4c5d6e7f"
        }
      ],
      "episode_uuid": "f6a7b8c9-d0e1-4f2a-9b4c-5d6e7f8091a2",
      "episodes": [
        {
          "content_policy": {
            "category_keys": [
              "health"
            ],
            "dropped_count": 0,
            "failed_count": 1,
            "retained_count": 7,
            "revision": 3,
            "status": "complete",
            "violated": false,
            "violated_count": 2
          },
          "episode_uuid": "f6a7b8c9-d0e1-4f2a-9b4c-5d6e7f8091a2"
        }
      ],
      "hyperedge_uuid": "d4e5f6a7-b8c9-4d0e-9f2a-3b4c5d6e7f80",
      "skill_uuid": "e5f6a7b8-c9d0-4e1f-8a3b-4c5d6e7f8091",
      "source_node_uuid": "b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e",
      "target_node_uuid": "c3d4e5f6-a7b8-4c9d-8e1f-2a3b4c5d6e7f"
    },
    "started_at": "string",
    "status": "pending",
    "type": "string",
    "updated_at": "string",
    "uuid": "string"
  },
  "trace": {
    "abandoned_at": "string",
    "agent_uuid": "string",
    "attempt_family_uuid": "string",
    "closed_at": "string",
    "created_at": "string",
    "internal": {
      "assertion_uuid": "string",
      "closing_sequence": 1,
      "current_summary_version": 1,
      "last_task_uuid": "string",
      "next_sequence": 1,
      "processing_state": "idle"
    },
    "learn_from": true,
    "learn_from_reason": "string",
    "metadata": {},
    "objective": "string",
    "outcome": "succeeded",
    "parent_trace_uuid": "string",
    "revision": 1,
    "source": {
      "connection_uuid": "string",
      "import_uuid": "string",
      "imported_at": "string",
      "kind": "trace_import",
      "provider": "string",
      "provider_project_id": "string",
      "run_uuid": "string",
      "scores": {},
      "source_changed": false,
      "source_revision": "string",
      "source_url": "string",
      "trace_ended_at": "string",
      "trace_id": "string",
      "trace_started_at": "string"
    },
    "status": "open",
    "task_family": "string",
    "task_family_inference": {
      "assigned_at": "string",
      "classifier_version": "string",
      "confidence": 1.1,
      "descriptor_version": 1,
      "learning_reusable": true,
      "state": "string"
    },
    "task_family_source": "string",
    "trace_id": "string",
    "updated_at": "string",
    "uuid": "string",
    "verification": "none"
  }
}
```