---
title: "One custom field definition"
method: GET
path: "/api/v1/variants/custom-fields/{custom_field_id}"
tags: ["variants"]
---

# One custom field definition

`GET /api/v1/variants/custom-fields/{custom_field_id}`

## Request

- Base URL: `https://api.app.tightly.io`
- URL: `https://api.app.tightly.io/api/v1/variants/custom-fields/{custom_field_id}`
- Auth: HTTP bearer

One custom field definition by its id: `name`, `field_type`, `source`, `description`, `is_active`, `is_editable`, `is_value_editable`, `access_type` and its timestamps.

The id is the one a variant's `custom_fields` map is keyed on, so this is the read that turns a key in that map into a name and a type.

`is_value_editable` is computed rather than stored: true when `source` is `tightly`, and otherwise true only when `access_type` is `read_write`. A field brought by a connector as `read_only` cannot take a value from here, whatever `is_editable` says about the definition.

A field id that does not exist in this organisation is refused 404. For every definition at once, read the list.

Scope: `products:read`.

## Path parameters

- `custom_field_id` string, required

## Headers

- `Tightly-Version` string

## Response `200`

The definition.

- object
  - `data` object
    - `custom_field` CustomField
      - `access_type` 'read_only' | 'read_write': What the connector permits on an integration field.
      - `bound_to` object, nullable: The connection filling this field and the path it reads. Null for a field nobody's connection fills, and null on this single-definition read, which does not look it up: the page read at `/variants/custom-fields` is where it is served.
        - `connection_id` string
        - `field_key` string
        - `source_path` string
      - `created_at` string, date-time, nullable
      - `description` string, nullable: What the field is for, where somebody wrote it down.
      - `field_type` 'string' | 'decimal' | 'integer' | 'boolean' | 'date': The type a value of this field must parse as.
      - `grain` 'product' | 'variant' | 'null', nullable: Which bag holds the values. Null where the definition does not say, which is every definition made before a field could be added from a connection.
      - `id` string: The field's id, which is what a variant's custom_fields map is keyed on.
      - `is_active` boolean: Whether the field is in use. An inactive field keeps its values and its history.
      - `is_editable` boolean: Whether the definition itself can be changed.
      - `is_value_editable` boolean: Whether values of this field can be written. Computed, never stored: true when source is `tightly`, otherwise true only when access_type is `read_write`.
      - `label` string: What a person calls the field. Falls back to the key humanised where nobody recorded one, so it is never null on a served row.
      - `name` string: The field's key: what its values are stored under, what a saved filter addresses as `custom_fields.<name>`, and what a family form lists. Print `label` instead.
      - `source` string: Where the field came from: `tightly` for one declared here, otherwise the connector that brought it.
      - `updated_at` string, date-time, nullable
      - `used_in` object, nullable: How many family forms and saved filters name this field. Two zeroes mean nothing reads it; null means it was not counted, which is every read but the page read at `/variants/custom-fields`.
        - `families` integer
        - `saved_filters` integer
  - `message` object: severity, service and desc.

## Other responses

- `401`: No usable key: malformed, unknown, revoked, expired or stopped. One refusal covers all five, because telling a caller which is which maps the surface for them.
- `403`: The key may not reach this operation. `scope_missing` when the key does not hold Products; `ip_not_allowed` when the caller's address is outside the key's allowlist. `plan_excludes` when the organisation's plan does not include the public API itself, which is sold with Essentials and is asked of every key minted under that gate. A key minted before the gate existed is never refused by it, whatever the plan holds. Products is ungated, so that is the only plan reason served here.
- `404`: No custom field in this organisation carries that id.
- `429`: The key has spent its allowance for this minute. 600 reads and 120 writes a minute, counted per key, refused calls included. `Retry-After` says how long to wait.
- `503`: The database is briefly out of reach, which is what a failover or a full connection pool looks like from outside. Wait the seconds `Retry-After` names and send the request again. A read is safe to repeat. A write is not, because the connection was lost in the middle of it, so read the object back before sending it a second time. Branch on the status rather than on `code`, which is `POSTGRES_UNAVAILABLE` from one of the two seams that raise this and `SERVICE_UNAVAILABLE` from the other.

---

[API](https://skmtc.dev/tightly/apis/tightly-api.md) · [All operations](https://skmtc.dev/tightly/apis/tightly-api/llms.txt) · [OpenAPI document](https://skmtc.dev/tightly/apis/tightly-api/revisions/199f7eb35afb?raw)
