Edit a business definition
Edits the label, meaning, owner or choice domain of a declared input and appends one revision. Human-principal only for now — see FIELD_DECLARATION_HUMAN_ONLY.
A CHOICE DOMAIN is business metadata about what a fact can mean. It never edits a rule’s allowed values. A native list rule’s allowed/forbidden values are chosen explicitly and stored in the rule, and are the only values the evaluator reads; adding, relabelling or removing a choice changes no rule, no active_rules_hash and no receipt, and a rule value that is not in the domain stays legal and is shown as unlisted rather than removed.
expected_revision is required and is a compare-and-set: a disagreement is refused 409 STALE_DEFINITION_REVISION with both numbers and nothing is written. A type or unit change is refused 422 DEFINITION_TYPE_CHANGE_UNSUPPORTED — that is a redeclaration, not a revision. A choice domain repeating a code is refused 422 DUPLICATE_CHOICE_CODE, and one carrying a malformed entry 422 INVALID_CHOICE_SHAPE naming the offending index — two different faults, two different codes. A label change never renames the canonical key, and the key cannot be renamed by any request.
Authorizations
MeshQu API key passed as a bearer token: Authorization: Bearer mqu_…. Mint one in the console (Settings → API keys).
Tenant UUID for multi-tenant isolation. Required on all authenticated routes — validated before authentication (middleware/tenant.ts), so a missing or non-UUID header returns 400 (MISSING_TENANT_ID / INVALID_TENANT_ID) before the API key is checked.
Path Parameters
The canonical key, e.g. vendor.
Body
The declaration_revision the caller believes is current. REQUIRED: the write applies only if it still matches, and is refused 409 STALE_DEFINITION_REVISION with expected_revision and current_revision otherwise (contract §7). Two authors editing the same definition concurrently is exactly what this is for — the second is refused and the console reloads and re-offers.
x >= 1The display label. Changing it NEVER renames the canonical key (contract §1) — the key is what rules and payloads use and it is never renamed at all.
1 - 200What the fact means, in the business's words. null clears it.
2000Who in the business owns this fact's meaning. RECORDS a name; grants no authority. null clears it.
200The choice domain — business metadata that NEVER edits a rule's allowed values. Replaces the domain wholesale; null removes it. Adding a choice changes no rule, no active_rules_hash and no receipt, and a rule value that is not in the domain stays legal and is shown as unlisted rather than removed. Codes must be distinct (case-insensitively) or the request is refused 422 DUPLICATE_CHOICE_CODE; a malformed entry is refused 422 INVALID_CHOICE_SHAPE naming its index.
200NOT EDITABLE. Present only so a type change is refused 422 DEFINITION_TYPE_CHANGE_UNSUPPORTED rather than as an unexpected property: contract §2 makes a type change a redeclaration, and the author creates a new definition under a new key (R-BC-2 open).
NOT EDITABLE, for the same reason as value_type. Refused 422 DEFINITION_TYPE_CHANGE_UNSUPPORTED.
Response
Default Response
The canonical key, UNCHANGED by this write — it is never renamed (contract §1).
number The revision AFTER this write. Send it back as expected_revision on the next edit.
false when the request supplied the stored values back: no revision row was appended and the counter did not move. Appending a revision identical to its predecessor would put an event in the history that did not happen.
The business's list of possible values for this definition — business metadata that NEVER edits a rule's allowed values. Not a permitted subset: the subset a particular list rule allows or forbids lives in the rule. At most 200 entries.
200Which ordinary revision this write was. ABSENT when nothing changed. When several fields move at once it is meaning if the description changed, otherwise the first changed field in the fixed order label, owner, choices — a label on the revision, never a statement of what the revision contains, which is always the full snapshot.
declare