POST
/
accounts
/
{account_id}
/
blasts
JavaScript
import Surge from '@surgeapi/node';

const client = new Surge({
  apiKey: 'My API Key',
});

const blast = await client.blasts.create('acct_01j9a43avnfqzbjfch6pygv1td');

console.log(blast.id);
{
  "attachments": [
    {
      "url": "https://example.com/image.jpg"
    }
  ],
  "body": "Join us for our grand opening!",
  "id": "bst_01j9dy8mdzfn3r0e8x1tbdrdrf",
  "name": "Grand Opening Announcement",
  "send_at": "2024-02-01T15:00:00Z"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

account_id
string
required

The account for which the blast should be sent.

Example:

"acct_01j9a43avnfqzbjfch6pygv1td"

Body

application/json

Parameters for creating a Blast

attachments
AttachmentParams · object[]
body
string

The message body.

contacts
string<id>[]
deprecated

Deprecated. Use to instead.

name
string

Optional name for the blast.

segments
string<id>[]
deprecated

Deprecated. Use to instead.

send_at
string<date-time>

When to send the blast. If not provided, sends immediately.

to
(string<id> | string<phone-number>)[]

List of recipients to whom the blast should be sent. This can be a combination of contact IDs, segment IDs, and phone numbers.

Response

Created blast

A Blast is a message sent to multiple recipients at once.

attachments
object[]
body
string

The message body.

id
string

Unique identifier for the object.

name
string

Optional name for the blast.

send_at
string<date-time>

When the blast will be or was sent.