Edit a metric's definition
ledger_metrics_updateCorrects a metric's name, unit, description, kind (measure / event), direction (which way is good), target, cadence, icon, level, or the metrics it drives (its place in the metric tree). Readings are untouched. Only what you pass changes. The slug is not editable here — external writers address metrics by slug. Fails with conflict when a rename collides with a live metric. metricId is the id from ledger_metrics_list. May return needs_confirmation.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| icon | No | The mark the metric wears in every tool: the thing it counts (phone for calls, landmark for profit). "" goes back to the catalog's icon. | |
| kind | No | measure = a value each reading; event = a count of occurrences. | |
| name | No | ||
| unit | No | "min", "%", "$", "tickets/day". | |
| level | No | outcome = what the business is judged on; driver = a number that moves an outcome; activity = daily work. "" unplaces it. | |
| drives | No | Ids of the metrics this one moves. Replaces the current set; pass the full list. Loops are refused. | |
| target | No | Goal value in the metric's unit; null clears. | |
| cadence | No | How often a reading is expected. | |
| metricId | Yes | Metric id (from ledger_metrics_list). | |
| direction | No | up = higher is better, down = lower is better, none. | |
| workspace | No | Workspace slug. Personal tokens with no default workspace MUST pass this; tokens with a default can override per call. Ignored for workspace API keys. | |
| approvalId | No | Approval id from a prior needs_confirmation envelope. | |
| description | No |