Add items to an existing dataset
Add one or more items in a single batch to a dataset that already exists.
Use this to append items to an existing dataset; to create a dataset together with its initial items in one call, use POST /v5/datasets instead (this endpoint does not create datasets). Items are only ever added in a batch — there is no single-item create endpoint. The target dataset is identified by the required dataset_id in the request body, and each entry in data (at least one is required) becomes one item, optionally paired with the files entry at the same list index — when files is supplied it must be the same length as data. Each referenced file must exist and be a supported media format, and item keys may not collide with reserved dataset- or evaluation-item field names. The target dataset must not be archived. The batch is applied as a new dataset version snapshot rather than mutating existing versions, and the created items are returned.
Add items to an existing dataset
curl https://api.egp.scale.com/v5/dataset-items/batch \
-H 'Content-Type: application/json' \
-H "x-api-key: $SGP_API_KEY" \
-d '{
"data": [
{
"foo": "bar"
}
],
"dataset_id": "dataset_id"
}'{
"items": [
{
"id": "id",
"content_hash": "content_hash",
"created_at": "2019-12-27T18:11:19.117Z",
"created_by": {
"id": "id",
"type": "user",
"object": "identity"
},
"data": {
"foo": "bar"
},
"updated_at": "2019-12-27T18:11:19.117Z",
"archived_at": "2019-12-27T18:11:19.117Z",
"dataset_id": "dataset_id",
"files": {
"foo": "string"
},
"object": "dataset.item"
}
],
"object": "list"
}Returns Examples
{
"items": [
{
"id": "id",
"content_hash": "content_hash",
"created_at": "2019-12-27T18:11:19.117Z",
"created_by": {
"id": "id",
"type": "user",
"object": "identity"
},
"data": {
"foo": "bar"
},
"updated_at": "2019-12-27T18:11:19.117Z",
"archived_at": "2019-12-27T18:11:19.117Z",
"dataset_id": "dataset_id",
"files": {
"foo": "string"
},
"object": "dataset.item"
}
],
"object": "list"
}