Goal
By the end of this guide you will be able to retrieve your contact structure with its fields and tags, and update it to add or modify custom fields.Prerequisites
- An API key with
contacts:writescope (for updating the structure) orcontacts:readscope (for read-only access) - Your API base URL (found on the Settings > API Keys page)
Background
A contact structure defines the schema for your contacts. It includes:- A key name and key type — the primary identifier for contacts (typically “Email” of type “email”)
- Fields — custom fields like First Name, Last Name, Company, Phone, etc.
- Tags — label definitions that can be assigned to contacts
Steps
1. List all contact structures
Retrieve all contact structures in your account.200 OK):
_id values of the fields array are what you use when creating or updating contacts and when searching by custom field values.
2. Get a specific contact structure
Retrieve a single contact structure by its ID.200 OK):
3. Update a contact structure
UsePUT to update a contact structure. This replaces the full structure, so include all existing fields plus any changes. Include the current __v value for optimistic concurrency control.
Adding a new “Loyalty Tier” field to an existing structure:
200 OK):
text— free-text stringnumber— numeric valuedate— date valueboolean— true/falserecurrent_date— recurring date (month/day)
predefinedField to map standard fields like firstName, lastName. These enable features like merge tags in email campaigns.
Important notes:
PUTis a full replacement. Include all existing fields you want to keep, or they will be removed.- When adding a new field, omit
_id— the server generates it. - When keeping existing fields, include their
_idto preserve them. - Include the current
__vvalue for optimistic concurrency control. - Removing a field that is referenced by a published signup form will return a
400error with details about which forms are affected.
Common Errors
Next Steps
- Manage Contacts — create contacts using the field IDs from your structure
- Manage Lists — create lists within a contact structure
- Search Contacts — search by custom field values
- Migration from Legacy — set up your structure before importing data