Skip to content
GitHubLog inStart free
cetra is not released yet. These docs describe the development version.

Edit items in one batch

PATCH
/api/v1/projects/{project}/datasets/{dataset}/items
curl --request PATCH \
--url http://localhost:8080/api/v1/projects/example/datasets/example/items \
--header 'Content-Type: application/json' \
--cookie cetra_session=<cetra_session> \
--data '{ "items": [ { "expected_output": "example", "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "input": "example", "metadata": {} } ] }'

Project members and above, a read-write personal access token, or an API key with write (D-J-5, D-J-23). Creates one new version holding every item that changes; items that change nothing are left out. A batch with any failing item writes nothing; the error lists the failing items.

project
required
string

Project UUID, URL-encoded org-slug/project-slug, or current.

dataset
required
string

Dataset id, or its name.

Media typeapplication/json

PATCH …/datasets/{dataset}/items body (D-J-23): 1 to 1 000 distinct live items.

object
items
required

The edits, 1 to 1 000 of them, one per item id.

Array<object>

One item of a batch edit (D-J-23): the item id and the fields to replace, as in [UpdateItemRequest]. An absent field is unchanged; expected_output: null clears it.

object
expected_output

Any JSON value.

id
required

The live item to edit.

string format: uuid
input

Any JSON value but null.

metadata
object
key
additional properties
any

Example generated

{
"items": [
{
"expected_output": "example",
"id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"input": "example",
"metadata": {}
}
]
}

The new version, or null when nothing changed, and the items.

Media typeapplication/json

The answer to a batch edit (D-J-23): the new version, or null when no item changed, and the live revision of every id in request order.

object
items
required

The live revisions of every id, in request order.

Array<object>

One item as it is in a version.

object
created_at
required

Creation time of this revision. JSON is RFC 3339.

string format: date-time
expected_output

Any JSON value.

id
required

The item id, stable across versions.

string format: uuid
input
required

Any JSON value.

metadata
required
object
key
additional properties
any
revision_id
required

This revision.

string format: uuid
source_span_id

The span the item was copied from. Omitted when none.

string
/^[0-9a-fA-F]{16}$/
source_trace_id

The trace the item was copied from. Omitted when none.

string
/^[0-9a-fA-F]{32}$/
version
required

The version that introduced this revision.

integer format: int64
version

The version the changed items were edited in. null when nothing changed.

object
added
required

Items this version adds (D-J-24).

integer format: int64
created_at
required

Creation time. JSON is RFC 3339.

string format: date-time
created_by

The user id, or key:<key id> for an API key. Omitted when unknown.

string
deleted
required

Items this version deletes (D-J-24).

integer format: int64
description
required

What changed, e.g. add 12 items.

string
edited
required

Items this version edits (D-J-24).

integer format: int64
version
required

Version number. Versions start at 1.

integer format: int64

Example generated

{
"items": [
{
"created_at": "2026-04-15T12:00:00Z",
"expected_output": "example",
"id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"input": "example",
"metadata": {},
"revision_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"source_span_id": "example",
"source_trace_id": "example",
"version": 1
}
],
"version": {
"added": 1,
"created_at": "2026-04-15T12:00:00Z",
"created_by": "example",
"deleted": 1,
"description": "example",
"edited": 1,
"version": 1
}
}

The request is malformed or a filter is invalid.

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}

No credentials, or the credentials are invalid.

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}

The credentials do not allow this operation, or the organization’s plan does not include it (code plan_required).

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}

The resource does not exist.

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}

The request body is larger than the limit.

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}

Too many requests.

Media typeapplication/problem+json

RFC 7807 problem document.

Spec 09 § Conventions.

object
code
required

Machine-readable error code.

string
Allowed values: bad_request invalid_filter query_failed query_timeout query_too_large too_many_traces too_many_items busy restore_mode unauthorized forbidden sso_required email_not_verified plan_limit plan_required scim_managed owner_not_allowed not_found method_not_allowed payload_too_large unsupported_media_type range_not_satisfiable conflict authorization_pending slow_down access_denied expired_token quota_exceeded rate_limited internal
detail

Extra explanation. Omitted when absent.

string
errors

Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.

Array<object>

One field that failed validation.

Spec 09 § Conventions.

object
field
required

Request field, query parameter, or expression the error refers to.

string
message
required

What is wrong with the field.

string
position

Location inside the field value, for filter and SQL errors.

object
column
required

1-based column number, in characters.

integer format: int32
line
required

1-based line number, in characters.

integer format: int32
status
required

HTTP status code.

integer format: int32
title
required

Short human-readable summary, the reason phrase of status.

string
type
required

Problem type URI. Always about:blank in this version.

string

Example

{
"code": "bad_request"
}