Create a contact
Add a contact to the project, or update it if a contact with that email already exists.
/v1/contactsAPI keyThis call is an upsert keyed on email. When the project has no contact with that address, a new one is created. When it has one, the fields you send are written over it and the fields you leave out are kept. Either way the response is the contact as it is now, with status 201.
Contacts are the people you send broadcasts to. See Contacts.
Body parameters
The contact's address. Stored lowercased and trimmed. Each address appears once per project.
Up to 200 characters. Available in broadcasts as {{first_name}}. On an existing contact, leaving it out or sending null keeps the stored value.
Up to 200 characters. Available in broadcasts as {{last_name}}. On an existing contact, leaving it out or sending null keeps the stored value.
true means broadcasts skip this contact. On an existing contact, leaving it out keeps the stored value, so an upsert never re-subscribes someone by accident.
Any extra values you want in broadcast templates, for example { "plan": "pro" } for {{plan}}. On an existing contact, sending an object replaces the stored one; leaving it out or sending null keeps it.
To clear firstName, lastName or data, use Update a contact, where null does clear the field.
Response
Status 201 with the contact.
The contact ID, for example ct_01K6C1M3R8T2V9X4Z6B7N5P0QA.
The project the contact belongs to.
The lowercased address.
Whether broadcasts skip this contact.
Your extra values.
ISO 8601 time the contact was first created.
ISO 8601 time of the last change.
Errors
| Status | Code | When |
|---|---|---|
| 400 | missing_body | The request has no body. |
| 400 | invalid_body | The body is not JSON, email is not a valid address, or a name is over 200 characters. param names the field. |
See Errors for the full list.