Custom Column Value

A Custom Column Value is one computed-or-entered cell: the value of a Custom Column for a single record. It is joined to its target record by the record's public UUID (record_id) rather than a typed foreign key, which is what lets the same custom-column mechanism work across every records root. AI-computed values are written by the enrichment worker as structured JSON.

NamingValue
ObjectCustom Column Value
Resource type (JSON:API type)custom_column_value
Collection / records rootโ€” (not a records root)
REST base/v1/custom-column-values
Entity classCustomColumnValue

Internal object. Not currently exposed on the public REST API. The operations below describe the intended contract.

API operations

OperationMethod & pathStatus
ListGET /v1/custom-column-values๐ŸŸก Planned
RetrieveGET /v1/custom-column-values/{id}๐ŸŸก Planned
CreatePOST /v1/custom-column-values๐ŸŸก Planned
UpdatePATCH /v1/custom-column-values/{id}๐ŸŸก Planned
DeleteDELETE /v1/custom-column-values/{id}๐ŸŸก Planned

Data model

Attributes

FieldTypeRequiredConstraintsAllowed valuesDescription
value_idstring, UUID, ๐Ÿ”’ systemโœ… Yesunique; gen_random_uuid()โ€”Public identifier of the value row.
record_idstring (UUID)โœ… Yesmax 255 chars; indexed with custom_columnโ€”Public UUID of the target record (e.g. a company_id). NOT a typed FK โ€” a root-agnostic join key, so one mechanism serves all roots.
rootstringโœ… Yesmax 50 chars; denormalizedA records rootThe records root of the target record (denormalized from the column for fast filtering).
valuejsonbโšช Nonullableโ€”The cell value. AI stores structured output: { value: "high" } for text/select, { value: 42, currency: "EUR" } for amount.
created_atISO 8601, ๐Ÿ”’ systemโ€”onCreate hookโ€”Creation timestamp.
updated_atISO 8601, ๐Ÿ”’ systemโ€”onCreate + onUpdate hooks; nullableโ€”Last-update timestamp (recompute overwrites it).

Relationships

NameTypeRequiredDescription
custom_columnto-one (custom_column)โœ… YesThe column definition this value belongs to. deleteRule: cascade โ€” deleting the column deletes its values.

System-computed

  • value_id generated by gen_random_uuid()
  • created_at via onCreate; updated_at via onCreate + onUpdate hooks
  • NO deleted_at โ€” values are not soft-deleted; they cascade-delete with their custom_column (deleteRule: cascade)
  • Indexed on (custom_column, record_id)
  • record_id is the target record's PUBLIC UUID (root-agnostic join key) โ€” no FK to the underlying entity table
  • value shape is written by the enrichment worker: { value } or { value, currency } for amount columns

Example

{
  "data": {
    "type": "custom_column_value",
    "id": "e4d5c6b7-1111-4111-8111-aaaabbbbcccc",
    "attributes": {
      "value_id": "e4d5c6b7-1111-4111-8111-aaaabbbbcccc",
      "root": "companies",
      "record_id": "3fa1c2d4-87ae-4b10-a9f3-ec5d1234abcd",
      "value": {
        "value": "high"
      },
      "created_at": "2026-05-20T09:15:30.000Z",
      "updated_at": "2026-05-28T11:03:00.000Z"
    }
  },
  "relationships": {
    "custom_column": {
      "data": {
        "type": "custom_column",
        "id": "7c1f9a02-4d3b-4e21-9a77-2f0c11aa33bc"
      }
    }
  }
}
Source: apps/api/src/database/entities/CustomColumnValue.ts ยท domain: records / data-views ยท tier: Infrastructure