---
title: "Start a trace [write]"
method: POST
path: "/traces"
tags: ["traces"]
---

# Start a trace \[write\]

`POST /traces`

## Request

- Base URL: `https://api.agentsky.dev/v1`
- URL: `https://api.agentsky.dev/v1/traces`
- Auth: HTTP bearer

A trace correlates one task across local agents and platform sessions. It holds metadata, plus redacted content where a grant allows it, and is deleted 30 days after creation with everything admitted to it. It is never exported. Returns 404 when the TASK_TRACES switch is off for the workspace and 503 not_migrated before the tables exist.

## Request body

- object
  - `name` string

## Response `201`

Created

- object
  - `trace` TaskTrace, required
    - `id` string, required: trc_… — the public id
    - `name` string, nullable, required
    - `created_at` string, date-time, required
    - `expires_at` string, date-time, required: 30 days after creation; the trace and its events are deleted then

## Other responses

- `default`: Error — { error: { code, message } }

## Changes

- **2026-11-02** `e5e8f0229a99`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/agentsky/apis/agentsky-developer-api/changes/traces/post.md)

---

[API](https://skmtc.dev/agentsky/apis/agentsky-developer-api.md) - [All operations](https://skmtc.dev/agentsky/apis/agentsky-developer-api/llms.txt) - [OpenAPI document](https://skmtc.dev/agentsky/apis/agentsky-developer-api/revisions/0d435187cd55?raw)
