Ingest Spans
Ingest spans into the tracing backend.
Use this endpoint to write full OpenTelemetry-style spans — including multi-span hierarchies (parent → child → grandchild), attributes, references, events and links. For simple single-span annotations or evaluator outputs, prefer POST /preview/tracing/traces/ (create_simple_trace) — it's a higher-level helper on top of this endpoint.
Request body
Provide exactly one of:
- spans: a flat list of spans. Parent/child relationships are expressed via parent_id on each span.
- traces: a nested tree keyed by trace_id then by span name, where each node may contain a spans dict of its children. The query endpoint (POST /tracing/spans/query) returns this shape.
Each span requires trace_id, span_id, start_time, end_time. trace_id must be a 32-char hex UUID, span_id a 16-char hex. Attributes follow the Agenta convention under the ag namespace (ag.type, ag.data, ag.metrics, ag.references) and may be submitted either as a flat dotted map (OTel wire format) or as a nested object — both are accepted.
Response
Returns 202 Accepted with the links (trace_id + span_id) for the spans that were parsed into the ingest stream. See Tracing — Async write contract for what count < N submitted means.
Example
{
"spans": [
{
"trace_id": "f5a2efb40895881e938e2ebc070beca8",
"span_id": "15f3df0731995245",
"span_name": "completion_v0",
"span_type": "workflow",
"span_kind": "SPAN_KIND_SERVER",
"start_time": "2026-04-16T18:18:18.491929Z",
"end_time": "2026-04-16T18:18:20.415372Z",
"attributes": {
"ag.type.trace": "invocation",
"ag.type.span": "workflow",
"ag.data.inputs.country": "France",
"ag.data.outputs": "Paris"
}
}
]
}
Request body
Response
Successful Response
Changes
Changed in 11 of the 378 revisions of this API.6332
- ○
added the new optional request property
///new-optional-request-property
- ○
added the new optional request property
///new-optional-request-property
- ○
added the new optional request property
///new-optional-request-property
- ○
added the new optional request property
///////new-optional-request-property
- ○
added the new optional request property
///////new-optional-request-property
- ○
added the new optional request property
///////new-optional-request-property
- ○
added the new optional request property
////////new-optional-request-property
- ○
added the new optional request property
////////new-optional-request-property
- ○
added the new optional request property
////////new-optional-request-property
This revision also has 15 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ○
- ●
removed the optional property
from the response with the statusresponse-optional-property-removed
- ●
removed the optional property
from the response with the statusresponse-optional-property-removed
This revision also has 2 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ●
- ●
removed the optional property
from the response with the statusresponse-optional-property-removed
- ●
- ○
api tag
Deprecatedaddedapi-tag-added
- ○
api tag
Tracesremovedapi-tag-removed
- ○
endpoint deprecated
endpoint-deprecated
- ○
- ○
api operation id
ingest_spans_rpcremoved and replaced withingest_spansapi-operation-id-removed
This revision also has 64 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ○
- ○
api tag
Tracesaddedapi-tag-added
- ○
api tag
Observabilityremovedapi-tag-removed
This revision also has 11 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ○
- ○
added the optional property
to the response with the statusresponse-optional-property-added
- ○
added the optional property
to the response with the statusresponse-optional-property-added
- ○
added the optional property
to the response with the statusresponse-optional-property-added
- ○
- ▲
removed from the
/////request propertyanyOflistrequest-property-any-of-removed
- ▲
removed from the
//////////request propertyanyOflistrequest-property-any-of-removed
- ▲
the response property
///became optional for the statusresponse-property-became-optional
- ▲
the response property
///became optional for the statusresponse-property-became-optional
- ▲
response property
links/anyOf[subschema #1]/items/span_idlist-of-types was widened by adding typesnullto media typeapplication/jsonof response202response-property-list-of-types-widened
- ▲
response property
links/anyOf[subschema #1]/items/trace_idlist-of-types was widened by adding typesnullto media typeapplication/jsonof response202response-property-list-of-types-widened
- ○
added to the
/////request propertyanyOflistrequest-property-any-of-added
- ○
added to the
//////////request propertyanyOflistrequest-property-any-of-added
- ○
the request property
//////became optionalrequest-property-became-optional
- ○
the request property
//////became optionalrequest-property-became-optional
- ○
the request property
///////////became optionalrequest-property-became-optional
- ○
the request property
///////////became optionalrequest-property-became-optional
- ○
request property
//////list-of-types was widened by adding typesnullto media typeapplication/jsonrequest-property-list-of-types-widened
- ○
request property
//////list-of-types was widened by adding typesnullto media typeapplication/jsonrequest-property-list-of-types-widened
- ○
request property
///////////list-of-types was widened by adding typesnullto media typeapplication/jsonrequest-property-list-of-types-widened
- ○
request property
///////////list-of-types was widened by adding typesnullto media typeapplication/jsonrequest-property-list-of-types-widened
This revision also has 7 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ▲
- ○
added the optional property
//to the response with the statusresponse-optional-property-added
- ○
added the optional property
//to the response with the statusresponse-optional-property-added
This revision also has 31 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ○
- ○
endpoint added
endpoint-added
This revision also has 56 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ○