Skip to main content
Opik Documentation

Search documentation

Type to search this documentation.

Batch update spans

PATCH/v1/private/spans/batchBatch update spans

Update multiple spans

Request body

application/json
objectSpanBatchUpdate

Request to batch update multiple spans

idsarray of string · uuidrequired

List of span IDs to update (max 1000)

maxItems 1000 · minItems 1 · uniqueItems true

Show child attributes

maxItems 1000 · minItems 1 · uniqueItems true

merge_tagsboolean

If true, merge tags with existing tags instead of replacing them. Default: false

updateobjectrequired
Show child attributes
end_timestring · date-time
environmentstring

maxLength 150 · minLength 0

error_infoobject
Show child attributes
exception_typestringrequired

minLength 1

messagestring
tracebackstringrequired

minLength 1

inputobject
Show child attributes
anyOf · 3 options
Option 1object
Option 2array of object
Option 3string
metadataobjectJsonListString ↑
modelstring
namestring
outputobjectJsonListString ↑
parent_span_idstring · uuid
project_idstring · uuid

If null and project_name not specified, Default Project is assumed

project_namestring

If null and project_id not specified, Default Project is assumed

pattern (?s)^\s*(\S.*\S|\S)\s*$

providerstring
sourcestring

one of "sdk", "experiment", "playground", "optimization", "evaluator"

tagsarray of string

Tags

maxItems 50 · minItems 0 · uniqueItems true

Show child attributes

maxItems 50 · minItems 0 · uniqueItems true

tags_to_addarray of string

Tags to add

maxItems 50 · minItems 0 · uniqueItems true

Show child attributes

maxItems 50 · minItems 0 · uniqueItems true

tags_to_removearray of string

Tags to remove

maxItems 50 · minItems 0 · uniqueItems true

Show child attributes

maxItems 50 · minItems 0 · uniqueItems true

total_estimated_costnumber

minimum 0

trace_idstring · uuidrequired
ttftnumber · double
typestring

one of "general", "tool", "llm", "guardrail"

usageobject
Example request
{
  "ids": [
    "00000000-0000-0000-0000-000000000000"
  ],
  "merge_tags": true,
  "update": {
    "end_time": "2026-06-09T00:00:00Z",
    "environment": "string",
    "error_info": {
      "exception_type": "string",
      "message": "string",
      "traceback": "string"
    },
    "input": {},
    "metadata": {},
    "model": "string",
    "name": "string",
    "output": {},
    "parent_span_id": "00000000-0000-0000-0000-000000000000",
    "project_id": "00000000-0000-0000-0000-000000000000",
    "project_name": "string",
    "provider": "string",
    "source": "evaluator",
    "tags": [
      "string"
    ],
    "tags_to_add": [
      "string"
    ],
    "tags_to_remove": [
      "string"
    ],
    "total_estimated_cost": 0,
    "trace_id": "00000000-0000-0000-0000-000000000000",
    "ttft": 0,
    "type": "general",
    "usage": {
      "additionalProp1": 0
    }
  }
}

Responses

204No Content
400Bad Requestapplication/json
objectErrorMessage
codeinteger · int32
detailsstring
messagestring
Example response
{
  "code": 0,
  "details": "string",
  "message": "string"
}
Documentation menu