> ## Documentation Index
> Fetch the complete documentation index at: https://crevio.co/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Contact fields

> Give contact metadata keys a type, read and write their values, and react when they change.

**A contact field gives one `metadata` key on contacts a type.** Once `plan_interest` is a `select` field with the choices Basic and Pro, every write to `metadata.plan_interest` is checked against those choices and stored as the choice's key. Metadata keys without a field stay free-form strings, as before.

Values live where they always did: in each contact's `metadata`, under the field key. There is no separate values endpoint.

## The object

```json theme={null}
{
  "id": "plan_interest",
  "object": "contact_field",
  "label": "Plan interest",
  "type": "select",
  "options": [
    { "key": "basic", "label": "Basic" },
    { "key": "pro", "label": "Pro" }
  ],
  "currency": null,
  "position": 0,
  "archived": false,
  "created_at": "2026-12-02T10:00:00Z",
  "updated_at": "2026-12-02T10:00:00Z"
}
```

| Field | Meaning |
| - | - |
| `id` | The field key: the `metadata` key its value is stored under. Lowercase snake\_case, up to 40 characters, starting with a letter. It never changes. |
| `type` | `text`, `number`, `money`, `date`, `boolean`, `url`, `email`, `select` or `multi_select`. It never changes. |
| `options` | The choices of a `select` or `multi_select` field, otherwise `null`. A value is a choice's `key`. |
| `currency` | A `money` field's ISO currency code, when set. |
| `position` | Display order on the contact page. |
| `archived` | Archived fields keep their stored values but are no longer checked or shown. |

## Manage fields

| Method | Path | |
| - | - | - |
| `GET` | `/v1/contacts/fields` | Active fields in display order. `archived=true` adds archived ones. Never paginates. |
| `POST` | `/v1/contacts/fields` | Create a field: `key`, `type`, and `options` for `select` and `multi_select`. |
| `PATCH` | `/v1/contacts/fields/{key}` | Change `label`, `options` (replaces the list), `currency` or `position`. `archived: false` restores. |
| `DELETE` | `/v1/contacts/fields/{key}` | Archive the field. Its values stay in `metadata`. |

```bash theme={null}
curl -X POST https://api.crevio.co/v1/contacts/fields \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"key": "plan_interest", "type": "select", "label": "Plan interest", "options": ["Basic", "Pro"]}'
```

`options` takes labels (`"For sale"` gets the key `for_sale`) or `{ "key", "label" }` objects. `billing_address` is reserved. An account has at most 100 active fields, and a field at most 100 options. Creating a key that belongs to an archived field answers 422: restore it instead.

## Write values

Write values through the contact's `metadata`, as on any contact create or update. Values are cast to one canonical string:

| Type | Send | Stored |
| - | - | - |
| `text` | any scalar | the text, up to 500 characters |
| `number` | `42`, `"3.50"` | `"42"`, `"3.5"` |
| `money` | whole minor units: `4900` | `"4900"` |
| `date` | `"2026-12-01"` | `"2026-12-01"` |
| `boolean` | `true`, `"false"` | `"true"`, `"false"` |
| `url` | an http or https URL | the URL |
| `email` | an email address | the address |
| `select` | a choice key or label | the key: `"pro"` |
| `multi_select` | a list of keys or labels: `["pro", "Basic"]` | comma-joined keys: `"pro,basic"` |

```bash theme={null}
curl -X PATCH https://api.crevio.co/v1/contacts/con_abc123 \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"metadata": {"plan_interest": "Pro", "renewal_date": "2027-03-01"}}'
```

A value that does not fit its field answers `400 parameter_invalid` with `param` set to `metadata[<key>]`, and nothing is saved. `null` or `""` clears a value.

`GET /v1/contacts?metadata[plan_interest]=pro` filters on the stored string, so it matches `select`, `boolean` and the other single values exactly. It does not match one choice inside a `multi_select` value; use a broadcast audience for that.

## Use them

* **Email campaigns**: `audience: { "fields": { "plan_interest": "pro" } }` sends to contacts that match every pair. A `multi_select` pair matches contacts who have that choice. See `POST /v1/broadcasts`.
* **Email sequences**: `trigger: { "event": "contact.field_changed", "field": "plan_interest", "value": "pro" }` enrolls a contact when the field becomes `pro`, or when `pro` is added to a `multi_select`. Omit `value` to enroll on any new value. Clearing a field enrolls no one.
* **Emails**: `{{customer.fields.plan_interest}}` prints the stored value.
* **Webhooks and tasks**: `contact.field_changed` fires once per changed field, after the change is saved. `data.object` is the contact, with the new value in `metadata`, and `data.field` is the field. A task on this event runs for every field; check `data.field.id` in its instructions to act on one.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.