> ## Documentation Index
> Fetch the complete documentation index at: https://laminar.sh/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create spans

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



## OpenAPI

````yaml /openapi/openapi.yaml post /v1/spans
openapi: 3.1.0
info:
  title: Laminar API
  version: 1.0.0
  description: Public HTTP API for ingesting and managing data in a Laminar project.
  license:
    name: Apache 2.0
    identifier: Apache-2.0
servers:
  - url: https://api.lmnr.ai
    description: Laminar Cloud
security:
  - projectApiKey: []
tags:
  - name: Ingestion
    description: Send telemetry data to Laminar.
  - name: Traces
    description: Update trace data after ingestion.
  - name: SQL
    description: Query project data with read-only SQL.
  - name: Projects
    description: Resolve project information.
  - name: Datasets
    description: Read datasets and add datapoints.
  - name: Evaluations
    description: Create evaluation runs and record their results.
  - name: Labeling queues
    description: Add items to labeling queues.
  - name: Signals
    description: Manage automated evaluations of project traces.
  - name: LLM profiles
    description: Configure workspace LLM credentials and models for self-hosted Signals.
paths:
  /v1/spans:
    post:
      tags:
        - Ingestion
      summary: Create spans
      description: Ingests a batch of spans using Laminar's JSON span format.
      operationId: createSpans
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/CreateSpanRequest'
      responses:
        '200':
          description: Spans accepted.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CreateSpanResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
      security:
        - projectApiKey: []
        - ingestApiKey: []
components:
  schemas:
    CreateSpanRequest:
      type: object
      required:
        - name
        - startTime
        - endTime
        - traceId
        - spanId
      properties:
        name:
          type: string
        spanType:
          type:
            - string
            - 'null'
          description: >-
            Note: The backend may still accept `PIPELINE` and `HUMAN_EVALUATOR`,
            but they are undocumented, and should not be used.
          enum:
            - DEFAULT
            - LLM
            - EXECUTOR
            - EVALUATOR
            - EVALUATION
            - TOOL
            - CACHED
            - null
        startTime:
          type: string
          format: date-time
        endTime:
          type: string
          format: date-time
        input:
          $ref: '#/components/schemas/JsonValue'
        output:
          $ref: '#/components/schemas/JsonValue'
        attributes:
          type:
            - object
            - 'null'
          additionalProperties: true
        traceId:
          $ref: '#/components/schemas/Uuid'
        spanId:
          $ref: '#/components/schemas/Uuid'
        parentSpanId:
          oneOf:
            - $ref: '#/components/schemas/Uuid'
            - type: 'null'
    CreateSpanResponse:
      type: object
      required:
        - spanId
        - traceId
      properties:
        spanId:
          $ref: '#/components/schemas/Uuid'
        traceId:
          $ref: '#/components/schemas/Uuid'
    JsonValue: {}
    Uuid:
      type: string
      format: uuid
    Error:
      oneOf:
        - type: object
          properties:
            error:
              type: string
          required:
            - error
        - type: string
  responses:
    BadRequest:
      description: Invalid request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Missing or invalid API key.
    PayloadTooLarge:
      description: The request exceeds the configured HTTP payload limit.
  securitySchemes:
    projectApiKey:
      type: http
      scheme: bearer
      bearerFormat: Project API key
      description: A Laminar project API key.
    ingestApiKey:
      type: http
      scheme: bearer
      bearerFormat: Ingest-only API key
      description: A project API key restricted to ingestion operations.

````