Override Metric Config
POST/workspaces/:workspace_id/metric-configs/:config_name/versions
Create the next config_version of config_name in this workspace.
Insert-only, like every other write in this module: the assigned version is always
server-derived (:func:aip_api.services.metric_config.next_config_version) — the
request never accepts one, so there is no version in the body for a caller to guess or
collide on. The first override of a config name starts at "1.0.0"; every following one
increments the leading segment of the highest existing numeric version. Role membership
is a path-level dependency (workspace_editor/workspace_admin), not a hand-written
check, since workspace_id is already in the path — no bound parameter, matching the
sibling workspace_metric_config_defaults routes, since nothing here reads its result.
Returns the full created config, not just its identity — so a caller does not need a second round-trip to read back what it just created.
Raises 404 if workspace_id does not exist (checked explicitly rather than relying on
the FK — a platform admin bypasses membership gating, so the FK would otherwise be the
only guard and would surface as a raw 500); 409 if concurrent overrides exhaust the retry
budget or config_name is already bound to a different metric in this workspace; 422
if existing versions exist but none parses as dot-separated integers.
Request
Responses
- 201
- 403
- 404
- 409
- 422
Successful Response
Forbidden
Not Found
Conflict
Unprocessable Entity