Update run
Endpoint: PUT /runs/{run_id}
Description
Updates a run you can modify: you own it, or it is shared with your organization (org_id matches your org) and you belong to that organization. All body fields are optional; only provided fields are applied. You can rename any run via alias. For custom runs only, you can also attach or detach a data collection, or share / unshare via org_id (see below).
Sharing & unsharing rules
Only custom runs (runs without a dataset) can change org_id or data_collection_id from this endpoint. Dataset runs can only update alias here. Dataset runs inherit collection, organization, and project visibility from their dataset; share, unshare, or move those resources via PUT /datasets/{dataset_id} or PUT /data-collections/{data_collection_id} instead.
You may send org_id and data_collection_id in the same request. If data_collection_id is not null and the target collection is organization-scoped (the collection has a non-null org_id), any org_id in the body must equal that collection's organization; otherwise the API returns 400. For a private collection (no org_id on the collection), include org_id: null if you also send org_id in the same request (a non-null org_id does not match the collection and is rejected).
Changing org_id:
- Setting
org_idto your organization's id shares the custom run. When you newly share (org_idgoes fromnullto your organization), includeproject_idin the same request (required — see Introduction — Project). - If the run is not linked to a data collection, it receives the
org_idandproject_idyou send. - If the run is linked to a private data collection that you own, sharing can cascade to the whole collection: the collection, its datasets, and your runs adopt the same
org_id.project_idis applied to the collection and cascades to those org-shared members, not assigned to this run alone. - If the run is linked to an org-shared data collection, its
org_idmust match the collection's organization — you cannot set a differentorg_idor unshare the run independently. Detach it (data_collection_id: null) or change the collection instead. - Setting
org_idtonullunshares the run and removes its project assignment (for the run itself; not sibling resources in the collection). - Org-only runs (
useris null on the run; the organization owns the row) cannot be unshared and cannot be moved to a different organization —org_idmust equal the current value, and you must belong to that organization. - Changing
org_idon a run owned by another user (even if shared with your org) is not allowed — only that user may changeorg_idfor their run. Org-only runs may haveorg_idadjusted by a member of that organization (per the rules above).
Changing data_collection_id:
- Linking the run to an org-shared collection forces the run's
org_idto match the collection'sorg_id(auto-share) and inherits the collection's project when one is set. You must still be a member of that organization. The run'sorg_idand project follow the collection` while it remains linked. - Linking the run to a private collection sets the run's
org_idto null (the run is no longer org-shared via that link). Any project assignment on the run itself is cleared; the collection is unchanged. - Setting
data_collection_idtonulldetaches the run; the run'sorg_idis unchanged by the detach unless you also sendorg_idin the same request (for exampleorg_id: nullto detach and unshare together). - Org-only runs cannot be linked to a collection whose
org_iddiffers from the run's organization (cannot move org-owned resources to another org via a collection). - If an org-only run is linked to a private collection you own, and you belong to the run's organization, the private collection is promoted to that organization (collection, datasets, and your runs adopt the same
org_id). If the run already had a project, the collection may inherit that project assignment and cascade it to members.
Changing alias:
- Strings are trimmed; an empty string is stored as
null. - Aliases are unique per account and, for shared runs, unique within the organization.
Changing project_id (custom runs only):
- On a private custom run with no
data_collection_id, sendingproject_idalone (withoutorg_id) auto-shares the run with your organization and assigns it to that project when your key has organization authorization (a project-scoped key). A private API key cannot org-share this way. - On an org-shared custom run not linked to a collection, changes move it to another project in your organization.
- You cannot set
project_idtonullwhile the run remains org-shared. - A run linked to a data collection cannot be assigned to a project directly — assign the collection instead (or detach the run first). The API returns
400if you try.
Parameters
- Path:
run_id— integer. - Body —
application/json:
{
"org_id": "integer | null",
"data_collection_id": "integer | null",
"project_id": "integer | null",
"alias": "string | null"
}
Error responses
401— Authentication failed.403— Not allowed to update this run (for example: no access, changingorg_idon another user's run, or org-onlyorg_idrules not satisfied), or API key scoping violation (project_idin the body conflicts with a project-scoped key, claim/attach conflict when the target collection or resource is assigned to a different project).404— Run not found or not accessible to your API key (including not assigned to the key's project); ordata_collection_idnot found / not claimable.400—org_iddoes not match the target collection's organization when both are sent and the collection is org-scoped; sending any field other thanaliasfor a dataset run; changingorg_idon a non-custom run;org_idnot your organization when sharing; unsharing or moving an org-only run; duplicate run alias for your account or organization; org share withoutproject_id;project_id: nullwhile org-shared; directproject_idon a run inside a collection; invalid or inaccessibleproject_id.500— Server error.
Responses
200— Updated run object with the same JSON shape as Get run. Thedatasetfield may benullwhen the nested dataset is not accessible to your API key (same as Get run).
Example response (200)
{
"id": 991,
"user": "analyst@acme.com",
"author_email": "analyst@acme.com",
"run_type": "Custom",
"run_source": "API Call",
"dataset": null,
"data_collection": "Customer Support",
"org_id": 3,
"number_of_metrics": 2,
"result": 83.5,
"threshold": 70,
"model_slug": "gpt-4o",
"alias": "support-march",
"aggregate_results": {
"ans_corr": 86,
"faith": 81
},
"total_cost": "0.001200000000000",
"started_at": "2026-04-01T09:12:00Z",
"finished_at": "2026-04-01T09:13:12Z",
"is_gte_threshold": true,
"evaluations": []
}
curl
Share a custom run with your organization:
curl -X PUT "https://api.aegisevals.ai/api/v1/runs/991" \
-H "Authorization: Bearer sk_00000000000000000000000000000000" \
-H "Content-Type: application/json" \
-d '{"org_id":3,"project_id":5}'
Attach a custom run to a data collection (run inherits the collection's org_id):
curl -X PUT "https://api.aegisevals.ai/api/v1/runs/991" \
-H "Authorization: Bearer sk_00000000000000000000000000000000" \
-H "Content-Type: application/json" \
-d '{"data_collection_id":14}'
Rename (custom or dataset run — for dataset runs, only alias is allowed):
curl -X PUT "https://api.aegisevals.ai/api/v1/runs/991" \
-H "Authorization: Bearer sk_00000000000000000000000000000000" \
-H "Content-Type: application/json" \
-d '{"alias":"support-march-final"}'