Steps
Create a contact list
Use the v2 endpoint The response returns the new list’s
POST /v2/lists to create a list. Provide a title, a client-side local_id, and the recipients as contact IDs, phone numbers, or email addresses.curl
id. Use this value in the next step.Send the broadcast
Call
POST /v1/message/send with the list_id from your new list. You must include a local_id when sending to a list — this prevents duplicate sends if you retry the request.curl
Creating a list
ThePOST /v2/lists endpoint is the preferred way to create contact lists.
| Field | Type | Description |
|---|---|---|
title | string | Required. Display name for the list. |
local_id | string | Required. Client-side unique identifier for the list. |
type | string | Use "contacts" for omnichannel lists that support SMS, email, and other channels. |
contacts | array of integers | Contact IDs to add to the list. |
phones | array of strings | Phone numbers to add (E.164 without plus sign). |
emails | array of strings | Email addresses to add. |
Updating a list
UsePUT /v2/lists/{id} to add or remove recipients from an existing list without recreating it.
| Field | Type | Description |
|---|---|---|
add_contacts | array of integers | Contact IDs to add. |
remove_contacts | array of integers | Contact IDs to remove. |
add_phones | array of strings | Phone numbers to add. |
remove_phones | array of strings | Phone numbers to remove. |
add_emails | array of strings | Email addresses to add. |
remove_emails | array of strings | Email addresses to remove. |
Complete example
The following sequence creates a list and immediately sends a broadcast to it.Toll-free numbers are not supported for group MMS broadcasts. Use a standard long-code or short-code number for your sending inbox if you need MMS.
local_id is required when sending to a list. It acts as an idempotency key — if you send the same local_id twice, Heymarket will deduplicate the request.