---
title: "Create spans"
method: POST
path: "/v1/spans"
tags: ["Ingestion"]
---

# Create spans

`POST /v1/spans`

## Request

- Base URL: `https://api.lmnr.ai`
- URL: `https://api.lmnr.ai/v1/spans`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Ingests a batch of spans using Laminar's JSON span format.

## Request body

- CreateSpanRequest[]
  - `name` string, required
  - `spanType` 'DEFAULT' | 'LLM' | 'EXECUTOR' | 'EVALUATOR' | 'EVALUATION' | 'TOOL' | 'CACHED' | 'null', nullable: Note: The backend may still accept `PIPELINE` and `HUMAN_EVALUATOR`, but they are undocumented, and should not be used.
  - `startTime` string, date-time, required
  - `endTime` string, date-time, required
  - `input` unknown
  - `output` unknown
  - `attributes` object, nullable
  - `traceId` string, uuid, required
  - `spanId` string, uuid, required
  - `parentSpanId` string, uuid

## Response `200`

Spans accepted.

- CreateSpanResponse[]
  - `spanId` string, uuid, required
  - `traceId` string, uuid, required

## Other responses

- `400`: Invalid request.
- `401`: Missing or invalid API key.
- `413`: The request exceeds the configured HTTP payload limit.

---

[API](https://skmtc.dev/laminar-sh/apis/laminar-api.md) - [All operations](https://skmtc.dev/laminar-sh/apis/laminar-api/llms.txt) - [OpenAPI document](https://skmtc.dev/laminar-sh/apis/laminar-api/revisions/8a7a08163846?raw)
