---
title: "Edit Trace"
method: PATCH
path: "/simple/traces/{trace_id}"
tags: ["Traces"]
---

# Edit Trace

`PATCH /simple/traces/{trace_id}`

Update an existing "simple" trace.

Supplied fields overwrite the existing trace. Fields not present
in the request body are left unchanged. `data` is required (the
payload being recorded); `tags`, `meta`, `references`, and
`links` are optional.

This endpoint is intended for annotations and feedback entries,
where the `data.outputs` is the part that typically gets revised.
For span-level edits, use `PUT /tracing/traces/{trace_id}`.

## Path parameters

- `trace_id` string, required

## Request body

- SimpleTraceEditRequest — Request body for editing an existing "simple" trace.
  - `trace` SimpleTraceEdit, required
    - `tags` object, nullable
    - `meta` object, nullable
    - `data` object, required
    - `references` SimpleTraceReferences
      - `query` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `query_variant` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `query_revision` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `testset` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `testset_variant` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `testset_revision` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `application` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `application_variant` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `application_revision` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `evaluator` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `evaluator_variant` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `evaluator_revision` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `environment` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `environment_variant` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `environment_revision` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `testcase` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `selector` object, nullable
    - `links` union
      - object
      - OTelLinkInput[]
        - `span_id` string, nullable
        - `trace_id` string, nullable
        - `attributes` object, nullable

## Response `200`

Successful Response

- SimpleTraceResponse — Response from a single-trace create/fetch/edit.
  - `count` integer — `1` if the trace was returned, `0` otherwise.
  - `trace` SimpleTrace
    - `created_at` string, date-time, nullable
    - `updated_at` string, date-time, nullable
    - `deleted_at` string, date-time, nullable
    - `created_by_id` string, uuid, nullable
    - `updated_by_id` string, uuid, nullable
    - `deleted_by_id` string, uuid, nullable
    - `span_id` string, nullable
    - `trace_id` string, nullable
    - `attributes` object, nullable
    - `origin` 'custom' | 'human' | 'auto'
    - `kind` 'adhoc' | 'eval' | 'play'
    - `channel` 'otlp' | 'web' | 'sdk' | 'api'
    - `tags` object, nullable
    - `meta` object, nullable
    - `data` object, required
    - `references` SimpleTraceReferences, required
      - `query` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `query_variant` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `query_revision` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `testset` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `testset_variant` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `testset_revision` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `application` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `application_variant` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `application_revision` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `evaluator` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `evaluator_variant` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `evaluator_revision` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `environment` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `environment_variant` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `environment_revision` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `testcase` Reference
        - `version` string, nullable
        - `slug` string, nullable
        - `id` string, uuid, nullable
      - `selector` object, nullable
    - `links` union, required
      - object
      - OTelLinkOutput[]
        - `span_id` string, nullable
        - `trace_id` string, nullable
        - `attributes` object, nullable

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/agenta-ai/apis/agenta-api.md) · [All operations](https://skmtc.net/agenta-ai/apis/agenta-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/agenta-ai/agenta-api/versions/2e1079696f45/schema)
