---
title: "Close Trace"
method: POST
path: "/api/public/v2/traces/{trace_id}/close"
tags: ["tracking"]
---

# Close Trace

`POST /api/public/v2/traces/{trace_id}/close`

Marks a trace as closed, preventing any further span ingestion for that trace. Once closed, subsequent calls to `/spans-bulk` or `/v1/traces` that include spans for this trace will have those spans rejected.

## Path parameters

- `trace_id` string, required

## Response `201`

Trace successfully closed.

- object
  - `success` boolean
  - `closure` object
    - `id` string, uuid
    - `workspace_id` integer
    - `trace_id` string
    - `status` 'closed'
    - `created_at` string, date-time
    - `updated_at` string, date-time

## Other responses

- `401` — Unauthorized - missing or invalid API key.
- `404` — Not found - requested resource does not exist or is not accessible.
- `409` — Trace is already closed.
- `422` — Validation error - request parameters or body are invalid.
- `500` — Internal server error.

---

[API](https://skmtc.dev/promptlayer/apis/promptlayer-api.md) · [All operations](https://skmtc.dev/promptlayer/apis/promptlayer-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/promptlayer/promptlayer-api/revisions/a23093a0a506/schema)
