Subscribers


Fetch subscribers

Return json data about subscribers

URL

/subscribers

Method

GET

URL parameters

Optional:

items=[number] Number of records to return

page=[number] For pagination of results

search=[alphanumeric]

order_by=[first_name | last_name | email | created_at | updated_at]

order=[asc | desc]

subscription_list_id=[alphanumeric] Defaults to all subscribers/default subscription list

Success response

Code:200
Content:

{
"data": [
{
"id": "string",
"type": "subscriber",
"attributes": {
"email": "string",
"first_name": "string",
"last_name": "string",
"unsubscribed": "bool"
}
}
]
}

Fetch subscriber

Return json data about subscriber

URL

/subscribers/:subscriber_id

Method

GET

URL parameters

with_stats true to include aggregate anayltics

Success response

Code:200
Content:

{
"data": {
"id": "string",
"type": "string",
"attributes": {
"email": "string",
"first_name": "string",
"last_name": "string",
"unsubscribed": true,
"created_at": "string",
"updated_at": "string",
"custom_fields": [
{
"subscriber_custom_field_type_id": "string",
"custom_field_name": "string",
"custom_field_value": "string"
}
],
"subscription_lists": [
{
"id": "string",
"name": "string",
"unsubscribed": true
}
],
"statistics": {
"deliveries": 0,
"delivered": 0,
"opened": 0,
"clicked": 0,
"soft_bounced": 0,
"hard_bounced": 0,
"unsubscribed": 0,
"global_unsubscribed": 0
}
}
}
}

Create subscriber

Creates a subscriber record

Adds record to subscription list if specified otherwise adds to all contacts.

URL

/subscribers

Method

POST

Data parameters

{
"subscriber": {
"email": "string", // required - unless phone_number is populated
"phone_number": "e164 formatted string", // required - unless email is populated
"first_name": "string", // optional
"last_name": "string", // optional
"custom_fields": [
{ "your_custom_field_name_1": "your_custom_field_value_1" },
{ "your_custom_field_name_2": "your_custom_field_value_3" }
] // optional and unlimited
},
"subscription_list_id": "string" // optional
}

Success response

Code: 200
Content:

{
"data": {
"id": "string",
"type": "subscriber",
"attributes": {
"email": "string",
"first_name": "string",
"last_name": "string"
}
}
}

Update subscriber

Updates a subscriber record

URL

/subscribers/:subscriber_id

Method

PATCH | PUT

Data parameters

{
"subscriber": {
"email": "string", // optional
"phone_number": "e164 formatted string", //optional
"first_name": "string", // optional
"last_name": "string" // optional
}
}

Success response

Code: 200
Content:

{
"data": {
"id": "string",
"type": "subscriber",
"attributes": {
"email": "string",
"first_name": "string",
"last_name": "string"
}
}
}

Bulk create subscribers

Creates one or more subscriber records

Adds to subscription list if specified, otherwise adds to all contacts

URL

/subscribers_bulk_create

Method

POST

Data parameters

{
"subscribers": [
// required
{
"email": "string", // required
"first_name": "string", // optional
"last_name": "string", // optional
"custom_fields": [
{ "your_custom_field_name_1": "your_custom_field_value_1" },
{ "your_custom_field_name_2": "your_custom_field_value_3" }
] // optional and unlimited
}
],
"subscription_list_id": "string" // optional
}

Success response

Code: 200
Content:

{
"data": {
"num_subscribers_added": "number"
}
}

Bulk delete subscribers

Deletes one or more subscriber records

Removes from subscription list if specified, otherwise removed from all contacts

URL

/subscribers_bulk_delete

Method

DELETE

Data parameters

{
"subscriber_ids": ["string"], // required
"subscription_list_id": "string" // optional
}

Success response

Code: 200
Content:

{}