Python
Contacts
Update Contact by ID
Update an existing contact using their ID
PUT
Python
When to Use This
| Scenario | Use this endpoint | Use upsert instead |
|---|---|---|
| Change a contact’s email | Yes | Only if phone number is also provided (upsert falls back to phone matching) |
| Update a known contact by ID | Yes | Either works |
| Create a new contact | No (returns 404) | Yes |
| Update by email/phone match | No | Yes |
How It Works
- Only provided fields are updated — omitted fields are preserved
- Custom fields are deep merged — existing custom fields not included in the request are kept
- Automations are triggered — field change detection and automation triggers work the same as upsert
- Soft-deleted contacts are restored — if the contact was deleted, it will be restored with the provided data
Marketing Consent
Update channel-specific marketing consent for a contact:| Field | Type | Description |
|---|---|---|
email | boolean | Email marketing opt-in (true) or opt-out (false) |
whatsapp | boolean | WhatsApp marketing opt-in (true) or opt-out (false) |
Both fields are optional. Omitting a channel leaves its current consent status unchanged. Setting
true opts the
contact in, false opts them out.Example: Change a Contact’s Email
Common Errors
| Error | Cause | Solution |
|---|---|---|
not_found | No contact with this ID | Verify the contact ID |
unauthorized | Invalid API key | Verify API key in Authorization header |
Related Endpoints
- Get Contact by Email: Look up a contact’s ID by email
- Create or Update Contact: Upsert by email or phone
- Delete Contact: Soft-delete a contact
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Contact ID
Body
application/json