> For the complete documentation index, see [llms.txt](https://glu.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://glu.gitbook.io/docs/concepts/contacts/custom-fields.md).

# Custom fields

Custom fields let you attach arbitrary key-value metadata to contacts. Before setting values, you need to define the field schema in your [organisation settings](https://admin.glu.io).

#### Types of fields

| Type           | Accepts                                 | Example value                                |
| -------------- | --------------------------------------- | -------------------------------------------- |
| `Text`         | Free text string                        | `"Vegetarian"`                               |
| `Number`       | Numeric value                           | `"42"`                                       |
| `Date`         | ISO date string                         | `"2026-04-07"`                               |
| `Boolean`      | `"true"` or `"false"`                   | `"true"`                                     |
| `Email`        | Valid email address                     | `"jane@example.com"`                         |
| `Phone`        | Phone number                            | `"+44 7700 900000"`                          |
| `URL`          | Valid URL                               | `"https://example.com"`                      |
| `Textarea`     | Multi-line text                         | `"Allergic to nuts.\nPrefers ground floor."` |
| `Select`       | One value from predefined options       | `"Gold"`                                     |
| `Multi select` | Multiple values from predefined options | `"Swimming,Spa"`                             |

#### Reading a contact's custom fields

`GET /contacts/{contactId}/custom-fields`

{% code title="" lineNumbers="true" expandable="true" %}

```json
[
  {
    "id": 1,
    "contactId": 1042,
    "fieldName": "dietary_preference",
    "fieldId": 5,
    "fieldLabel": "Dietary Preference",
    "fieldType": "Select",
    "value": "Vegetarian",
    "displayValue": "Vegetarian",
    "typedValue": "Vegetarian",
    "createdAt": "2026-03-15T10:00:00+00:00",
    "updatedAt": "2026-04-01T08:30:00+00:00"
  },
  {
    "id": 2,
    "contactId": 1042,
    "fieldName": "external_crm_id",
    "fieldId": 8,
    "fieldLabel": "External CRM ID",
    "fieldType": "Text",
    "value": "CRM-48291",
    "displayValue": "CRM-48291",
    "typedValue": "CRM-48291",
    "createdAt": "2026-03-15T10:00:00+00:00",
    "updatedAt": "2026-03-15T10:00:00+00:00"
  }
]
```

{% endcode %}

#### Setting a custom field value

`POST /contacts/{contactId}/custom-fields`

Reference the field by its name:

{% code title="" lineNumbers="true" %}

```json
{
  "fieldName": "dietary_preference",
  "value": "Vegan"
}
```

{% endcode %}

The value is validated against the field type — for example, a `Select` field will reject values not in its predefined options, and a `Number` field will reject non-numeric input.

#### Updating a custom field value

`PUT /contacts/{contactId}/custom-fields/{fieldId}`

{% code title="" lineNumbers="true" %}

```json
{
  "value": "Pescatarian"
}
```

{% endcode %}
