Skip to main content

Update dataset

Endpoint: PUT /datasets/{dataset_id}

Description

Updates a custom dataset you own, or that is shared with your organization and you are a member of that organization. All body fields are optional; only provided fields are applied. You can rename the dataset, change selected_metrics, adjust column_mappings, or set data_collection_id. Changing org_id is restricted: another member cannot re-share or unshare your dataset — only the owner may change org_id for user-owned rows (org-only datasets follow the rules below).

Sharing & unsharing rules

Changing org_id:

  • Setting org_id to your organization's id shares the dataset. If the dataset is currently in a private data collection that you own, sharing cascades: the collection adopts the same org_id, the other datasets in that collection adopt the same org_id, and the collection owner's runs tied to the collection or its datasets follow.
  • Setting org_id to null unshares the dataset. If the dataset is still inside an org-shared data collection, the request is rejected — also pass data_collection_id: null in the same call (or unshare the collection first).
  • Org-only datasets (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.
  • Proprietary datasets cannot be shared with an organization.
  • Only the dataset owner (or, for org-only datasets, a member of that organization) can change org_id.

Changing data_collection_id:

  • Linking the dataset to an org-shared collection forces the dataset's org_id to match the collection's org_id (auto-share).
  • Linking to a private collection leaves the dataset's org_id unchanged (but see the cascade described above if you later share it).
  • Setting data_collection_id to null detaches the dataset; the dataset's org_id is unchanged unless org_id is also provided in the same request.
  • Proprietary datasets cannot be attached to a data collection.

Run synchronization

Whenever org_id or data_collection_id change as a result of this request, your own runs on this dataset are updated to match both fields, so they keep the same visibility as the dataset.

Parameters

  • Path: dataset_id — integer.
  • Bodyapplication/json:
{
"name": "string | null",
"selected_metrics": {
"1": { "threshold": 70, "metric_args": null },
"2": { "threshold": 80, "metric_args": { "ignore_extra_keys": true } }
},
"column_mappings": { "prompt": "col_a", "output": "col_b" },
"data_collection_id": 14,
"org_id": "integer | null"
}

selected_metrics is a map keyed by metric id (as a string), with { threshold: 0–100, metric_args: object | null } per entry. See Create dataset for the full shape and validation rules. Sending selected_metrics replaces the whole map; omit the field (or pass null) to leave it unchanged. Sending an empty object returns 400.

Error responses

  • 401 — Authentication failed.
  • 403 — Not allowed to update this dataset (not the owner / not in the dataset's organization / non-admin acting on a proprietary dataset).
  • 422 — Invalid body.
  • 404 — Dataset not found; data collection not found or not accessible.
  • 400 — Invalid metrics, empty selected_metrics, invalid column_mappings, duplicate name for your account or organization, org_id doesn't match your organization, attempt to unshare an org-only dataset, attempt to share a proprietary dataset, attempt to unshare while still inside an org-shared data collection, attempt to attach a proprietary dataset to a collection, etc.
  • 500 — Server error.

Responses

curl

curl -X PUT "https://api.aegisevals.ai/api/v1/datasets/3" \
-H "Authorization: Bearer sk_00000000000000000000000000000000" \
-H "Content-Type: application/json" \
-d '{"name":"Renamed dataset","selected_metrics":{"1":{"threshold":75,"metric_args":null},"2":{"threshold":85,"metric_args":null}}}'