Skip to main content
POST
/
v2
/
spans
/
annotate
Annotate a batch of project spans
curl --request POST \
  --url https://api.arize.com/v2/spans/annotate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "project_id": "proj_abc123",
  "start_time": "2024-01-01T00:00:00Z",
  "end_time": "2024-01-08T00:00:00Z",
  "annotations": [
    {
      "record_id": "span_abc",
      "values": [
        {
          "name": "relevance",
          "label": "good",
          "score": 0.9
        }
      ]
    }
  ]
}
'
{
  "status": 400,
  "title": "Invalid request parameters",
  "detail": "The 'name' field is required and must be a non-empty string.",
  "instance": "/resource",
  "type": "https://arize.com/docs/ax/rest-reference/errors#invalid-request"
}

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 span annotations to write. Up to 1000 spans per request.

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

Start of the time range for span lookup. Optional; defaults to 31 days ago.

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"

Response

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