1MSG
Reference

Campaigns API

Campaigns API lets you send one message to multiple recipients. A segment can contain up to 500 people by default. To increase the limit to 10,000, contact us at [email protected]. Inbox methods are not covered in this document.

Use the API groups in this order: Segments → Campaigns → Analytics.

1. Segments

Create a segment and add members. Each member requires a name and at least one of phone or bsuid.

2. Campaigns

Create a draft with a channelId the API key can access and a segmentId from the previous step.

Set content.mode to text or template:

  • Text: provide content.text.
  • Template: provide content.templateName and content.language (e.g. en).

For templates:

  • content.params uses the same format as sendTemplate and is forwarded to WABA as-is, supporting header images, body variables, buttons, and carousel cards.
  • content.messageSendTtlSeconds is optional and sets the delivery window in seconds. It belongs alongside params, not inside the template components.

Preview the draft before sending.

To schedule a campaign, set scheduledAt to a future ISO 8601 timestamp with Z or a numeric offset, e.g. 2026-11-01T09:00:00Z. Omit it or set it to null to start sending immediately.

There is no daily message-count setting. Template sends use the channel's tier limit, returned as dailyLimit. Session text messages sent within an open 24-hour window do not count toward this limit.

3. Analytics

Read analytics after sending to track campaign performance:

  • Overall statistics: total messages sent, delivered, read, and replied to.
  • Recipient-level statistics: when each message was sent, delivered and read, when the recipient replied, and their replies — including button clicks and free-text messages.
  • Button statistics: see who clicked each button and when.
  • Error statistics: see which recipients encountered errors and the corresponding error for each phone number.

4. Campaigns webhooks

1MSG sends webhook events to your configured HTTPS URL when segments or campaigns are created or updated, and when a campaign's status changes.

Configure webhooks in Settings → Developer → Webhooks.

Events

  • segment.created — A segment was created. action is segment_created.
  • segment.updated — A segment or its members changed. action can be segment_updated, segment_deleted, member_added, member_updated, member_deleted, or members_replaced. The payload does not identify the affected member.
  • campaign.created — A campaign draft was created. scheduledAt contains the scheduled send time or null.
  • campaign.updated — A campaign draft was updated. scheduledAt contains the scheduled send time or null.
  • campaign.status_changed — The campaign status changed to draft, sending, pause, completed, failed, or scheduled. scheduledAt contains the scheduled send time or null.

Authorization

The key must include the Campaigns scope. Issue it in Settings → Developer → API key.

Authorization: Bearer 1msg_live_…

Segments

Create a segment, then add people. Each member needs a name and a phone in E.164 or a BSUID.

Campaigns

Create a draft, set the template or text, preview, then send or schedule. The daily template cap is the channel tier, not a field on the campaign.

Analytics

Read the send snapshot: who was reached, what they replied, and why a send failed. conversationId is the Inbox dialog. providerConversationId is the provider chat id. messageId and providerMessageId are the same provider message id.