---
title: "Post an org workload's spans"
method: POST
path: "/code/runtime/traces"
---

# Post an org workload's spans

`POST /code/runtime/traces`

## Request

- Base URL: `https://api.caveman.so/api/v1`
- URL: `https://api.caveman.so/api/v1/code/runtime/traces`
- Auth: HTTP bearer

POST /api/v1/code/runtime/traces on the Caveman Cloud control plane. Requires a Caveman Code runtime token (Authorization: Bearer ccrt_...), minted by POST /code/runtimes/{runtimeId}/token. Not exposed to autonomous agents: Not RBAC-guarded — authenticated by a Caveman Code runtime token, and only for an org workload's session on that runtime's computer: an automation run's record when it ends, an Agents API or automation session's spans (ADR 0134). Agents authenticate through a scoped control-plane session and never touch these directly.

## Request body

- object
  - `resourceSpans` unknown[], required
    - unknown

## Response `200`

Stored

- object
  - `accepted` integer, required
  - `spans` integer, required
  - `project_id` string, uuid, required

## Other responses

- `400`: Not OTLP/JSON, or spans of more than one session.
- `401`: A runtime token is required.
- `403`: A person's chat sends no traces (cave_code_session_personal).
- `409`: The session is on another computer, or its service account has no project.
- `2XX`: Successful response. Exact status depends on synchronous or durable delivery outcome.
- `4XX`: Structured failure. `error.code` is stable; `error.request_id` is echoed in the x-cave-request-id header.
- `5XX`: Structured failure. `error.code` is stable; `error.request_id` is echoed in the x-cave-request-id header.

---

[API](https://skmtc.dev/caveman/apis/caveman-cloud-api.md) - [All operations](https://skmtc.dev/caveman/apis/caveman-cloud-api/llms.txt) - [OpenAPI document](https://skmtc.dev/caveman/apis/caveman-cloud-api/revisions/508312d01cfc?raw)
