Skip to main content
Every organization defines its own contact fields. A payload that works for one account fails or silently drops keys in another. Read the field list first, then write with the machine names you just received.
New to the envelope, team scope, and HTTP 200 failures? Read API conventions first. The endpoint pages are List fields, List contacts, Get a contact, Create a contact, and Update a contact.

Discover the fields first

Call GET /api/fields for the organization you are about to write. The list is grouped into buckets. Inside a bucket, each field is keyed by its machine name and includes: POST /api/fields/validate checks a field definition (whether that field can be created). It does not check a contact’s value. When an import creates a field, the machine name is the label trimmed, lowercased, with every character outside a-z, 0-9, and _ replaced by _. A name or label that is already taken gets a numeric suffix (2, 3, …). The label name is left unchanged.

Names and labels

Send machine names to POST /api/contacts and PUT /api/contacts/{id}. A label that is not also the machine name is an unknown key.
  • Create rejects the whole request when any key is unknown. The message is The field {key} is invalid. Nothing is saved.
  • Update skips unknown keys and saves the rest.
POST /api/analytics/identify is a different write. It accepts a machine name or a label, and a key that matches nothing creates a field. It is queued, so status: ok does not mean the contact was saved. Use it when you mean that browser-style identify call. Use the contacts endpoints when you need a saved contact and a real error. The default contact list is flat and keyed by machine name. Pass format=v1 on GET /api/contacts when you need that same flat list keyed by label.

Check the field, then write

Before you send a value:
  1. Confirm name. Copy it from GET /api/fields.
  2. Confirm editable is true when you are updating.
  3. Confirm type, and format if it is set. Formats run on update.
  4. When values_enabled is true, send one of values exactly. Yes does not match yes. An empty string and null skip this check.
On update, a field you cannot edit fails the request with field {name} is not editable. Create does not apply that editable check. A related custom object field also requires custom_objects, manage_custom_objects, or manage_custom_records on update. Without one of those, the update fails with the same not-editable message.

Sample payloads

crew_role, hire_date, and site below belong to a sample organization. They are not built-in fields. Replace them with name values from your own GET /api/fields response.
Create the contact. first_name and last_name are required. email is optional. When you do send email, it is stored lowercased.
Update one field. Keys you omit stay as they are. This call does not create a contact when the id is missing.

Validation and errors

Branch on status. Create and update do not report failure the same way, and there is no upsert: POST /api/contacts only creates, and PUT with an unknown id returns HTTP 404 and Contact not found. Create collects field errors first. The required-name rules run only when those field errors are empty, so a bad key hides a missing last_name until you fix the key. A failed create looks like this. data is a one-element list. The inner messages object is keyed by the request field name. The format value is the literal string :message.
A failed update uses the message The contact can not be edited and HTTP 400. The data key is not one shape:
  • A bad type or a format failure is keyed by the field label.
  • A value outside values is keyed by the bucket id, _<bucketId>.
  • A field that is not editable is a string in the list, field {name} is not editable.
  • email, mobile, or an iskey field already used on another contact is under con_keys, with the message email, mobile, or key field already in use in another contact.
If the save fails and the editor recorded no field error, update returns that same message with HTTP 200 and "data": []. Deleting a missing contact, or a contact this organization does not own, is HTTP 200, status: "failed", message The contact can not be deleted. Getting a missing contact is HTTP 200 and Cannot find contact. Uniqueness of email, mobile, and iskey is checked on the default bucket. A phone number that can be parsed is stored on the uniqueness index in E.164. The mobile value saved on the contact is the validated string you sent, not a rewritten E.164 value. Search uses the same split: a value that parses as a phone matches that E.164 index, a value that matches an email matches the lowercased email index, and anything else is a quoted text search. What an unknown filters[...] key does on list is not specified. Send keys you read from GET /api/fields.

Flat list and bucketed get

GET /api/contacts returns a flat object per contact. Custom fields sit next to first_name under their machine names. GET /api/contacts/{id} with the internal id returns buckets. Each bucket has a fields map, and each field includes its metadata plus value.
Bucket id 1165 and crew_role are sample data. Your bucket ids and field names come from GET /api/fields.
A few read rules apply to both calls:
  • Fields the caller cannot see are omitted.
  • On the flat list only, when two buckets share a machine name and the value already stored is a string, the later value is appended with a space. The bucketed get keeps each bucket separate.
  • The fields projection drops any name that is not a field. You get no error.
  • Each related-contacts field adds {name}_child_cnt (an integer, 0 when empty). On the list it sits on the flat contact. On get it sits on the root, beside the bucket ids.
  • created_at, last_seen, last_reply, and any field whose suffix is First or Last, are Unix timestamps. Other date values are Y-m-d. time values are ISO 8601.
  • A secret field comes back encrypted. GET /api/contacts/{id}/reveal-secret returns the plaintext field_value. Pass public_key when the org requires one.
A 10-character id on get is the public portal id. That response is only { "con_id": "..." } and the message Contact ID Found. Related contacts and related custom objects use different keys and different failure rules. The shapes, the 50-link cap, and the list add / remove behavior are in Field types and formats. Form submissions for one person take con_id on GET /api/form/submissions. The filter is applied when con_id is a valid ObjectId, from the query string or the JSON body. The submissions controller uses that same scope for the other submission actions that load records through it.