Skip to Content
sesameSend

Broadcasts

Create and manage Broadcasts

Retrieve a list of broadcasts

GET /broadcasts

Query parameters

NameTypeRequiredDescription
limitintegernoNumber of items to return.
afterstringnoReturn items after this cursor.
beforestringnoReturn items before this cursor.

Example

curl -X GET "$SESAMESEND_URL/broadcasts" \
  -H "Authorization: Bearer $OPENSEND_API_KEY"

Responses

StatusDescription
200OK
{
  "object": "list",
  "has_more": false,
  "data": [
    {
      "id": "e169aa45-1ecf-4183-9955-b1499d5701d3",
      "name": "November announcements",
      "audience_id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
      "segment_id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
      "status": "draft",
      "created_at": "2023-10-06 22:59:55.977+00",
      "scheduled_at": "2023-10-06 22:59:55.977+00",
      "sent_at": "2023-10-06 22:59:55.977+00",
      "topic_id": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e"
    }
  ]
}

Create a broadcast

POST /broadcasts

Body

FieldTypeRequiredDescription
namestringnoName of the broadcast.
segment_idstringyesUnique identifier of the segment this broadcast will be sent to.
audience_idstringnoUse segment_id instead. Unique identifier of the segment this broadcast will be sent to.
fromstringyesThe email address of the sender.
subjectstringyesThe subject line of the email.
reply_tostring[]noThe email addresses to which replies should be sent.
preview_textstringnoThe preview text of the email.
htmlstringnoThe HTML version of the message.
textstringnoThe plain text version of the message.
topic_idstringnoThe topic ID that the broadcast will be scoped to.
sendbooleannoWhether to send the broadcast immediately or keep it as a draft.
scheduled_atstringnoSchedule time to send the broadcast. Can only be used if send is true.

Example

curl -X POST "$SESAMESEND_URL/broadcasts" \
  -H "Authorization: Bearer $OPENSEND_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "segment_id": "string",
  "from": "string",
  "subject": "string",
  "preview_text": "Here are our announcements"
}'

Responses

StatusDescription
201OK
{
  "id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
  "object": "broadcast"
}

Retrieve a single broadcast

GET /broadcasts/{id}

Path parameters

NameTypeRequiredDescription
idstringyesThe Broadcast ID.

Example

curl -X GET "$SESAMESEND_URL/broadcasts/<id>" \
  -H "Authorization: Bearer $OPENSEND_API_KEY"

Responses

StatusDescription
200OK
{
  "id": "e169aa45-1ecf-4183-9955-b1499d5701d3",
  "name": "November announcements",
  "audience_id": null,
  "segment_id": null,
  "from": "Acme <onboarding@resend.dev>",
  "subject": "Hello World",
  "reply_to": [
    "string"
  ],
  "preview_text": "Here are our announcements",
  "status": "draft",
  "created_at": "2023-10-06 22:59:55.977+00",
  "scheduled_at": "2023-10-06 22:59:55.977+00",
  "sent_at": "2023-10-06 22:59:55.977+00",
  "text": "Hello {{{FIRST_NAME|there}}}!",
  "html": "<p>Hello {{{FIRST_NAME|there}}}!</p>",
  "topic_id": "b6d24b8e-af0b-4c3c-be0c-359bbd97381e"
}

Update an existing broadcast

PATCH /broadcasts/{id}

Path parameters

NameTypeRequiredDescription
idstringyesThe Broadcast ID.

Body

FieldTypeRequiredDescription
namestringnoName of the broadcast.
audience_idstringnoUse segment_id instead. Unique identifier of the audience this broadcast will be sent to.
segment_idstringnoUnique identifier of the segment this broadcast will be sent to.
fromstringnoThe email address of the sender.
subjectstringnoThe subject line of the email.
reply_tostring[]noThe email addresses to which replies should be sent.
preview_textstringnoThe preview text of the email.
htmlstringnoThe HTML version of the message.
textstringnoThe plain text version of the message.
topic_idstringnoThe topic ID that the broadcast will be scoped to.

Example

curl -X PATCH "$SESAMESEND_URL/broadcasts/<id>" \
  -H "Authorization: Bearer $OPENSEND_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

Responses

StatusDescription
200OK
{
  "id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
  "object": "broadcast"
}

Remove an existing broadcast that is in the draft status

DELETE /broadcasts/{id}

Path parameters

NameTypeRequiredDescription
idstringyesThe Broadcast ID.

Example

curl -X DELETE "$SESAMESEND_URL/broadcasts/<id>" \
  -H "Authorization: Bearer $OPENSEND_API_KEY"

Responses

StatusDescription
200OK
{
  "id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
  "object": "broadcast",
  "deleted": true
}

Send or schedule a broadcast

POST /broadcasts/{id}/send

Path parameters

NameTypeRequiredDescription
idstringyesThe Broadcast ID.

Body

FieldTypeRequiredDescription
scheduled_atstringnoSchedule email to be sent later. The date should be in ISO 8601 format.

Example

curl -X POST "$SESAMESEND_URL/broadcasts/<id>/send" \
  -H "Authorization: Bearer $OPENSEND_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

Responses

StatusDescription
200OK
{
  "id": "78261eea-8f8b-4381-83c6-79fa7120f1cf"
}

Cancel a broadcast

POST /broadcasts/{id}/cancel

Cancels a broadcast that is queued or scheduled. Canceling a queued broadcast stops it mid-send; emails already sent are not affected, but no further emails will go out.

Path parameters

NameTypeRequiredDescription
idstringyesThe Broadcast ID.

Example

curl -X POST "$SESAMESEND_URL/broadcasts/<id>/cancel" \
  -H "Authorization: Bearer $OPENSEND_API_KEY"

Responses

StatusDescription
200OK
{
  "id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
  "object": "broadcast"
}

Duplicate a broadcast

POST /broadcasts/{id}/duplicate

Creates a new draft broadcast with the same segment, topic, sender, subject, reply-to, preview text, and content as the source. The copy is named after the source with " (copy)" appended, truncated to 70 characters.

Path parameters

NameTypeRequiredDescription
idstringyesThe Broadcast ID.

Example

curl -X POST "$SESAMESEND_URL/broadcasts/<id>/duplicate" \
  -H "Authorization: Bearer $OPENSEND_API_KEY"

Responses

StatusDescription
201Created
{
  "id": "1f85ae38-f5b9-4c1f-8766-667a53970fea",
  "object": "broadcast"
}

Retrieve broadcast recipients

GET /broadcasts/{id}/recipients

Retrieve the recipients of a broadcast for a given event type, such as who opened, clicked, or bounced.

Path parameters

NameTypeRequiredDescription
idstringyesThe Broadcast ID.

Query parameters

NameTypeRequiredDescription
type"sent" | "delivered" | "opened" | "clicked" | "bounced" | "complained" | "unsubscribed" | "suppressed"yesThe recipient event type to filter by.
emailstringnoFilter recipients whose email address contains this value.
bounce_type"permanent" | "transient" | "undetermined"noFilter bounced recipients by bounce type. Only valid when type is bounced.
limitintegernoNumber of items to return.
afterstringnoReturn items after this cursor.
beforestringnoReturn items before this cursor.

Example

curl -X GET "$SESAMESEND_URL/broadcasts/<id>/recipients" \
  -H "Authorization: Bearer $OPENSEND_API_KEY"

Responses

StatusDescription
200OK
{
  "object": "list",
  "has_more": false,
  "data": [
    {
      "id": "b2Zmc2V0OjA",
      "contact_id": "e169aa45-1ecf-4183-9955-b1499d5701d3",
      "email": "ada@example.com",
      "count": 3,
      "bounce_type": "permanent",
      "clicked_links": [
        {}
      ]
    }
  ]
}

GET /broadcasts/{id}/clicked-links

Path parameters

NameTypeRequiredDescription
idstringyesThe Broadcast ID.

Query parameters

NameTypeRequiredDescription
limitintegernoNumber of items to return.
afterstringnoReturn items after this cursor.
beforestringnoReturn items before this cursor.

Example

curl -X GET "$SESAMESEND_URL/broadcasts/<id>/clicked-links" \
  -H "Authorization: Bearer $OPENSEND_API_KEY"

Responses

StatusDescription
200OK
{
  "object": "list",
  "has_more": false,
  "data": [
    {
      "id": "b2Zmc2V0OjA",
      "url": "https://mail.example.com/pricing",
      "clicks": 42,
      "unique_clicks": 30
    }
  ]
}