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
CallGET /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 toPOST /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:- Confirm
name. Copy it fromGET /api/fields. - Confirm
editableis true when you are updating. - Confirm
type, andformatif it is set. Formats run on update. - When
values_enabledis true, send one ofvaluesexactly.Yesdoes not matchyes. An empty string and null skip this check.
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
Create the contact.first_name and last_name are required. email is optional. When you do send email, it is stored lowercased.
Validation and errors
Branch onstatus. 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.
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
valuesis 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 aniskeyfield already used on another contact is undercon_keys, with the messageemail, mobile, or key field already in use in another contact.
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.- 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
fieldsprojection drops any name that is not a field. You get no error. - Each related-contacts field adds
{name}_child_cnt(an integer,0when 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 isFirstorLast, are Unix timestamps. Otherdatevalues areY-m-d.timevalues are ISO 8601.- A
secretfield comes back encrypted.GET /api/contacts/{id}/reveal-secretreturns the plaintextfield_value. Passpublic_keywhen the org requires one.
{ "con_id": "..." } and the message Contact ID Found.
Related values
Related contacts and related custom objects use different keys and different failure rules. The shapes, the 50-link cap, and the listadd / 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.