Marketing Campaigns

A campaign is any message sent to multiple recipients. While transactional messagesare 1:1 (one message to one recipient triggered by an event), campaigns are 1:many — one message delivered to a list of people or a contact group. Both use the same POST /v1/messages endpoint.

You can target campaigns by passing multiple phone numbers in toNumbers, contact group IDs in groupIds, or both together in the same request.

Send to a contact group

The most common approach. Create groups via the Contact Management API, then target them by ID.

curl --request POST \
     --url https://a.eztexting.com/v1/messages \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --user 'your_username:your_password' \
     --data '{
  "groupIds": [
    "987654"
  ],
  "message": "Flash sale! 20% off all plans this weekend. Use code FLASH20 at checkout. Reply STOP to opt out.",
  "messageType": "SMS",
  "companyName": "Acme Co"
}'

Send to a list of numbers

When your recipient list comes from an external system and you don't need to maintain contact groups in EZ Texting.

curl --request POST \
     --url https://a.eztexting.com/v1/messages \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --user 'your_username:your_password' \
     --data '{
  "toNumbers": [
    "15551234567",
    "15559876543",
    "15551112222"
  ],
  "message": "Your table is ready! Head to the host stand when you arrive.",
  "messageType": "SMS",
  "companyName": "Downtown Grill"
}'

Message templates

Templates let you define reusable campaign content and reference it by ID when sending. Create a template once, then use it across multiple campaigns for consistent branding. Templates require name and message fields, and optionally accept companyName, mediaFileId, and mediaFileUrl.

curl --request POST \
     --url https://a.eztexting.com/v1/message-templates \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --user 'your_username:your_password' \
     --data '{
  "name": "Weekly Newsletter",
  "message": "This week at Acme Co: new features, tips, and a special offer just for subscribers. Details: https://example.com/newsletter",
  "companyName": "Acme Co"
}'

Scheduling

Include sendAt with an ISO 8601 timestamp to schedule a campaign. Omit it to send immediately. Cancel a scheduled campaign with DELETE /v1/messages before it sends. When scheduling for recipients across time zones, consider segmenting your audience into regional groups and scheduling each separately.

MMS campaigns

Set messageType to "MMS" and include media via mediaUrl or mediaFileId. For campaigns, pre-uploading media via POST /v1/media-filesis recommended — when sending to many recipients, an external URL that becomes temporarily unavailable could cause delivery failures.

Campaign reporting

After a campaign sends, use the reporting endpoints to measure performance.

curl --request GET \
     --url https://a.eztexting.com/v1/message-reports/123456789 \
     --header 'accept: application/json' \
     --user 'your_username:your_password'
Report endpointReturns
GET /v1/message-reports/{id}Overall delivery summary (sent, delivered, failed, pending)
.../responses/deliveryPer-recipient delivery statuses
.../responses/engagementOpt-out events and engagement metrics
.../responses/linkPer-link click data

Consent and compliance

TCPA compliance: Marketing messages require express written consent from recipients. A keyword opt-in or web form with clear disclosure qualifies. Failure to obtain proper consent can result in fines of $500–$1,500 per message. Consult your legal team for requirements specific to your use case.
  • Recipients must have explicitly opted in to receive promotional messages
  • Honor opt-outs immediately — STOP is processed automatically by EZ Texting
  • Include your companyName so recipients know who the message is from
  • Include opt-out instructions in your first message to new subscribers
  • Respect quiet hours (typically 8 AM–9 PM in the recipient's time zone)

Error handling

StatusMeaningWhat to do
400Bad RequestCheck required fields. Verify phone number format. Ensure toNumbers and groupIds aren't both present.
401UnauthorizedCredentials invalid or token expired. Refresh your token.
404Not FoundThe message ID, group ID, or keyword doesn't exist.
422UnprocessableA group has no contacts, or all numbers are opted out.
429Rate Limited200 req/min exceeded. Wait for X-Rate-Limit-Retry-After-Milliseconds header value.
500Server ErrorRetry with exponential backoff. Contact support if it persists.

Next steps