Skip to main content
POST
Annotate a batch of project spans

Authorizations

Authorization
string
header
required

Most Arize AI endpoints require authentication. For those endpoints that require authentication, include your API key in the request header using the format

Body

application/json

Body containing span annotation batch

Batch annotation request for project spans.

project_id
string
required

The project (model) ID whose spans are being annotated.

Example:

"proj_abc123"

annotations
object[]
required

Batch of annotations to write. Up to 1000 records per request for SPAN or TRACE granularity; up to 100 records per request for SESSION granularity.

Required array length: 1 - 1000 elements
start_time
string<date-time>

Start of the time range for span lookup. Optional; defaults to 31 days before end_time, or 7 days before end_time when granularity is SESSION.

Example:

"2024-01-01T00:00:00Z"

end_time
string<date-time>

End of the time range for span lookup. Optional; defaults to now.

Example:

"2024-01-08T00:00:00Z"

granularity
enum<string>
default:SPAN

Whether the record is a span, a trace, or a session, which affects whether annotations are written as span, trace, or session annotations. For TRACE, each record_id must be a trace's root span; attempts to write trace annotations on non-root spans will be rejected. For SESSION, each record_id is a session ID; the annotation is written to the root span of the session's earliest trace within the lookup window. Optional; defaults to 'SPAN'.

Available options:
SPAN,
TRACE,
SESSION

Response

Annotations accepted. Writes are idempotent; retry on failure is safe.