Define field value
define_enum_valueAdd, relabel, recolor, reposition, archive or reorder the values of a built-in pick-list field (e.g. account.lifecycle_stage, opportunity.type, subscription.status, touch.type, task.priority — the fields describe_schema lists with values). A value_key that already exists is UPDATED in place: only the fields you send change (label, color, position, archived); its key and semantic role never change. A new key needs a label, and on a behavior-driving field a NEW value must pick a semantic_role. archived:true retires a value from new picks while stored data stays valid (archived:false restores it; nothing is deleted). Or send order alone — the field's COMPLETE value_key list, archived keys included — to set the whole order in one atomic call. Changes apply immediately. Returns the stored value, or the field's values in their new order.
When to use: When an admin wants a new, renamed, recolored, reordered or retired value for a field like lifecycle_stage, opportunity type, or touch type. New behavior-field values pick a semantic role; archiving is reversible.
Example: Add a 'pilot' lifecycle stage that means active_customer.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| color | No | Optional hex color for the value's chip, e.g. "#2563eb"; display only. Null clears the color; omitting it keeps an existing value's color. | |
| field | Yes | The enum field's key on that object, e.g. lifecycle_stage, type, status, priority; describe_schema lists each field's values. | |
| label | No | Display label. Required for a NEW value (its slug becomes the value_key unless value_key is set); on an existing value_key it relabels. Omit to leave a label as is. | |
| order | No | Reorder form: the field's COMPLETE value_key list in the wanted order (every current key exactly once, archived ones included — describe_schema lists them). Send it alone with object_type + field; a partial or unknown list is refused with the current keys. | |
| archived | No | true retires an existing value from new picks (stored data keeps it, reversible); false restores it. Omit to leave the state as is; a new value is never born archived. | |
| position | No | 0-based sort position among the field's values, lower first. A new value defaults to 0; omitting it keeps an existing value's position. To set the whole order, use `order` instead. | |
| value_key | No | Stable machine key (lowercase, underscores). Defaults to the slugified label; pass an existing key to relabel, recolor, reposition, archive or restore that value. | |
| object_type | Yes | Built-in object owning the enum field, e.g. account, opportunity, subscription, touch, task, lead. | |
| semantic_role | No | Meaning anchor, required only for a NEW value on a behavior-driving field: account.lifecycle_stage takes prospect / active_customer / at_risk / churned / dormant, opportunity.type takes new / post_sale, subscription.status takes live / inactive; the refusal names that field's allowed roles. Locked once a value exists. Omit or null for every other field. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | ||
| order | No | ||
| values | No | ||
| updated | No | ||
| enum_value | No | ||
| current_keys | No | ||
| known_fields | No |