Trace deletions

Delete traces (async)

Changed on

Permanently deletes the traces selected by traces, together with everything derived from them: their spans, scores and annotations, search indexes, and the analyses of the sessions they belong to. The deletion runs in the background; poll it with getTraceDeletion until status is completed. Deletion cannot be undone. Use previewTraceDeletion first to see how many traces a selector matches.

post/v1/projects/{projectSlug}/trace-deletions

Request

  • Base URL
    https://api.latitude.so
  • Auth
    HTTP bearer

Path parameters

projectSlugstring required

Project slug (human-readable identifier)

Project slug (human-readable identifier). The CLI can also read this from the LATITUDE_PROJECT_SLUG environment variable.

Request body

includeDatasetRowsboolean

Also delete dataset rows that were copied from the deleted traces, in every dataset of the organization, including their earlier versions. Defaults to false, which keeps dataset rows. Ignored by previewTraceDeletion.

Response

Trace deletion requested

idstring required

Trace deletion identifier. Use it to poll the deletion with getTraceDeletion.

status'pending' | 'running' | 'completed' | 'failed' required

pending until work starts, running while traces are being deleted, then completed or failed. Deletion is irreversible: traces deleted before a failure stay deleted.

filtersobject required

The trace filter the deletion selects with, including any explicit trace ids as a traceId condition. Only traces that started before createdAt are deleted.

includeDatasetRowsboolean required

Whether dataset rows copied from the deleted traces are deleted too.

matchedTraceCountinteger required

Traces deleted so far. Final once status is completed or failed.

deletedRecordCountinteger required

Records deleted so far across the traces, their spans, and everything derived from them (scores, annotations, search indexes, session analyses).

errorstring nullable required

Why the deletion failed. null unless status is failed.

createdAtstring required

ISO-8601 time the deletion was requested.

startedAtstring nullable required

ISO-8601 time work started, or null while pending.

completedAtstring nullable required

ISO-8601 time the deletion completed or failed, or null while it is still in progress.

Changes