For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Copy to LLMGithubGo to App
DocumentationIntegrationsBuilding Self-Improving AgentsSelf-hosting OpikSDK & API reference
DocumentationIntegrationsBuilding Self-Improving AgentsSelf-hosting OpikSDK & API reference
    • Overview
  • Python SDK
    • Reference
    • REST API Client
  • Typescript SDK
    • Overview
    • Opik TS
    • Prompts
    • Opik Query Language (OQL)
  • Rest API
    • Overview
        • POSTAdd span comment
        • PUTAdd span feedback score
        • POSTCreate spans
        • PATCHBatch update spans
        • GETGet spans by project_name or project_id and optionally by trace_id and/or type
        • POSTCreate span
        • GETGet span by id
        • DELDelete span by id
        • PATCHUpdate span by id
        • POSTDelete span comments
        • POSTDelete span feedback score
        • GETFind Feedback Score names
        • GETGet span comment
        • GETGet span stats
        • PUTBatch feedback scoring for spans
        • POSTSearch spans
        • PATCHUpdate span comment by id
LogoLogo
Copy to LLMGithubGo to App
Rest APIAPI ReferenceSpans

Batch update spans

PATCH
/v1/private/spans/batch
PATCH
/api/v1/private/spans/batch
$curl -X PATCH http://localhost:5173/api/v1/private/spans/batch \
> -H "Content-Type: application/json" \
> -d '{
> "ids": [
> "string"
> ],
> "update": {
> "trace_id": "string"
> }
>}'
Update multiple spans
Was this page helpful?
Previous

Get spans by project_name or project_id and optionally by trace_id and/or type

Next
Built with

Request

This endpoint expects an object.
idslist of stringsRequired

List of span IDs to update (max 1000)

updateobjectRequired
merge_tagsbooleanOptional

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

Errors

400
Bad Request Error