---
title: "Bulk Delete Traces"
method: DELETE
path: "/admin/api/v1/traces"
tags: ["Traces"]
---

# Bulk Delete Traces

`DELETE /admin/api/v1/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.

## Query parameters

- `started_after` string, date-time, nullable
- `started_before` string, date-time, nullable
- `model` string, nullable
- `status` string, nullable
- `user_id` string, nullable
- `session_id` string, nullable
- `name_contains` string, nullable

## Response `200`

Successful Response

- StandaloneTraceBulkDeleteResult — 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.
  - `deletedTraces` integer, required
  - `deletedSpans` integer, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/idun-group/apis/idun-agent-engine-server.md) · [All operations](https://skmtc.net/idun-group/apis/idun-agent-engine-server/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/idun-group/idun-agent-engine-server/revisions/8909cd73cc1c/schema)
