Skip to main content
Opik Documentation

Search documentation

Type to search this documentation.

Batch update dataset items

PATCH/v1/private/datasets/items/batchBatch update dataset items

Update multiple dataset items

Request body

application/json
objectDatasetItemBatchUpdate

Request to batch update multiple dataset items

dataset_idstring · uuid

Dataset ID. Required when using 'filters', optional when using 'ids'.

filtersarray of object
Show child attributes
Show array items

Filters to select dataset items to delete within the specified dataset. Must be used with 'dataset_id'. Mutually exclusive with 'item_ids'. Empty array means 'delete all items in the dataset'.

fieldstring
keystring
operatorstring

one of "contains", "not_contains", "starts_with", "ends_with", "=", "!=", ">", ">=", "<", "<=", "is_empty", "is_not_empty", "in", "not_in"

valuestring
idsarray of string · uuid

List of dataset item IDs to update (max 1000). Mutually exclusive with 'filters'.

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. When using 'filters', this is automatically set to true.

updateobjectrequired

Dataset item update request

Show child attributes
clear_execution_policyboolean

When true, clears the item-level execution policy (falls back to dataset-level)

dataobject
descriptionstring

Dataset item description

evaluatorsarray of object

Evaluators

Show child attributes
Show array items
configobjectrequired
namestringrequired

minLength 1

typestringrequired

one of "llm_judge", "code_metric"

execution_policyobject
Show child attributes
pass_thresholdinteger · int32

maximum 100 · minimum 1

runs_per_iteminteger · int32

maximum 100 · minimum 1

expected_outputstring

Dataset item expected output

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

inputstring

Dataset item input

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

metadataobject
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

Example request
{
  "dataset_id": "00000000-0000-0000-0000-000000000000",
  "filters": [
    {
      "field": "string",
      "key": "string",
      "operator": "!=",
      "value": "string"
    }
  ],
  "ids": [
    "00000000-0000-0000-0000-000000000000"
  ],
  "merge_tags": true,
  "update": {
    "clear_execution_policy": true,
    "data": {},
    "description": "string",
    "evaluators": [
      {
        "config": {},
        "name": "string",
        "type": "code_metric"
      }
    ],
    "execution_policy": {
      "pass_threshold": 0,
      "runs_per_item": 0
    },
    "expected_output": "string",
    "input": "string",
    "metadata": {},
    "tags": [
      "string"
    ],
    "tags_to_add": [
      "string"
    ],
    "tags_to_remove": [
      "string"
    ]
  }
}

Responses

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