> ## Documentation Index
> Fetch the complete documentation index at: https://docs.idun-group.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete Trace

> Delete a single trace and cascade to its spans.

The trace row's PK is composite ``(started_at, otel_trace_id)`` so
we look it up first to grab ``started_at``, then delete by full PK.
Spans match on the 8-byte trace id slice. The 404 path leaves both
tables untouched.



## OpenAPI

````yaml /standalone/openapi.json delete /admin/api/v1/traces/{otel_trace_id}
openapi: 3.1.0
info:
  title: Idun Agent Engine Server
  description: A production-ready server for conversational AI agents
  version: 0.6.1
servers: []
security: []
tags:
  - name: Runtime
    description: >-
      Public agent run endpoints, engine operations, and chat-channel webhooks.
      SSE streaming via the AG-UI protocol.
  - name: Agent Configuration
    description: >-
      Singleton admin endpoints for the agent, prompts, memory, guardrails, and
      onboarding wizard.
  - name: Auth & SSO
    description: >-
      Login, sessions, password change, SSO config, and the public SSO discovery
      endpoint.
  - name: Integrations & Tools
    description: MCP server registry and external integration credentials.
  - name: Observability
    description: Tracing/logging provider configuration.
  - name: Traces
    description: >-
      Trace and span storage admin endpoints — list, detail, delete, and
      pipeline-health for the standalone trace store.
  - name: Dashboard
    description: >-
      Operator dashboard widgets — KPIs, time-series, top errors, and
      configuration summary.
paths:
  /admin/api/v1/traces/{otel_trace_id}:
    delete:
      tags:
        - Traces
      summary: Delete Trace
      description: |-
        Delete a single trace and cascade to its spans.

        The trace row's PK is composite ``(started_at, otel_trace_id)`` so
        we look it up first to grab ``started_at``, then delete by full PK.
        Spans match on the 8-byte trace id slice. The 404 path leaves both
        tables untouched.
      operationId: delete_trace_admin_api_v1_traces__otel_trace_id__delete
      parameters:
        - name: otel_trace_id
          in: path
          required: true
          schema:
            type: string
            title: Otel Trace Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandaloneTraceDeleteResult'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    StandaloneTraceDeleteResult:
      properties:
        deleted:
          type: boolean
          const: true
          title: Deleted
          default: true
        deletedSpans:
          type: integer
          title: Deletedspans
      type: object
      required:
        - deletedSpans
      title: StandaloneTraceDeleteResult
      description: |-
        Body of a single ``DELETE /admin/api/v1/traces/{id}`` response.

        Reports the deleted trace plus the cascaded span count so the UI
        can show "removed N spans" without a follow-up read.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````