nodestash

Contacts

Manage the people your business interacts with

Contacts represent individual people in your CRM. Each contact can have an email, phone number, company association, custom fields, and tags.

Data Model

FieldTypeDescription
idstringUnique ID with ct_ prefix
emailstring | nullEmail address (unique per workspace)
first_namestring | nullFirst name (max 100 chars)
last_namestring | nullLast name (max 100 chars)
phonestring | nullPhone number (max 50 chars)
company_idstring | nullAssociated company ID (co_ prefix)
titlestring | nullJob title (max 200 chars)
sourcestring | nullLead source (max 100 chars)
custom_fieldsobjectCustom field key-value pairs
tagsstring[]Tags for categorization (max 20, each max 50 chars)
created_atstringISO 8601 timestamp
updated_atstringISO 8601 timestamp

Create a Contact

curl -X POST https://api.nodestash.io/v1/contacts \
  -H "Authorization: Bearer $NODESTASH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "jane@acme.com",
    "first_name": "Jane",
    "last_name": "Doe",
    "phone": "+1-555-0100",
    "title": "VP of Engineering",
    "source": "website",
    "tags": ["prospect", "enterprise"]
  }'
const contact = await client.contacts.create({
  email: 'jane@acme.com',
  first_name: 'Jane',
  last_name: 'Doe',
  phone: '+1-555-0100',
  title: 'VP of Engineering',
  source: 'website',
  tags: ['prospect', 'enterprise'],
})

Associate a contact with a company by setting company_id:

curl -X PATCH https://api.nodestash.io/v1/contacts/ct_abc123 \
  -H "Authorization: Bearer $NODESTASH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "company_id": "co_xyz789"
  }'
await client.contacts.update('ct_abc123', {
  company_id: 'co_xyz789',
})

Search and Filter

List contacts with filters for email, name, company, source, and tags:

# Filter by email domain (substring match)
curl "https://api.nodestash.io/v1/contacts?email=acme.com&sort=-created_at&limit=50" \
  -H "Authorization: Bearer $NODESTASH_API_KEY"

# Filter by tags (requires ALL specified tags)
curl "https://api.nodestash.io/v1/contacts?tags=prospect,enterprise" \
  -H "Authorization: Bearer $NODESTASH_API_KEY"
// Filter by email domain
const { data } = await client.contacts.list({
  email: 'acme.com',
  sort: '-created_at',
  limit: 50,
})

// Filter by tags (requires ALL specified tags)
const { data: tagged } = await client.contacts.list({
  tags: 'prospect,enterprise',
})

// Iterate all contacts matching filters
for await (const contact of client.contacts.listAll({
  source: 'website',
})) {
  console.log(contact.email)
}

Available Filters

ParameterMatch TypeDescription
emailSubstring (case-insensitive)Filter by email
first_nameSubstring (case-insensitive)Filter by first name
last_nameSubstring (case-insensitive)Filter by last name
company_idExactFilter by company
sourceExactFilter by lead source
tagsAll matchComma-separated, contact must have all

Sorting

Use the sort parameter with - prefix for descending:

  • created_at / -created_at
  • updated_at / -updated_at
  • email / -email
  • first_name / -first_name
  • last_name / -last_name

Custom Fields

Add custom data to contacts using Custom Fields:

# Set custom field values
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"
    }
  }'
await client.customFields.values.set('contacts', 'ct_abc123', {
  fields: {
    vip_level: 'Gold',
    customer_since: '2024-01-15',
  },
})

API Reference

On this page