GoliathDevelopersGet an API key
Reference/Contactsgenerated from the gateway manifest

setContactsCustomField

Set ONE DROPDOWN custom field to the same value across a selection of contacts.

POST/api/v1/callWRITEidempotent · 24 hruns as the key's owner
View as Markdown

Set ONE DROPDOWN custom field to the same value across a selection of contacts: the bulk form of updateContact’s updateCustomFieldValues. customFieldId from listContactCustomFields; read the result per contact with getContact (customFields[].values.dropdownSelectedValues). Async bulk job: returns a bulkTaskId to poll with getBulkTask, so an immediate read-back will not show the change. DROPDOWN FIELDS ONLY: dropdownSelectedValues is its only value channel, so a TEXT / NUMBER / DOLLAR / DATE / LINK field cannot be written here (use updateContact per contact). Values are option LABELS (matched case-insensitively, stored as the canonical label), NOT ids: an id or any string not among the options is refused. It REPLACES each contact’s selection rather than adding, so send every option the contact should end up with; an EMPTY array CLEARS the field on every selected contact. More than one value needs allowMultiple. WHERE REFUSALS LAND: only the id checks run before the response (a field id not among your organization’s custom fields is a 403). Everything else (not a DROPDOWN, an unknown label, several values on a single-select field) is checked by the worker, so the call returns 200 with a bulkTaskId and the failure shows as status: FAILED on getBulkTask with NOTHING written. A 200 means "queued", never "applied": poll the task before reporting the change. POTENTIALLY OUTBOUND: each contact goes through the normal contact-update path, so contact-mutation events fire and a CONTACT workflow triggered on this field can start a run and send.

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": "setContactsCustomField",
    "variables": {
      "contactIds": [
        "<String>"
      ],
      "customFieldId": "<String>",
      "dropdownSelectedValues": [
        "<String>"
      ]
    }
  }'
import { GoliathClient } from '@goliath-data/sdk'

const goliath = new GoliathClient({
  apiKey: process.env.GOLIATH_API_KEY!,
  baseUrl: 'https://server.goliathdata.com',
})

const result = await goliath.contacts.setContactsCustomField(
  {
    contactIds: [
      '<String>'
    ],
    customFieldId: '<String>',
    dropdownSelectedValues: [
      '<String>'
    ]
  },
  { idempotencyKey: crypto.randomUUID() },
)
const res = await fetch('https://server.goliathdata.com/api/v1/call', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.GOLIATH_API_KEY}`,
    'Content-Type': 'application/json',
    'Idempotency-Key': crypto.randomUUID(),
  },
  body: JSON.stringify({
    operationId: 'setContactsCustomField',
    variables: {
      contactIds: [
        '<String>'
      ],
      customFieldId: '<String>',
      dropdownSelectedValues: [
        '<String>'
      ]
    }
  }),
})
const { data, errors } = await res.json()

Variables

The example sends only what the schema requires. Some operations also need one of several optional variables (one filter or another, say); the description above says which.

contactIds[String!]!required
customFieldIdString!required
dropdownSelectedValues[String!]!required

Response

What comes back under data: a list shows as one entry, and a value as its type.

response shape
{
  "data": {
    "contactMutation": {
      "setContactsCustomField": {
        "mode": "SYNC",
        "bulkTaskId": "…"
      }
    }
  }
}

Errors

Idempotency

Send an Idempotency-Key of 1 to 255 characters. A finished request retried with the same key replays its stored response, marked Idempotency-Replayed: true; one still in flight returns 409 idempotency_conflict. Keys expire after 24 hours. Write without fear →