nodestash

Custom Fields

Extend any entity with custom data fields

Custom fields let you add structured data to contacts, companies, deals, and activities. Define field schemas (definitions) and set values per entity.

How It Works

  1. Create a definition — define the field name, type, and which entity it applies to
  2. Set values — attach field values to specific entities
  3. Query — filter and retrieve custom field values

Field Types

TypeDescriptionExample Value
textFree-form text"Enterprise customer"
numberNumeric value42
booleanTrue/falsetrue
dateISO 8601 date"2026-01-15"
selectSingle option from a list"Gold"
multi_selectMultiple options from a list["Gold", "VIP"]
urlURL"https://acme.com"
emailEmail address"admin@acme.com"
phonePhone number"+1-555-0100"

Entity Types

Custom fields can be defined for:

  • contact — added to contacts
  • company — added to companies
  • deal — added to deals
  • activity — added to activities

Create a Field Definition

curl -X POST https://api.nodestash.io/v1/custom-fields \
  -H "Authorization: Bearer $NODESTASH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "entity_type": "contact",
    "name": "VIP Level",
    "slug": "vip_level",
    "field_type": "select",
    "description": "Customer VIP tier",
    "options": ["Platinum", "Gold", "Silver", "Bronze"],
    "is_required": false,
    "display_order": 0
  }'
const field = await client.customFields.definitions.create({
  entity_type: 'contact',
  name: 'VIP Level',
  slug: 'vip_level',
  field_type: 'select',
  description: 'Customer VIP tier',
  options: ['Platinum', 'Gold', 'Silver', 'Bronze'],
  is_required: false,
  display_order: 0,
})

Definition Data Model

FieldTypeDescription
idstringUnique ID with cf_ prefix
entity_typestringcontact, company, deal, or activity
namestringDisplay name (max 200 chars)
slugstringURL-safe identifier (^[a-z][a-z0-9_]*$, max 100 chars)
field_typestringOne of the field types above
descriptionstring | nullField description (max 500 chars)
is_requiredbooleanWhether the field is required
optionsstring[] | nullOptions for select and multi_select types
display_orderintegerDisplay ordering (min 0)
created_atstringISO 8601 timestamp
updated_atstringISO 8601 timestamp

The slug must be unique per workspace and entity type. It cannot be changed after creation.

Set Field Values

Set custom field values on an entity using the slug as the key:

curl -X PUT https://api.nodestash.io/v1/contacts/ct_abc123/custom-fields \
  -H "Authorization: Bearer $NODESTASH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "fields": {
      "vip_level": "Gold",
      "customer_since": "2024-01-15",
      "annual_revenue": 500000
    }
  }'
const values = await client.customFields.values.set('contacts', 'ct_abc123', {
  fields: {
    vip_level: 'Gold',
    customer_since: '2024-01-15',
    annual_revenue: 500000,
  },
})

Setting values is a merge operation — existing field values that aren't included in the request are preserved, not deleted.

Get Field Values

curl https://api.nodestash.io/v1/contacts/ct_abc123/custom-fields \
  -H "Authorization: Bearer $NODESTASH_API_KEY"
const values = await client.customFields.values.get('contacts', 'ct_abc123')

for (const field of values) {
  console.log(`${field.name} (${field.field_type}): ${field.value}`)
}

Response:

{
  "data": [
    {
      "id": "cfv_abc123",
      "type": "custom_field_value",
      "attributes": {
        "field_definition_id": "cf_def456",
        "slug": "vip_level",
        "name": "VIP Level",
        "field_type": "select",
        "value": "Gold"
      }
    },
    {
      "id": "cfv_ghi789",
      "type": "custom_field_value",
      "attributes": {
        "field_definition_id": "cf_jkl012",
        "slug": "annual_revenue",
        "name": "Annual Revenue",
        "field_type": "number",
        "value": 500000
      }
    }
  ],
  "meta": {
    "request_id": "req_abc123def456ghi789jkl012"
  }
}

List Definitions

# All definitions for contacts
curl "https://api.nodestash.io/v1/custom-fields?entity_type=contact" \
  -H "Authorization: Bearer $NODESTASH_API_KEY"
const { data: definitions } = await client.customFields.definitions.list({
  entity_type: 'contact',
})

for (const def of definitions) {
  console.log(`${def.name} (${def.field_type}) — ${def.slug}`)
}

API Reference

On this page