Update trace
Endpoint: PUT /traces/{trace_id}
Description
Updates filing/sharing metadata (and optionally the display name) on a trace you can edit: you own it, or it is shared with your organization (org_id matches your org) and you belong to that organization. Capture facts — wire trace_id, timing, counts, tokens, cost, input/output, resource attributes, and span payloads — are immutable; there is no span PUT.
All body fields are optional; only sent fields are applied. Explicit null clears a field. An empty body {} returns the current trace without committing changes.
Sharing & filing rules
Changing org_id:
- Setting
org_idto your organization's id shares a personal trace. When you newly share (org_idgoes fromnullto your organization), includeproject_idin the same request (required — see Introduction — Project).userstays the owner. - Setting
org_idtonullunshares a user-owned trace and removes its project assignment when this key may share it. A private key can unshare a trace it owns. A project-scoped key cannot: once the trace is org-shared,can_shareisfalseand the request returns403. Spans on the next read have the sameorg_id. If the trace is still inside an org-shared data collection, unshare is rejected — also passdata_collection_id: nullin the same call (or unshare the collection first). - Org-only traces (
useris null) cannot be unshared and cannot be moved to a different organization. - Changing
org_idon a trace owned by another user (even if shared with your org) is not allowed — only that user may changeorg_idfor their trace. A private key that sends anorg_idreceives400("Private API keys cannot change a resource's organization."). - Sharing can collide with a pre-existing org row for the same OTLP
trace_id(another member already ingested it under org context). That surfaces as400("A trace with this id is already shared with your organization."). Unshare can collide with a pre-existing personal row for the same OTLPtrace_id("A trace with this id already exists for your account.").
Changing data_collection_id:
- Linking to an org-shared collection forces the trace's
org_idto match the collection and inherits the collection's project when one is set. Spans on the next read have the sameorg_idanddata_collection_id. - Filing into a personal collection preserves an existing org share.
- Setting
data_collection_idtonulldetaches the trace from its collection; the trace'sorg_idis unchanged by the detach unless you also sendorg_idin the same request (for exampleorg_id: nullto detach and unshare together). - When both
org_idanddata_collection_idare sent,org_idmust match the target collection's organization. - Org-only traces cannot be moved into someone else's personal collection or into a collection in a different organization.
Changing project_id:
- On a private trace with no
data_collection_id, sendingproject_idalone (withoutorg_id) auto-shares the trace with your organization and assigns it to that project when the key is project-scoped, and only into that key's project. On a private key the field is ignored and the trace stays private. - On an org-shared trace not in a data collection, an API key cannot change
project_idto a different project, including when the key's owner is an organization admin. That request returns403. Sending the currentproject_idagain succeeds. - You cannot set
project_idtonullwhile the trace remains org-shared. - A trace linked to a data collection cannot be assigned to a project directly — assign the collection instead (or detach first).
Changing name:
- Display label only. Surrounding whitespace is stripped; blank or whitespace-only becomes
null. Does not change span operation names.
Parameters
- Path:
trace_id— integer row id (not the OTLP hex wire id). - Body —
application/json:
{
"name": "string | null",
"data_collection_id": "integer | null",
"org_id": "integer | null",
"project_id": "integer | null"
}
name has no length cap, so an update can store the same label ingest recorded.
data_collection_id, org_id, and project_id must be JSON integers. A digit string ("74"), a whole-number float (1.0), or a boolean (true / false) returns 422 before lookup. JSON null still clears name and each of those ids.
Error responses
401— Authentication failed.403—"You don't have permission to perform this action."— not allowed to update this trace (for example: not the owner of a personal trace, or an API key changingproject_idon an already-shared trace, including an organization admin's key), or API key scoping violation.404—"Trace with id {trace_id} not found."when the trace is missing or not accessible to your API key."Data collection not found or access denied."whendata_collection_idis missing or not claimable."Project with id {id} not found."whenproject_iddoes not exist.400— including:"Organization-owned traces cannot be unshared.""Organization-owned traces cannot be moved to another organization.""Cannot unshare this trace while it remains in an organization-shared data collection. Remove it from the collection first, or unshare the collection.""Private API keys cannot change a resource's organization.""org_id must match your organization.""org_id must match the data collection's organization. A trace's organization is derived from its data collection.""Organization-owned traces cannot be moved to a collection in a different organization.""Organization-owned traces cannot be moved to a personal collection unless the collection is yours.""project_id is required when sharing a resource with your organization.""A trace with this id is already shared with your organization.""A trace with this id already exists for your account."- Direct
project_idon a trace inside a collection;project_id: nullwhile org-shared; invalid or inaccessibleproject_id. "Database integrity error."— generic fallback.
422— Invalid body.data_collection_id,org_id, andproject_idmust be JSON integers. A digit string ("74"), a whole-number float (1.0), or a boolean (true/false) is rejected before lookup ("Input should be a valid integer"). JSONnullis still valid on those ids and onname.500—"An error occurred while updating the trace."
Responses
200— Updated trace object with the same JSON shape as Get trace by id, includingpermissionsfor this caller.
curl
Rename a trace:
curl -X PUT "https://api.aegisevals.ai/api/v1/traces/42" \
-H "Authorization: Bearer sk_00000000000000000000000000000000" \
-H "Content-Type: application/json" \
-d '{"name":"Checkout agent"}'
Share a personal trace with your organization:
curl -X PUT "https://api.aegisevals.ai/api/v1/traces/42" \
-H "Authorization: Bearer sk_00000000000000000000000000000000" \
-H "Content-Type: application/json" \
-d '{"org_id":3,"project_id":5}'
Unshare a user-owned trace:
curl -X PUT "https://api.aegisevals.ai/api/v1/traces/42" \
-H "Authorization: Bearer sk_00000000000000000000000000000000" \
-H "Content-Type: application/json" \
-d '{"org_id":null}'
File a trace into a data collection:
curl -X PUT "https://api.aegisevals.ai/api/v1/traces/42" \
-H "Authorization: Bearer sk_00000000000000000000000000000000" \
-H "Content-Type: application/json" \
-d '{"data_collection_id":7}'