> ## 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.

# Bulk Delete Traces

> Bulk-delete traces matching the same filters as ``GET ``.

Strategy: select the matching trace ids first, then DELETE both
tables by id. Two queries instead of a join keeps the SQL portable
across PG and SQLite and avoids ``DELETE ... USING`` syntax that
SQLite does not support.



## OpenAPI

````yaml /standalone/openapi.json delete /admin/api/v1/traces
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:
    delete:
      tags:
        - Traces
      summary: Bulk Delete Traces
      description: |-
        Bulk-delete traces matching the same filters as ``GET ``.

        Strategy: select the matching trace ids first, then DELETE both
        tables by id. Two queries instead of a join keeps the SQL portable
        across PG and SQLite and avoids ``DELETE ... USING`` syntax that
        SQLite does not support.
      operationId: bulk_delete_traces_admin_api_v1_traces_delete
      parameters:
        - name: started_after
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: Started After
        - name: started_before
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: Started Before
        - name: model
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Model
        - name: status
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Status
        - name: user_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: User Id
        - name: session_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Session Id
        - name: name_contains
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Name Contains
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandaloneTraceBulkDeleteResult'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    StandaloneTraceBulkDeleteResult:
      properties:
        deletedTraces:
          type: integer
          title: Deletedtraces
        deletedSpans:
          type: integer
          title: Deletedspans
      type: object
      required:
        - deletedTraces
        - deletedSpans
      title: StandaloneTraceBulkDeleteResult
      description: |-
        Body of ``DELETE /admin/api/v1/traces`` (bulk by filter).

        The filter shape mirrors :class:`StandaloneTraceListFilters` (minus
        ``limit`` / ``cursor``); the response counts what was removed.
    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

````