Skip to main content

Update data collection

Endpoint: PUT /data-collections/{data_collection_id}

Description Updates name, dataset_ids, and/or org_id. All body fields are optional.

Sharing & unsharing rules

Changing org_id:

  • Setting org_id to your organization's id shares the collection. Every dataset currently in the collection inherits the same org_id, and runs of the collection's owner that point to the collection or to any of its datasets are also updated to that org_id.
  • Setting org_id to null unshares the collection:
    • Datasets and runs that don't belong to the collection's owner are detached (data_collection_id cleared).
    • Datasets owned by the collection owner stay in the collection but become private (org_id = null).
    • The collection owner's runs on those remaining datasets / on the collection lose their org_id.
  • Only the collection owner (or, for org-only collections, a member of that organization) can change org_id.
  • Org-only collections (no individual owner) cannot be unshared and cannot be moved to a different organization — org_id must equal the current value, and you must belong to that organization.

Changing dataset_ids (the field replaces the full set of attached datasets):

  • Datasets removed from the set get data_collection_id = null, and the owner's runs that referenced those datasets are detached from the collection.
  • Datasets newly added must be your non-proprietary datasets and must not already belong to another collection.
  • If the collection is currently shared, every dataset in the new set is forced to the collection's org_id, and the owner's runs on those datasets are kept in sync.
  • If the collection is currently private and you belong to an organization, adding any dataset already shared with your organization promotes the collection to that org_id. As part of the promotion, your own private datasets in the new set are auto-shared with your organization (and your runs on them follow). If any non-owner private dataset can't be promoted, the request fails with 400. Pass org_id: null in the same request to opt out of this promotion.

Parameters

  • Path: data_collection_id — integer.
  • Bodyapplication/json:
{
"name": "string | null",
"dataset_ids": "integer[] | null",
"org_id": "integer | null"
}

Error responses

  • 401 — Authentication failed.
  • 403 — Not the owner of a user-owned collection trying to change org_id.
  • 422 — Invalid body.
  • 404 — Collection not found.
  • 400 — Empty name; duplicate name; invalid dataset_ids (same rules as create); org_id doesn't match your organization; attempt to unshare or move an org-only collection; mixed dataset selection where non-owner private datasets cannot be auto-promoted.
  • 500 — Server error.

Responses

  • 200 — updated collection object with the same JSON shape as one element of items from Get data collections (paginated list).

Example response (200)

{
"id": 14,
"user": { "id": 7, "email": "analyst@acme.com" },
"name": "Renamed bundle",
"org_id": null,
"author_email": "analyst@acme.com",
"datasets": [
{
"id": 1,
"name": "Support QA - March",
"user": { "id": 7, "email": "analyst@acme.com" },
"org_id": null,
"author_email": "analyst@acme.com",
"created_at": "2026-03-30T10:00:00Z",
"updated_at": null
},
{
"id": 2,
"name": "Support QA - April",
"user": { "id": 7, "email": "analyst@acme.com" },
"org_id": null,
"author_email": "analyst@acme.com",
"created_at": "2026-03-31T10:00:00Z",
"updated_at": null
},
{
"id": 3,
"name": "Support QA - May",
"user": { "id": 7, "email": "analyst@acme.com" },
"org_id": null,
"author_email": "analyst@acme.com",
"created_at": "2026-04-01T10:00:00Z",
"updated_at": null
}
],
"runs": [],
"created_at": "2026-04-01T09:20:00Z",
"updated_at": "2026-04-01T09:30:00Z"
}

curl

curl -X PUT "https://api.aegisevals.ai/api/v1/data-collections/1" \
-H "Authorization: Bearer sk_00000000000000000000000000000000" \
-H "Content-Type: application/json" \
-d '{"name":"Renamed bundle","dataset_ids":[1,2,3]}'