Set custom fields when creating a case

Preview - not available in production and subject to change

Open a case with custom fields set on it and on its individuals' profiles.

Use customFields on createCase to set the case’s custom fields. Supply text for a text field, or the option keys to select in optionKeys for a multi-select field. customFields on an individual or entity sets custom fields on its profile, and works the same way in addIndividualsToCase. Each field must apply to the record it is set on.

Required scope: case-management

Request

mutation createCase($input: CreateCaseInput!) {
  createCase(input: $input) {
    ... on CaseInformation {
      caseId
      name
      customFields {
        fieldKey
        label
        text
        selectedOptions {
          key
          label
        }
      }
    }
    ... on ValidationErrors {
      errors {
        message
      }
    }
  }
}

Variables

{
  "input": {
    "organizationId": "3f2b8c1e9a4d4e7f8b6c5d4e3f2a1b0c",
    "officeId": "8e7d6c5b4a3f4e2d9c1b0a9f8e7d6c5b",
    "initialState": "DRAFT",
    "reference": "MAT-2026-0192",
    "individuals": [
      {
        "preferredName": {
          "firstName": "Jane",
          "lastName": "Citizen"
        },
        "emailAddress": "jane.citizen@example.com",
        "isCaseContact": true,
        "needsVerification": true,
        "customFields": [
          {
            "fieldKey": "01963b2e-5a2b-7d4e-9f6a-7b8c9d0e1f2a",
            "optionKeys": [
              "01963b2e-6b3c-7e5f-8a7b-8c9d0e1f2a3b"
            ]
          }
        ]
      }
    ],
    "existingIndividuals": [
      {
        "individualId": "20417"
      }
    ],
    "customFields": [
      {
        "fieldKey": "01963b2e-4f1a-7c3d-8e5f-6a7b8c9d0e1f",
        "text": "HVL-4471"
      },
      {
        "fieldKey": "01963b2e-5a2b-7d4e-9f6a-7b8c9d0e1f2a",
        "optionKeys": [
          "01963b2e-6b3c-7e5f-8a7b-8c9d0e1f2a3b"
        ]
      }
    ]
  }
}

Response

{
  "data": {
    "createCase": {
      "caseId": "48213",
      "name": "Jane Citizen, John Citizen",
      "customFields": [
        {
          "fieldKey": "01963b2e-4f1a-7c3d-8e5f-6a7b8c9d0e1f",
          "label": "Billing code",
          "text": "HVL-4471",
          "selectedOptions": []
        },
        {
          "fieldKey": "01963b2e-5a2b-7d4e-9f6a-7b8c9d0e1f2a",
          "label": "Client segment",
          "text": null,
          "selectedOptions": [
            {
              "key": "01963b2e-6b3c-7e5f-8a7b-8c9d0e1f2a3b",
              "label": "Private client"
            }
          ]
        }
      ]
    }
  }
}