List custom fields

Preview - not available in production and subject to change

Find the custom fields your organization has defined and the records they apply to.

Custom fields capture your organization’s own information on cases and profiles. Use customFieldDefinitions to list them in display order. A TEXT field holds free text, and a MULTI_SELECT field holds any of its options. appliesTo shows which kinds of record each field can be set on. Use the field key and option key values to set, read and filter by custom fields. They stay the same when a field or option is relabelled.

Required scope: read-only

Request

query listCustomFieldDefinitions($organizationId: String!) {
  me {
    organization(organizationId: $organizationId) {
      organizationId
      customFieldDefinitions {
        key
        label
        type
        options {
          key
          label
        }
        appliesTo {
          case
          individualProfile
          entityProfile
        }
      }
    }
  }
}

Variables

{
  "organizationId": "3f2b8c1e9a4d4e7f8b6c5d4e3f2a1b0c"
}

Response

{
  "data": {
    "me": {
      "organization": {
        "organizationId": "3f2b8c1e9a4d4e7f8b6c5d4e3f2a1b0c",
        "customFieldDefinitions": [
          {
            "key": "01963b2e-4f1a-7c3d-8e5f-6a7b8c9d0e1f",
            "label": "Billing code",
            "type": "TEXT",
            "options": [],
            "appliesTo": {
              "case": true,
              "individualProfile": false,
              "entityProfile": false
            }
          },
          {
            "key": "01963b2e-5a2b-7d4e-9f6a-7b8c9d0e1f2a",
            "label": "Client segment",
            "type": "MULTI_SELECT",
            "options": [
              {
                "key": "01963b2e-6b3c-7e5f-8a7b-8c9d0e1f2a3b",
                "label": "Private client"
              },
              {
                "key": "01963b2e-7c4d-7f6a-9b8c-9d0e1f2a3b4c",
                "label": "Commercial"
              },
              {
                "key": "01963b2e-8d5e-7a7b-8c9d-0e1f2a3b4c5d",
                "label": "Not-for-profit"
              }
            ],
            "appliesTo": {
              "case": true,
              "individualProfile": true,
              "entityProfile": true
            }
          }
        ]
      }
    }
  }
}