{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/tightly-io/json-schema/tightly-io-custom-field-schema.json",
  "title": "CustomField",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/tightly-io-openapi.json#/components/schemas/CustomField",
  "properties": {
    "access_type": {
      "description": "What the connector permits on an integration field.",
      "enum": [
        "read_only",
        "read_write"
      ],
      "type": "string"
    },
    "bound_to": {
      "description": "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.\n",
      "properties": {
        "connection_id": {
          "type": "string"
        },
        "field_key": {
          "type": "string"
        },
        "source_path": {
          "type": "string"
        }
      },
      "type": [
        "object",
        "null"
      ]
    },
    "created_at": {
      "format": "date-time",
      "type": [
        "string",
        "null"
      ]
    },
    "description": {
      "description": "What the field is for, where somebody wrote it down.",
      "type": [
        "string",
        "null"
      ]
    },
    "field_type": {
      "description": "The type a value of this field must parse as.",
      "enum": [
        "string",
        "decimal",
        "integer",
        "boolean",
        "date"
      ],
      "type": "string"
    },
    "grain": {
      "description": "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.\n",
      "enum": [
        "product",
        "variant",
        null
      ],
      "type": [
        "string",
        "null"
      ]
    },
    "id": {
      "description": "The field's id, which is what a variant's custom_fields map is keyed on.",
      "type": "string"
    },
    "is_active": {
      "description": "Whether the field is in use. An inactive field keeps its values and its history.",
      "type": "boolean"
    },
    "is_editable": {
      "description": "Whether the definition itself can be changed.",
      "type": "boolean"
    },
    "is_value_editable": {
      "description": "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`.\n",
      "readOnly": true,
      "type": "boolean"
    },
    "label": {
      "description": "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.\n",
      "type": "string"
    },
    "name": {
      "description": "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.\n",
      "type": "string"
    },
    "source": {
      "description": "Where the field came from: `tightly` for one declared here, otherwise the connector that brought it.\n",
      "type": "string"
    },
    "updated_at": {
      "format": "date-time",
      "type": [
        "string",
        "null"
      ]
    },
    "used_in": {
      "description": "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`.\n",
      "properties": {
        "families": {
          "type": "integer"
        },
        "saved_filters": {
          "type": "integer"
        }
      },
      "type": [
        "object",
        "null"
      ]
    }
  },
  "type": "object"
}