---
title: "Create spans"
method: POST
path: "/v1/projects/{project_identifier}/spans"
tags: ["spans"]
---

# Create spans

`POST /v1/projects/{project_identifier}/spans`

Submit spans to be inserted into a project. If any spans are invalid or duplicates, no spans will be inserted.

## Path parameters

- `project_identifier` string, required — The project identifier: either project ID or project name. If using a project name, it cannot contain slash (/), question mark (?), or pound sign (#) characters.

## Request body

- CreateSpansRequestBody
  - `data` Span[], required
    - `id` string — Span Global ID, distinct from the OpenTelemetry span ID
    - `name` string, required — Name of the span operation
    - `context` SpanContext, required
      - `trace_id` string, required — OpenTelemetry trace ID
      - `span_id` string, required — OpenTelemetry span ID
    - `span_kind` string, required — Type of work that the span encapsulates
    - `parent_id` string, nullable — OpenTelemetry span ID of the parent span
    - `start_time` string, date-time, required — Start time of the span (must be timezone-aware)
    - `end_time` string, date-time, required — End time of the span (must be timezone-aware)
    - `status_code` string, required — Status code of the span
    - `status_message` string — Status message
    - `attributes` object — Span attributes
    - `events` SpanEvent[] — Span events
      - `name` string, required — Name of the event
      - `timestamp` string, date-time, required — When the event occurred (must be timezone-aware)
      - `attributes` object — Event attributes

## Response `202`

Successful Response

- CreateSpansResponseBody
  - `total_received` integer, required — Total number of spans received
  - `total_queued` integer, required — Number of spans successfully queued for insertion

## Other responses

- `400` — Bad Request
- `403` — Forbidden
- `404` — Not Found
- `422` — Validation Error

---

[API](https://skmtc.net/arize-ai/apis/arize-phoenix-rest-api.md) · [All operations](https://skmtc.net/arize-ai/apis/arize-phoenix-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/arize-ai/arize-phoenix-rest-api/versions/a14d8ad6f708/schema)
