Skip to main content

Reorder extra columns

Endpoint: PUT /datasets/{dataset_id}/extra-columns

Description

Sets the order of a custom dataset's extra-column definitions. Later reads return extra_columns in this order (see Get dataset by id). On that full dataset response, each record's extra_values keys follow the same order. CSV download appends extra-column headers, in this order, after the dataset's own columns. Labels and type are unchanged (type is "text"). Per-record values stay keyed by column id.

Sending the dataset's current order is a successful no-op and returns the same list. A dataset with no extra columns cannot be reordered: column_ids cannot be empty, and any ids sent are unexpected.

Sharing rules

Custom datasets only. You must own the dataset or belong to the dataset's organization when it is org-shared.

Parameters

  • Path: dataset_id — integer.
  • Body — application/json:
{
"column_ids": ["col_11111111", "col_aabbccdd"]
}
  • column_ids — required list of 1–20 strings. Each id must match col_[0-9a-f]{8}. Ids must be unique. The list must be a complete permutation of every extra column currently on the dataset: no omissions, no unknown ids, and no duplicates.

Error responses

  • 401 — Authentication failed.
  • 400 — Not a custom dataset: Extra columns are only supported on custom datasets. column_ids is not a permutation of the dataset's current extra columns: detail starts with column_ids must list every extra column exactly once. and then, when applicable, Missing '<id>', '<id>'. and/or Unexpected '<id>', '<id>'. Quoted ids keep their order from the dataset (missing) or from the request (unexpected). Integrity failure: Database integrity error.
  • 403 — You don't have permission to perform this action. The caller is not the dataset owner and is not in the organization that owns the dataset.
  • 404 — Dataset with id {dataset_id} not found. The id is unknown to this caller.
  • 422 — Body failed validation: column_ids missing, empty, longer than 20, not unique (column_ids must be unique.), or an id that does not match col_ plus 8 lowercase hex digits (Invalid extra column id '<id>'.).
  • 500 — An error occurred while reordering the extra columns.

Responses

  • 200 — Extra-column definitions in the requested order ({ id, label, type }).

Example response (200)

[
{
"id": "col_11111111",
"label": "Why",
"type": "text"
},
{
"id": "col_aabbccdd",
"label": "Notes",
"type": "text"
}
]

curl

curl -X PUT "https://api.aegisevals.ai/api/v1/datasets/42/extra-columns" \
-H "Authorization: Bearer sk_00000000000000000000000000000000" \
-H "Content-Type: application/json" \
-d '{"column_ids": ["col_11111111", "col_aabbccdd"]}'