Edit items in one batch
const url = 'http://localhost:8080/api/v1/projects/example/datasets/example/items';const options = { method: 'PATCH', headers: { cookie: 'cetra_session=<cetra_session>', 'Content-Type': 'application/json' }, body: '{"items":[{"expected_output":"example","id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","input":"example","metadata":{}}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Project UUID, URL-encoded org-slug/project-slug, or current.
Dataset id, or its name.
Request Bodyrequired
Section titled “Request Bodyrequired”PATCH …/datasets/{dataset}/items body (D-J-23): 1 to 1 000 distinct live items.
object
The edits, 1 to 1 000 of them, one per item id.
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
Any JSON value.
The live item to edit.
Any JSON value but null.
object
Example generated
{ "items": [ { "expected_output": "example", "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "input": "example", "metadata": {} } ]}Responses
Section titled “Responses”The new version, or null when nothing changed, and the items.
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
The live revisions of every id, in request order.
One item as it is in a version.
object
Creation time of this revision. JSON is RFC 3339.
Any JSON value.
The item id, stable across versions.
Any JSON value.
object
This revision.
The span the item was copied from. Omitted when none.
The trace the item was copied from. Omitted when none.
The version that introduced this revision.
The version the changed items were edited in. null when nothing changed.
object
Items this version adds (D-J-24).
Creation time. JSON is RFC 3339.
The user id, or key:<key id> for an API key. Omitted when unknown.
Items this version deletes (D-J-24).
What changed, e.g. add 12 items.
Items this version edits (D-J-24).
Version number. Versions start at 1.
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.
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}No credentials, or the credentials are invalid.
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}The credentials do not allow this operation, or the organization’s plan does not include it (code plan_required).
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}The resource does not exist.
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}The request body is larger than the limit.
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}Too many requests.
RFC 7807 problem document.
Spec 09 § Conventions.
object
Machine-readable error code.
Extra explanation. Omitted when absent.
Field errors. Omitted when empty, because RFC 7807 clients expect the member to be absent.
One field that failed validation.
Spec 09 § Conventions.
object
Request field, query parameter, or expression the error refers to.
What is wrong with the field.
Location inside the field value, for filter and SQL errors.
object
1-based column number, in characters.
1-based line number, in characters.
HTTP status code.
Short human-readable summary, the reason phrase of status.
Problem type URI. Always about:blank in this version.
Example
{ "code": "bad_request"}