Skip to main content
Opik Documentation

Search documentation

Type to search this documentation.

Update span by id

PATCH/v1/private/spans/{id}Update span by id

Update span by id

Parameters

idstring · uuidpathrequired

Request body

application/json
objectSpanUpdate
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
{
  "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
404Not found
Documentation menu