POST /v1/contact
Creates a contact using a phone number as the primary identifier.Request body
The contact’s phone number in E.164 format without the leading +. For example, 15105553344.
The contact’s first name.
The full display name shown in the inbox. Defaults to a combination of first and last if omitted.
The contact’s email address.
Custom field values for this contact. Use the numeric custom field ID as the key and the field value as the value. For example, {"123": "Premium"}. To retrieve available field IDs, call POST /v1/contact-fields.
URL of an image to use as the contact’s avatar.
ID of the user to assign this contact to. Pass -1 to explicitly unassign.
List of tag objects to attach. Each item must have a tag_id integer. Maximum of 5 tags.
Set to true if the contact has opted out of messages.
Response
Integer ID of the newly created contact.
Revision number of the contact record.
UUID of the newly created contact, used with v2 endpoints.
Example
curl -X POST https://api.heymarket.com/v1/contact \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"phone": "15105553344",
"first": "API",
"last": "Contact",
"display_name": "API Contact",
"email": "help@heymarket.com",
"is_opted_out": false
}'
{
"id": 98765,
"rev": 1,
"uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
POST /v2/contact
Creates a contact using one or more contact channels. At least one channel is required.Request body
One or more channel objects that identify how to reach this contact. Each object must include channel_type and channel_id.
channel_type — the channel type: phone, email, facebook, or another supported integration.
channel_id — the value for that channel, such as a phone number or email address.
The contact’s first name.
The full display name shown in the inbox.
The contact’s email address.
Custom field values keyed by numeric field ID string.
URL of an image to use as the contact’s avatar.
ID of the user to assign this contact to. Pass -1 to unassign.
List of tag objects, each with a tag_id integer. Maximum of 5 tags.
Set to true if the contact has opted out of messages.
Response
Integer ID of the newly created contact.
Revision number of the contact record.
UUID of the newly created contact.
Example
curl -X POST https://api.heymarket.com/v2/contact \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contact_channels": [
{
"channel_type": "phone",
"channel_id": "15105553344"
},
{
"channel_type": "email",
"channel_id": "help@heymarket.com"
}
],
"first": "API",
"last": "Contact",
"display_name": "API Contact"
}'
{
"id": 98765,
"rev": 1,
"uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}