Chimes

Chimes let you send notification messages to customers by SMS or email. Use them for receipts, order updates, reminders, and other customer communication that is not part of an authentication flow. For one-time passwords, use the OTP API instead.

The Chime object

A Chime represents one notification sent to one recipient. It stores the message body, recipient details, sender, optional customer reference, and transmission status so you can see exactly what was sent and what happened after delivery was attempted.

Properties

  • Name
    created_at
    Type
    timestamp
    Description

    When this Chime was created for delivery.

  • Name
    custom_data
    Type
    object
    Description

    Your own key-value string pairs for custom data and tracking. Store user IDs, session identifiers, campaign tags, or any context you need for reconciliation and analytics.

  • Name
    customer_id
    Type
    string|null
    Description

    Saved customer used to resolve the recipient when the Chime was sent from a customer record.

  • emailobjectEmail content and safety scan result. Present when the Chime is sent by email.Click or tap to expand
    • Name
      from
      Type
      object
      Description
      Email sender mailbox. The address must be allowed for the application.
    • Name
      headers
      Type
      object
      Description
      Optional provider-neutral headers after validation.
    • Name
      html
      Type
      string|null
      Description
      Optional HTML body. Unsafe HTML is rejected or sanitized before send.
    • Name
      reply_to
      Type
      object|null
      Description
      Optional reply-to mailbox.
    • Name
      safety
      Type
      object|null
      Description
      Safety scan status, reason codes, sanitized HTML, scanned links, scanner name, and content hash.
    • Name
      schema
      Type
      object|null
      Description
      Schema.org JSON-LD markup generated at email send time when the message has enough structured context.
    • Name
      subject
      Type
      string
      Description
      Email subject.
    • Name
      text
      Type
      string
      Description
      Plain-text email body. Required for all email sends.
  • Name
    full_message
    Type
    string
    Description

    Complete SMS message content. Email Chimes also include the provider-neutral email object with subject, text body, optional HTML, safety result, and any generated schema markup.

  • Name
    id
    Type
    string
    Description

    Unique identifier for this Chime—use it for lookups, delivery tracking, and reconciliation.

  • Name
    idempotency_key
    Type
    string
    Description

    Idempotency key used to prevent duplicate sends.

  • Name
    purpose
    Type
    string|null
    Description

    Purpose of this Chime for categorization and analytics. Common values: receipt, notification, marketing, reminder, shipping_update.

  • recipientobjectRecipient contact information.Click or tap to expand
    • Name
      email
      Type
      object
      Description
      Present when recipient type is email.
      View email attributesClick or tap to expand
      • Name
        address
        Type
        string
        Description
        Email address.
    • Name
      name
      Type
      string
      Description
      Recipient name for personalization.
    • Name
      phone
      Type
      object
      Description
      Present when recipient type is phone.
      View phone attributesClick or tap to expand
      • Name
        number
        Type
        string
        Description
        Phone number in international format.
    • Name
      type
      Type
      enum
      Description
      Contact type: phone or email.
  • Name
    sender_id
    Type
    string
    Description

    Sender identifier shown to the recipient. For SMS, this is the sender ID (alphanumeric or short code). For email, this appears in the "From" field.

  • transmissionobjectTransmission details and delivery status. Omitted until a transmission exists.Click or tap to expand
    • Name
      address
      Type
      string
      Description
      Resolved destination address used for the transmission.
    • Name
      created_at
      Type
      timestamp
      Description
      When this transmission was initiated.
    • Name
      delivered_at
      Type
      timestamp|null
      Description
      When the message was delivered to the recipient. null unless status is delivered.
    • Name
      email_events
      Type
      array|null
      Description
      Email delivery events, including event type, occurrence time, recipient, and provider-neutral outcome details when available.
    • Name
      email_failure_code
      Type
      string|null
      Description
      Provider-neutral email failure code when the email transmission fails.
    • Name
      email_failure_reason
      Type
      string|null
      Description
      Human-readable email failure reason when available.
    • Name
      email_status
      Type
      string|null
      Description
      Current email-specific delivery outcome when available.
    • Name
      error
      Type
      string|null
      Description
      Transmission error when status is failed.
    • Name
      failed_at
      Type
      timestamp|null
      Description
      When the transmission failed. null unless status is failed.
    • Name
      id
      Type
      string
      Description
      Transmission identifier.
    • Name
      initialized_at
      Type
      timestamp
      Description
      When this transmission was initialized.
    • Name
      last_email_event_at
      Type
      timestamp|null
      Description
      When the latest recorded email event occurred.
    • Name
      mechanism
      Type
      string
      Description
      Transmission mechanism reported for this message.
    • Name
      sent_at
      Type
      timestamp|null
      Description
      When the message was handed off for delivery. null if not yet sent.
    • Name
      sent_via
      Type
      string|null
      Description
      Delivery medium used—sms or email. null if not yet transmitted.
    • Name
      status
      Type
      string
      Description
      Current transmission status—initialized, sent, delivered, or failed.
    • Name
      suppressed_at
      Type
      timestamp|null
      Description
      When delivery to the email recipient was suppressed.
    • Name
      suppression_reason
      Type
      string|null
      Description
      Provider-neutral reason the email recipient was suppressed.

Stored message template references

Chime send, schedule, and broadcast requests can render a stored message template instead of accepting inline content. Use this shape when the content should come from a published reusable template:

{
  "message_template": {
    "template_id": "mtpl_receipt_ready",
    "variables": {
      "customer_name": "Gloria",
      "receipt_url": "https://yourstore.example/receipts/or_123"
    }
  }
}

message_template.template_id must identify an active template owned by the authenticated application. message_template.variables must satisfy the template's published variable contract. The rendered template channel must match the resolved recipient transport: SMS templates can send only to SMS recipients, and email templates can send only to email recipients.

Provide exactly one content source for the resolved transport. For SMS sends and schedules, use either full_message or an SMS message_template; for SMS broadcasts, use message_template as either raw SMS text or a stored template object. For email sends, schedules, and broadcasts, use either email or an email message_template. Do not combine SMS content and email content in the same request.

Use Render a message template preview before sending production campaigns when variable values come from user or catalog data.


Send Chime

Send one notification immediately. You can address it directly with a phone number or email address, or point to a saved customer and let Commerce use that customer's phone number or email address.

Rules

  • Phone/SMS recipients require exactly one SMS content source: full_message or message_template.
  • Email recipients require exactly one email content source: email or message_template.
  • Do not mix SMS and email content in one Send Chime request.
  • Email content must include subject, text, and from.address. Optional HTML and headers are safety-scanned before delivery.
  • Stored templates must match the resolved recipient transport. SMS recipients require an SMS template; email recipients require an email template.
  • recipient must use exactly one of two shapes: inline recipient (type plus matching phone.number or email.address) or saved customer (transport plus customer_id).
  • recipient cannot include both type and transport.
  • Inline recipients cannot include customer_id.

Required attributes

  • recipientobjectWhere to send the message.Click or tap to expand
    • Name
      customer_id
      Type
      string
      Description
      Required for saved-customer recipients. Pair this with transport.
    • Name
      email
      Type
      object
      Description
      Required when type is email.
      View email attributesClick or tap to expand
      • Name
        address
        Type
        string
        Description
        Email address to notify.
    • Name
      name
      Type
      string
      Description
      Optional recipient name for inline recipients.
    • Name
      phone
      Type
      object
      Description
      Required when type is phone.
      View phone attributesClick or tap to expand
      • Name
        number
        Type
        string
        Description
        Phone number to notify.
    • Name
      transport
      Type
      enum
      Description
      Required for saved-customer recipients. Use sms to send to the customer's phone number or email to send to the customer's email address.
    • Name
      type
      Type
      enum
      Description
      Required for inline recipients. Use phone or email.

Optional attributes

  • Name
    custom_data
    Type
    object
    Description

    Your own key-value string pairs for tracking and reconciliation.

  • Name
    full_message
    Type
    string
    Description

    Complete SMS message content to send. Use this only for phone/SMS recipients when you are not using message_template.

  • message_templateobjectStored template reference. Use this instead of full_message for SMS recipients, or instead of email for email recipients.Click or tap to expand
    • Name
      template_id
      Type
      string
      Description
      ID of a published stored template. The template channel must match the resolved recipient transport.
    • Name
      variables
      Type
      object
      Description
      Values for the template variables. Required variables must be present and valid for their declared types.
  • Name
    purpose
    Type
    string
    Description

    Optional category for this notification, such as receipt, notification, marketing, or reminder.

  • Name
    recipient.customer_id
    Type
    string
    Description

    Saved customer to notify. When provided, Commerce loads the matching phone number or email address from that customer record.

  • request_metaobjectRequest-specific controls that do not change the notification.Click or tap to expand
    • Name
      idempotency_key
      Type
      string
      Description
      Stable key to prevent duplicate sends during retries. You may also send the same value in the Idempotency-Key header. If omitted, Commerce generates a UUIDv7 key for this request.
  • Name
    sender_id
    Type
    string
    Description

    Sender identifier shown to the recipient. If omitted, Commerce uses your default sender.

Email attributes

  • Name
    email.from.address
    Type
    string
    Description

    Sender address. It must be configured as an allowed sender for your application.

  • Name
    email.headers
    Type
    object
    Description

    Optional provider-neutral headers. Header names and values are validated to prevent header injection.

  • Name
    email.html
    Type
    string
    Description

    Optional HTML body. Scripts, event handlers, forms, unsafe URL schemes, data URLs, unsupported tags, and suspicious links are rejected before sending.

  • Name
    email.reply_to
    Type
    string
    Description

    Optional reply-to email address.

  • Name
    email.subject
    Type
    string
    Description

    Email subject. Rejected if it contains header-injection characters.

  • Name
    email.text
    Type
    string
    Description

    Plain-text body. Required so every email has a safe fallback.

To send a Chime to a saved customer, pass recipient.customer_id and choose which contact method to use:

{
  "recipient": {
    "customer_id": "cu_abc123def456",
    "transport": "sms"
  },
  "full_message": "Your order has shipped."
}

To send email to an inline address, use recipient.type: "email" and include the top-level email object:

{
  "recipient": {
    "type": "email",
    "email": {
      "address": "[email protected]"
    },
    "name": "Gloria Kesewaa"
  },
  "email": {
    "subject": "Your receipt from YourBrand",
    "text": "Your receipt is ready. View it at https://yourbrand.example/receipts/or_123.",
    "html": "<p>Your receipt is ready. <a href=\"https://yourbrand.example/receipts/or_123\">View receipt</a>.</p>",
    "from": {
      "name": "YourBrand",
      "address": "[email protected]"
    }
  },
  "purpose": "receipt"
}

To send with a stored template, use the generated template ID and keep variables inside the message_template object:

{
  "recipient": {
    "customer_id": "cu_abc123def456",
    "transport": "sms"
  },
  "message_template": {
    "template_id": "mtpl_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU",
    "variables": {
      "order_number": "OR-12345",
      "tracking_url": "https://track.example.com/OR-12345"
    }
  }
}

The examples below use the saved-customer shape. If you want to address someone directly instead, replace transport and customer_id with type and the matching inline phone or email details.

Request

POST
/chimes/send
curl https://api.zebo.dev/chimes/send \
  -H "Authorization: Bearer $COMMERCE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_meta": {
      "idempotency_key": "chime_ship_or_abc123"
    },
    "recipient": {
      "customer_id": "cu_abc123def456",
      "transport": "sms"
    },
    "full_message": "Your order #OR-12345 has been shipped and will arrive in 2-3 business days.",
    "sender_id": "YourBrand",
    "purpose": "shipping_update",
    "custom_data": {
      "order_id": "or_abc123",
      "fulfillment_id": "ffl_xyz789"
    }
  }'
{
  "chime": {
    "id": "ch_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU",
    "customer_id": "cu_abc123def456",
    "created_at": "2025-12-10T10:30:00Z",
    "full_message": "Your order #OR-12345 has been shipped and will arrive in 2-3 business days. Track at: https://track.example.com/OR-12345",
    "recipient": {
      "type": "phone",
      "phone": {
        "number": "+233544998605"
      },
      "name": "Gloria Kesewaa"
    },
    "sender_id": "YourBrand",
    "purpose": "shipping_update",
    "custom_data": {
      "order_id": "or_abc123",
      "fulfillment_id": "ffl_xyz789"
    },
    "transmission": {
      "created_at": "2025-12-10T10:30:00Z",
      "sent_via": "sms",
      "status": "sent",
      "sent_at": "2025-12-10T10:30:05Z",
      "delivered_at": null,
      "failed_at": null
    }
  }
}

Lookup Chime

Retrieve the complete details of a previously sent Chime by its ID. Returns the full Chime object including transmission status and all custom data you attached during creation. Use this endpoint to track message delivery, verify sends during support requests, and reconcile Chimes with your internal systems.

Required attributes

  • Name
    chime_id
    Type
    string
    Description

    Unique identifier of the Chime to retrieve.

Request

POST
/chimes/lookup
curl https://api.zebo.dev/chimes/lookup \
  -H "Authorization: Bearer $COMMERCE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "chime_id": "ch_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU"
  }'
{
  "chime": {
    "id": "ch_WkPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYU",
    "created_at": "2025-12-10T10:30:00Z",
    "full_message": "Your order #OR-12345 has been shipped and will arrive in 2-3 business days. Track at: https://track.example.com/OR-12345",
    "recipient": {
      "type": "phone",
      "phone": {
        "number": "+233544998605"
      },
      "name": "John Doe"
    },
    "sender_id": "YourBrand",
    "purpose": "shipping_update",
    "custom_data": {
      "order_id": "or_abc123",
      "fulfillment_id": "ffl_xyz789"
    },
    "transmission": {
      "created_at": "2025-12-10T10:30:00Z",
      "sent_via": "sms",
      "status": "delivered",
      "sent_at": "2025-12-10T10:30:05Z",
      "delivered_at": "2025-12-10T10:30:15Z",
      "failed_at": null
    }
  }
}

Page Chimes

Retrieve a page of Chimes for the authenticated application. Results are sorted by created_at in descending order so page 1 contains the newest activity first.

Optional attributes

  • Name
    customer_id
    Type
    string
    Description

    Restrict the page to Chimes associated with this customer.

  • Name
    page_number
    Type
    integer
    Description

    1-based page index to fetch. Defaults to 1 and must stay between 1 and 10.

  • Name
    page_size
    Type
    integer
    Description

    Number of Chimes to return. Defaults to 256 and must stay between 1 and 256.

  • Name
    recipient
    Type
    string
    Description

    Restrict the page to Chimes whose recipient exactly matches this phone number or email address.

You can filter by recipient, customer_id, both, or neither.

The response size is the number of Chimes actually returned in chimes, not the requested page capacity.

Request

POST
/chimes/page
curl https://api.zebo.dev/chimes/page       -H "Authorization: Bearer $COMMERCE_API_KEY"       -H "Content-Type: application/json"       -d '{
    "page_number": 1,
    "page_size": 25,
    "customer_id": "cu_abc123def456"
  }'

Schedule Chime

Schedule one notification or a batch of notifications for future delivery. Each recipient can either describe an inline phone or email contact, or reference a saved customer.

Rules

  • send_after and recipients are required.
  • All recipients in one schedule must resolve to the same transport: SMS or email.
  • SMS schedules require exactly one SMS content source: full_message or message_template.
  • Email schedules require exactly one email content source: email or message_template.
  • Do not mix SMS and email content in one schedule.
  • Stored templates must match the resolved recipient transport.
  • Each recipient must use exactly one of two shapes: inline recipient (type plus matching phone.number or email.address) or saved customer (transport plus customer_id).
  • A recipient cannot include both type and transport.
  • send_after must be in the future.

Required attributes

  • Name
    recipients
    Type
    array
    Description

    Recipient objects. Each object must use either inline contact details (type plus phone.number or email.address) or a saved customer (transport plus customer_id).

  • Name
    send_after
    Type
    timestamp
    Description

    When to send the Chime. Commerce delivers it on or shortly after this time.

Optional attributes

  • Name
    email
    Type
    object
    Description

    Required when recipients resolve to email unless you provide an email message_template. Uses the same subject, text, html, from, reply_to, and headers fields as Send Chime and is safety-scanned before delivery.

  • Name
    full_message
    Type
    string
    Description

    Complete SMS message content to send when the scheduled time arrives. Use this only for SMS schedules when you are not using message_template.

  • message_templateobjectStored template reference. Use this instead of full_message for SMS schedules, or instead of email for email schedules.Click or tap to expand
    • Name
      template_id
      Type
      string
      Description
      ID of a published stored template. The template channel must match the resolved recipient transport.
    • Name
      variables
      Type
      object
      Description
      Values for the template variables. Required variables must be present and valid for their declared types.
  • Name
    purpose
    Type
    string
    Description

    Optional category for this scheduled notification.

  • request_metaobjectRequest-specific controls that do not change the scheduled notification.Click or tap to expand
    • Name
      idempotency_key
      Type
      string
      Description
      Stable key to prevent duplicate schedules during retries. You may also send the same value in the Idempotency-Key header. If omitted, Commerce generates a UUIDv7 key for this request.
  • Name
    sender_id
    Type
    string
    Description

    Sender identifier shown to recipients. If omitted, Commerce uses your default sender.

To schedule for saved customers, include recipients with customer_id and transport:

{
  "recipients": [
    { "customer_id": "cu_abc123def456", "transport": "sms" },
    { "customer_id": "cu_def456ghi789", "transport": "sms" }
  ],
  "full_message": "Reminder: Your appointment starts tomorrow at 10 AM.",
  "send_after": "2025-12-15T10:00:00Z",
  "request_meta": {
    "idempotency_key": "sched_appointment_cu_abc123_2025_12_15"
  }
}

To schedule email for saved customers, set transport: "email" and provide the top-level email object:

{
  "recipients": [
    { "customer_id": "cu_abc123def456", "transport": "email" },
    { "customer_id": "cu_def456ghi789", "transport": "email" }
  ],
  "email": {
    "subject": "Your subscription renews tomorrow",
    "text": "Your subscription renews tomorrow. Update billing at https://yourbrand.example/billing.",
    "from": {
      "address": "[email protected]"
    }
  },
  "send_after": "2025-12-15T10:00:00Z",
  "purpose": "reminder"
}

To schedule with a stored template, use the same message_template object shape used by Send Chime:

{
  "recipients": [
    { "customer_id": "cu_abc123def456", "transport": "email" }
  ],
  "message_template": {
    "template_id": "mtpl_emailRenewal123",
    "variables": {
      "customer_name": "Gloria",
      "renewal_date": "2025-12-16"
    }
  },
  "send_after": "2025-12-15T10:00:00Z",
  "purpose": "reminder"
}

The examples below mix both recipient shapes in the same request.

Request

POST
/chimes/schedule
curl https://api.zebo.dev/chimes/schedule \
  -H "Authorization: Bearer $COMMERCE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "recipients": [
      {
        "customer_id": "cu_abc123def456",
        "transport": "sms"
      },
      {
        "type": "phone",
        "phone": {
          "number": "+233501234567"
        },
        "name": "Backup Contact"
      }
    ],
    "full_message": "Reminder: Your subscription renews tomorrow. Visit https://example.com/billing to update payment details.",
    "send_after": "2025-12-15T09:00:00Z",
    "sender_id": "YourBrand",
    "purpose": "reminder"
  }'
{
  "scheduled_chime": {
    "id": "sch_kPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYUWk",
    "created_at": "2025-12-10T14:30:00Z",
    "customer_ids": [
      "cu_abc123def456"
    ],
    "recipients": [
      "+233544998605",
      "+233501234567"
    ],
    "full_message": "Reminder: Your subscription renews tomorrow. Visit https://example.com/billing to update payment details.",
    "sender_id": "YourBrand",
    "purpose": "reminder",
    "send_after": "2025-12-15T09:00:00Z"
  }
}

Lookup a scheduled Chime

Retrieve a scheduled Chime and check its execution status. Returns the schedule details, IDs of all Chimes created when it executed, and any delivery failures. Use this to track broadcast delivery success, debug failed recipients, or verify cancellation status.

Required attributes

  • Name
    schedule_id
    Type
    string
    Description

    The schedule ID returned when you created the scheduled Chime. Example: sch_kPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYUWk.

Response attributes

  • Name
    chime_ids
    Type
    array
    Description

    IDs created when the schedule executes. Omitted when there are no created Chimes.

  • Name
    errors
    Type
    array
    Description

    Per-recipient execution errors. Omitted when there are no errors.

Request

POST
/schedules/lookup
curl https://api.zebo.dev/schedules/lookup \
  -H "Authorization: Bearer $COMMERCE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "schedule_id": "sch_kPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYUWk"
  }'
{
  "scheduled_chime": {
    "id": "sch_kPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYUWk",
    "recipients": [
      "+233544998605",
      "+233501234567",
      "+233509999999"
    ],
    "content": "Reminder: Your subscription renews tomorrow. Visit https://example.com/billing to update payment details.",
    "sender_id": "YourBrand",
    "purpose": "reminder",
    "send_after": "2025-12-15T09:00:00Z",
    "created_at": "2025-12-10T14:30:00Z",
    "executed_at": "2025-12-15T09:00:03Z",
    "chime_ids": [
      "ch_abc123xyz",
      "ch_def456uvw"
    ],
    "errors": [
      {
        "recipient": "[email protected]",
        "type": "recipient_unreachable",
        "fix_code": "f-change_request_parameters"
      }
    ]
  }
}

Cancel a scheduled Chime

Cancel a pending scheduled Chime before it executes. Prevents message delivery if called before the send_after time. Returns an error if the schedule already executed or was previously canceled. A retry is safe only when it reuses the same Idempotency-Key; a new cancellation request after cancellation returns an error.

Rules

  • Only works on pending schedules (not yet executed)
  • Cannot cancel after executed_at is set
  • Cannot cancel schedules that are already canceled

Required attributes

  • Name
    schedule_id
    Type
    string
    Description

    The schedule ID to cancel. Must be a pending schedule that hasn't executed yet.

Request

POST
/schedules/cancel
curl https://api.zebo.dev/schedules/cancel \
  -H "Authorization: Bearer $COMMERCE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: cancel-schedule-kPvqTrqGsopu07wf" \
  -d '{
    "schedule_id": "sch_kPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYUWk"
  }'
{
  "scheduled_chime": {
    "id": "sch_kPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYUWk",
    "customer_ids": [
      "cu_abc123def456"
    ],
    "recipients": [
      "+233544998605",
      "+233501234567"
    ],
    "content": "Reminder: Your subscription renews tomorrow. Visit https://example.com/billing to update payment details.",
    "sender_id": "YourBrand",
    "purpose": "reminder",
    "send_after": "2025-12-15T09:00:00Z",
    "created_at": "2025-12-10T14:30:00Z",
    "canceled_at": "2025-12-14T16:45:00Z"
  }
}

Broadcast Chimes

Send one message immediately to many recipients. Use this for announcements, updates, or any notification that should go out now to a whole audience.

Rules

  • recipients is required.
  • sender is optional, but providing it is strongly recommended. The API does not apply a default when it is omitted.
  • All recipients in one broadcast must resolve to the same transport: SMS or email.
  • SMS broadcasts require message_template, either as a raw SMS string or a stored template object.
  • Email broadcasts require exactly one email content source: email or a stored message_template object.
  • Do not mix SMS and email content in one broadcast.
  • Stored templates must match the resolved recipient transport.
  • Each recipient must use exactly one of two shapes: inline recipient (type plus matching phone.number or email.address) or saved customer (transport plus customer_id).
  • A recipient cannot include both type and transport.
  • Each recipient receives an individual Chime.

Required attributes

  • Name
    recipients
    Type
    array
    Description

    Recipient objects. Each object must use either inline contact details (type plus phone.number or email.address) or a saved customer (transport plus customer_id).

Optional attributes

  • Name
    email
    Type
    object
    Description

    Required when recipients resolve to email unless you provide an email message_template. Uses the same subject, text, html, from, reply_to, and headers fields as Send Chime and is safety-scanned before delivery.

  • message_templateobjectSMS content or stored template reference.Click or tap to expand
    • Name
      template_id
      Type
      string
      Description
      ID of a published stored template. SMS broadcasts require an SMS template; email broadcasts require an email template.
    • Name
      variables
      Type
      object
      Description
      Values for the template variables. Required variables must be present and valid for their declared types.
  • Name
    sender
    Type
    string
    Description

    Sender identifier shown to recipients. Strongly recommended; no default is applied when omitted.

  • Name
    purpose
    Type
    string
    Description

    Optional category for this broadcast.

  • request_metaobjectRequest-specific controls that do not change the broadcast audience or content.Click or tap to expand
    • Name
      idempotency_key
      Type
      string
      Description
      Stable key to prevent duplicate broadcasts during retries. You may also send the same value in the Idempotency-Key header. If omitted, Commerce generates a UUIDv7 key for this request.

For SMS broadcasts, message_template may be a raw SMS string for legacy inline content or an object with template_id and variables for stored templates. For email broadcasts, message_template must be an object; raw string content is SMS-only.

To broadcast to saved customers, include recipients with customer_id and transport:

{
  "recipients": [
    { "customer_id": "cu_abc123def456", "transport": "email" },
    { "customer_id": "cu_def456ghi789", "transport": "email" }
  ],
  "email": {
    "subject": "Your order has shipped",
    "text": "Your order has shipped. Track it at https://track.shop.example/abc123.",
    "from": {
      "address": "[email protected]"
    }
  },
  "sender": "ShopBrand",
  "request_meta": {
    "idempotency_key": "broadcast_shipping_2025_12_15"
  }
}

To broadcast an email-only campaign, use email recipients and provide the top-level email object:

{
  "recipients": [
    { "customer_id": "cu_abc123def456", "transport": "email" },
    {
      "type": "email",
      "email": {
        "address": "[email protected]"
      },
      "name": "Backup Contact"
    }
  ],
  "email": {
    "subject": "Your order has shipped",
    "text": "Your order #12345 has shipped. Track it at https://track.shop.example/abc123.",
    "from": {
      "address": "[email protected]"
    }
  },
  "sender": "ShopBrand",
  "purpose": "order_notification"
}

To broadcast with a stored template, pass message_template as an object:

{
  "recipients": [
    { "customer_id": "cu_abc123def456", "transport": "email" },
    { "customer_id": "cu_def456ghi789", "transport": "email" }
  ],
  "message_template": {
    "template_id": "mtpl_emailShipping123",
    "variables": {
      "order_number": "OR-12345",
      "tracking_url": "https://track.shop.example/OR-12345"
    }
  },
  "sender": "ShopBrand",
  "purpose": "order_notification"
}

The examples below mix both recipient shapes in the same request.

Request

POST
/chimes/broadcast
curl https://api.zebo.dev/chimes/broadcast \
  -H "Authorization: Bearer $COMMERCE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "recipients": [
      {
        "customer_id": "cu_abc123def456",
        "transport": "email"
      },
      {
        "type": "email",
        "email": {
          "address": "[email protected]"
        },
        "name": "Backup Contact"
      }
    ],
    "email": {
      "subject": "Your order #12345 has shipped",
      "text": "Your order #12345 has shipped. Track it at https://track.shop.com/abc123.",
      "from": {
        "address": "[email protected]"
      }
    },
    "sender": "ShopName",
    "purpose": "order_notification"
  }'
{
  "broadcast": {
    "id": "brc_kPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYUWk",
    "customer_ids": [
      "cu_abc123def456"
    ],
    "recipients": [
      "[email protected]",
      "[email protected]"
    ],
    "email": {
      "subject": "Your order #12345 has shipped",
      "text": "Your order #12345 has shipped. Track it at https://track.shop.com/abc123.",
      "from": {
        "address": "[email protected]"
      }
    },
    "sender_id": "ShopName",
    "purpose": "order_notification",
    "send_after": "2025-12-15T09:00:00Z",
    "created_at": "2025-12-15T09:00:00Z"
  }
}

Lookup a broadcast

Retrieve a broadcast and check its execution status. Returns the broadcast details, IDs of all Chimes created when it executed, and any delivery failures. Use this to track delivery success, debug failed recipients, or verify cancellation status.

Required attributes

  • Name
    broadcast_id
    Type
    string
    Description

    The broadcast ID returned when you created the broadcast. Example: brc_kPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYUWk.

Response attributes

  • Name
    chime_ids
    Type
    array
    Description

    IDs created when the broadcast executes. Omitted when there are no created Chimes.

  • Name
    errors
    Type
    array
    Description

    Per-recipient execution errors. Omitted when there are no errors.

Request

POST
/broadcasts/lookup
curl https://api.zebo.dev/broadcasts/lookup \
  -H "Authorization: Bearer $COMMERCE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "broadcast_id": "brc_kPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYUWk"
  }'
{
  "broadcast": {
    "id": "brc_kPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYUWk",
    "customer_ids": [
      "cu_abc123def456"
    ],
    "recipients": [
      "[email protected]",
      "[email protected]",
      "[email protected]"
    ],
    "content": "Your order #12345 has shipped! Track: https://track.shop.com/abc123",
    "sender_id": "ShopName",
    "purpose": "order_notification",
    "send_after": "2025-12-15T09:00:00Z",
    "created_at": "2025-12-15T09:00:00Z",
    "executed_at": "2025-12-15T09:00:03Z",
    "chime_ids": [
      "ch_abc123xyz",
      "ch_def456uvw"
    ],
    "errors": [
      {
        "recipient": "[email protected]",
        "type": "recipient_unreachable",
        "fix_code": "f-change_request_parameters"
      }
    ]
  }
}

Cancel a broadcast

Cancel a pending broadcast before it executes. Since broadcasts execute within seconds, cancellation only works if called immediately after creation. Returns an error if the broadcast already executed or was previously canceled. A retry is safe only when it reuses the same Idempotency-Key; a new cancellation request after cancellation returns an error.

Rules

  • Only works on pending broadcasts (not yet executed)
  • Cannot cancel after executed_at is set
  • Cannot cancel broadcasts that are already canceled
  • Narrow time window (typically <5 seconds)

Required attributes

  • Name
    broadcast_id
    Type
    string
    Description

    The broadcast ID to cancel. Must be a pending broadcast that hasn't executed yet.

Request

POST
/broadcasts/cancel
curl https://api.zebo.dev/broadcasts/cancel \
  -H "Authorization: Bearer $COMMERCE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: cancel-broadcast-kPvqTrqGsopu07wf" \
  -d '{
    "broadcast_id": "brc_kPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYUWk"
  }'
{
  "broadcast": {
    "id": "brc_kPvqTrqGsopu07wfC7ttoWqmfwt48ZW7BGvYUWk",
    "recipients": [
      "+233544998605",
      "+233501234567"
    ],
    "content": "Your order #12345 has shipped! Track: https://track.shop.com/abc123",
    "sender_id": "ShopName",
    "purpose": "order_notification",
    "send_after": "2025-12-15T09:00:00Z",
    "created_at": "2025-12-15T09:00:00Z",
    "canceled_at": "2025-12-15T09:00:02Z"
  }
}

Was this page helpful?