# GET /api/v2/custom-fields

List custom fields

- MCP id: custom-fields.index
- Scope: api:read
- Permission: none, the record's own rules still apply
- Needs the custom_fields feature on your organisation
- Rate cost: 1 unit, read bucket. `view=detail` makes it 3. Adds: `q` +2.
- Cache-Control: private, no-store

Returns the active fields the organisation added to its record types, by name A to Z: what each `code` in a record's `custom_fields` means, what its value looks like and, for a choice, the option ids it takes.

Narrow to one record type with `filter[entity_type]=customer`. It needs no permission of its own: it is gated by the policy and `scopeForCaller()` alone, which list only the fields of record types you may read with a token that reaches them.

## Parameters
- view (string, optional): Which field set to render.
- per_page (integer 1 to 100, optional): Rows per page. At most 25 when `include` names a to-many relation; a larger value is 400 invalid-query-parameter.
- cursor (string, optional): Opaque keyset cursor from a previous page's links.next. Never construct one by hand.
- page (integer 1 to 1000, optional): Opt in to page-number paging: 1-based, at most 1000. Omit it, the default, to page by opaque cursor, which is what links.next hands you. Cannot be combined with cursor. Published only on collections that count their rows on every request.
- filter[created_at] (timestamp (YYYY-MM-DDThh:mm:ssZ), optional): Creation timestamp. Pair with `sort=id` for a stable full export. Operators: = gte lt.
- filter[entity_type] (string, optional): The record type the fields are on, such as `customer`. Operators: = in.
- filter[type] (string, optional): What the fields hold, such as `select`. Operators: = in.
- filter[updated_at] (timestamp (YYYY-MM-DDThh:mm:ssZ), optional): Last-write timestamp. Use for incremental sync. Operators: = gte lt.
- q (string, optional): Free-text search over `name`, `code`, in that order of relevance. At most one substring match per request: `q` together with a `contains` filter is 400 invalid-query-parameter.
- sort (string, optional): Up to three keys, comma-separated, each optionally prefixed with `-` for descending.
- X-Request-Id (header, optional): A correlation id of your own. It is recorded in our logs next to the server's request id but never returned: the response header always carries the server's id. A value that does not match the pattern is discarded silently, never rejected.
- If-None-Match (header, optional): The ETag a read is conditional on. A match is answered 304 with no body.

## Response 200
- id (integer, required): Unique identifier.
- code (string ≤ 255, required): The field's key in a record's `custom_fields`, such as `licence_plate`. It never changes once the field exists, so clients and automations can rely on it.
- name (string ≤ 255, required): The label plnnrly shows, in the organisation's own words.
- description (string or null, required): The help text shown with the field, or `null`.
- type (string ≤ 255, required): What the field holds, and so the shape of its value: `text`, `textarea`, `color-picker` and `markdown-editor` a string; `rich-editor` HTML; `email`, `phone`, `link` and `tags-input` a list of strings; `number` an integer; `currency` a decimal string; `date` `YYYY-MM-DD`; `date-time` a UTC date-time with a `Z`; `checkbox` and `toggle` a boolean; `select`, `radio` and `toggle-buttons` one option id; `multi-select` and `checkbox-list` a list of option ids.
- entity_type (string, required): The record type the field is on, such as `customer`.
- section (object or null, required): The section of the form the field is in.
  - id (integer, required): The section's id.
  - name (string, required): The section's heading, as shown in the form.
- required (boolean, required): Whether the field must hold a value. A write may leave it out, but may not clear it with `null`.
- api_writable (boolean, required): Whether a write through the API may set the field.
- sort_order (integer or null, required): Where the field sits within its section, lowest first.
- options (array of object, required): The choices of a `select`, `radio`, `toggle-buttons`, `multi-select` or `checkbox-list` field, in their order. Empty for other types.
- created_at (timestamp (YYYY-MM-DDThh:mm:ssZ), required): Creation timestamp.
- updated_at (timestamp (YYYY-MM-DDThh:mm:ssZ), required): Last-write timestamp.
- links (CustomFieldLinks, required)
  - self (url, required): The canonical URI of this record.

## Errors
- 403 forbidden-by-policy | insufficient-permission | insufficient-token-scope: Forbidden.
- 304 : Not modified.
- 400 idempotency-key-required | invalid-cursor | invalid-query-parameter | malformed-request | unsupported-parameter: Bad request.
- 401 token-expired | unauthenticated: Unauthenticated.
- 404 endpoint-not-found | resource-not-found: Not found.
- 406 not-acceptable: Not acceptable.
- 429 rate-limit-exceeded: Too many requests.
- 500 internal-error: Server error.
- 503 tenant-unavailable: Service unavailable.

## Example
```bash
curl -G \
  'https://<your-url>/api/v2/custom-fields' \
  --data-urlencode 'filter[entity_type]=customer' \
  -H 'Authorization: Bearer <token>' \
  -H 'Accept: application/json'
```
