# updateContactCustomField

Edit a contact custom-field DEFINITION in place (id from listContactCustomFields). THIS IS THE CORRECT WAY TO FIX A FIELD created with the wrong name, description, dropdown options or default; do not create a second field. Every field but the id is optional; omitted ones are untouched. `type` retypes it in place (same id), sent alone or with the `options` of a new DROPDOWN; refused once a contact has a value, anything uses it, it has a default, or it is a dropdown. `options` is for DROPDOWN fields ONLY (rejected on any other type) and REPLACES the whole option list: send every option to keep, each existing one as { id, label } (its id from listContactCustomFields, which keeps contact values recorded against it and lets you RENAME it by changing the label), each new one as { label } with no id. An existing option you leave out is REMOVED; if contacts, filters or workflows still reference it the call is rejected until you pass optionDependencyResolutions: call getDeletionImpact with targetKind CONTACT_CUSTOM_FIELD_OPTION and targetId the option id, then hand back its impactVersion plus a replacement option for each. Changing `defaultValue` fills contacts that show no value; a contact holding a real value is never rewritten. A default no longer among the options is cleared. Names are unique in the organization: a rename onto an existing field name is rejected. System-defined fields (e.g. Buyer/Seller, Source) cannot be renamed, deleted or lose their built-in options; `hideOnContactRecord: true` takes any field, system ones too, off the contact record (display only, values kept).

- Call: `POST https://server.goliathdata.com/api/v1/call` with `{ "operationId": "updateContactCustomField", "variables": {...} }`
- Scope: `WRITE`
- Type: mutation
- Idempotency: honors `Idempotency-Key` (24 h)
- Rate-limited: no

## Variables

- `customFieldId`: `ID!` (required)
- `name`: `String`
- `type`: `ContactCustomFieldType` (one of `DROPDOWN`, `TEXT`, `NUMBER`, `DOLLAR`, `DATE`, `LINK`)
- `description`: `String`
- `options`: `[UpsertCustomFieldOptionInput!]`
  - `id`: `ID`
  - `label`: `String!` (required)
- `defaultValue`: `String`
- `optionDependencyResolutions`: `[DependencyResolutionInput!]`
  - `impactVersion`: `String!` (required)
  - `replacements`: `[DependencyReplacementSelectionInput!]!` (required)
    - `targetKind`: `DependencyTargetKind!` (required, one of `PIPELINE_ITEM`, `DEAL`, `PIPELINE_STAGE_PIPELINE_ITEMS`, `DEAL_STAGE_DEALS`, `PIPELINE_ITEM_CUSTOM_FIELD`, `DEAL_CUSTOM_FIELD`, `PIPELINE_ITEM_CUSTOM_FIELD_OPTION`, `DEAL_CUSTOM_FIELD_OPTION`, `PROPERTY_TAG`, `PROPERTY_LIST`, `CONTACT_TAG`, `CONTACT_LIST`, `CONTACT_CUSTOM_FIELD`, `CONTACT_CUSTOM_FIELD_OPTION`, `PIPELINE`, `DEAL_PIPELINE`, `PIPELINE_STAGE`, `DEAL_STAGE`, `TWILIO_PHONE_NUMBER`, `EMAIL_IDENTITY`, `LIBRARY_FOLDER`, `USER`, `USER_GROUP`, `WORKFLOW_GROUP`, `WORKFLOW_AUTOMATION`, `CONTENT_TEMPLATE`, `AGENT`, `MARKETING_CAMPAIGN`, `UPLOADED_FILE`, `WORKFLOW_WEBHOOK_CREDENTIAL`, `SCRAPER_PIPELINE`, `FILTER`, `EMBED_FORM`, `WORKFLOW_TABLE`, `WORKFLOW_TABLE_COLUMN`, `CONTACT`, `PROPERTY`, `ORGANIZATION`, `SLACK_CHANNEL`, `SLACK_USER`, `MACHINE_GROUP`, `MACHINE_HOST`)
    - `targetId`: `ID!` (required)
    - `replacementId`: `ID!` (required)
- `matchInboundTextsByValue`: `Boolean`
- `hideOnContactRecord`: `Boolean`

## Response (data, an example)

```json
{
  "contactCustomFieldMutation": {
    "updateCustomField": {
      "id": "<ID>",
      "name": "…",
      "type": "DROPDOWN",
      "description": "…",
      "displayOrder": 0,
      "allowMultiple": true,
      "defaultValue": "…",
      "matchInboundTextsByValue": true,
      "hideOnContactRecord": true
    }
  }
}
```

## Example

```bash
curl https://server.goliathdata.com/api/v1/call \
  -H "Authorization: Bearer $GOLIATH_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "operationId": "updateContactCustomField",
    "variables": {
      "customFieldId": "<customFieldId>"
    }
  }'
```
