Skip to main content
POST
/
api
/
public
/
v2
/
traces
/
{trace_id}
/
close
Close Trace
curl --request POST \
  --url https://api.promptlayer.com/api/public/v2/traces/{trace_id}/close \
  --header 'X-API-KEY: <api-key>'
{
  "success": true,
  "closure": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "workspace_id": 1,
    "trace_id": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6",
    "status": "closed",
    "created_at": "2026-06-06T18:00:00Z",
    "updated_at": "2026-06-06T18:00:00Z"
  }
}
Marks a trace as closed, preventing any further spans from being written to it. Once closed, subsequent calls to Create Spans Bulk or Ingest Traces (OTLP) that include spans for this trace will have those spans rejected.

Behavior Notes

  • Closing is permanent — there is no re-open operation.
  • If the trace is already closed, the endpoint returns 409 Conflict.
  • If no spans exist for the given trace_id in your workspace, the endpoint returns 404 Not Found.

Authorizations

X-API-KEY
string
header
required

Path Parameters

trace_id
string
required

The trace ID to close.

Response

Trace successfully closed.

success
boolean
closure
object