Subscribers

post
Create a subscriber

https://api.sparkloop.app/v1/campaigns/:campaign_uuid/subscribers
Request
Response
Request
Path Parameters
campaign_uuid
required
string
Campaign's UUID, for example MF9a78983d1c
Headers
X-Api-Key
required
string
Your API key
Body Parameters
email
required
string
Email
name
optional
string
Name
referrer_code
optional
string
The referral code of the person who referred this subscriber. If Joanne with ref_code joanne123 referred this subscriber, you should set this value to joanne123
ip_address
optional
string
IP Address
user_agent
optional
string
User Agent
utm_source
optional
string
UTM Source
utm_campaign
optional
string
UTM Campaign
created_at
optional
string
Timestamp when subscriber signed up. You can set this value to a date in the past. Expected format: YYYY-MM-DDThh:mm:ssTZD e.g. 2021-03-22T19:20:30+01:00 Where: YYYY = four-digit year MM = two-digit month (01=January, etc.) DD = two-digit day of month (01 through 31) hh = two digits of hour (00 through 23) mm = two digits of minute (00 through 59) ss = two digits of second (00 through 59) s = one or more digits representing a decimal fraction of a second TZD = time zone designator (Z or +hh:mm or -hh:mm)
Response
200: OK
{
"subscriber": {
"uuid": "sub_37775e51c5",
"email": "[email protected]",
"name": "Drago Vrago",
"ref_code": "drago785f",
"referrer_code": "joanne123c",
"referrals_count": 0,
"ip_address": "213.19.137.18",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36",
"origin": "api",
"utm_source": null,
"utm_campaign": null,
"created_at": "2021-03-14T10:34:56.000Z"
}
}
400: Bad Request
Email taken
Email invalid
Email not provided
Email taken
{
"error": "Email has already been taken"
}
Email invalid
{
"error": "Email is invalid"
}
Email not provided
{
"error": "You have to provide at least an email"
}

get
Get subscribers

https://api.sparkloop.app/v1/campaigns/:campaign_uuid/subscribers
Subscribers are ordered descendingly by created_at, meaning the first page shows the latest subscribers.
Request
Response
Request
Path Parameters
campaign_uuid
required
string
Campaign's UUID, for example MF9a78983d1c
Headers
X-Api-Key
required
string
API key
Query Parameters
type
optional
string
Type of subscribers you want to get. Default is all, allowed values are all, referrals, advocates.
per_page
optional
integer
Number of subscribers returned in a single request. Default is 50, max is 200
page
optional
integer
The page you want to get. Default is 1
Response
200: OK
Used query params ?page=2&per_page=3
{
"subscribers": [
{
"uuid": "sub_4bc1056297",
"email": "[email protected]",
"name": null,
"ref_code": "c784ef4f",
"referrer_code": null,
"referrals_count": 0,
"ip_address": null,
"user_agent": null,
"origin": "signup",
"utm_source": null,
"utm_campaign": null,
"created_at": "2021-03-24T11:55:02.113Z"
},
{
"uuid": "sub_869976268c",
"email": "[email protected]",
"name": null,
"ref_code": "d163ac6e",
"referrer_code": null,
"referrals_count": 0,
"ip_address": null,
"user_agent": null,
"origin": "signup",
"utm_source": null,
"utm_campaign": null,
"created_at": "2021-03-24T11:55:02.096Z"
},
{
"uuid": "sub_d4795d06e6",
"email": "[email protected]",
"name": null,
"ref_code": "57b1fae2",
"referrer_code": null,
"referrals_count": 0,
"ip_address": null,
"user_agent": null,
"origin": "api",
"utm_source": null,
"utm_campaign": null,
"created_at": "2021-03-24T11:55:02.066Z"
}
],
"meta": {
"per_page": 3,
"page": 2,
"total_pages": 12,
"total_subscribers": 36
}
}
404: Not Found
Could not find the campaign.
{ "error": "Campaign MF9a7d8983d1c not found!"}

get
Get a subscriber by UUID

https://api.sparkloop.com/v1/campaigns/:campaign_uuid/subscribers/:uuid
Returns a single subscriber.
Request
Response
Request
Path Parameters
uuid
required
string
Subscriber's UUID, for example sub_abcdefg123
campaign_uuid
required
string
Campaign's UUID, for example MF9a78983d1c
Headers
X-Api-Key
optional
string
Your API key
Response
200: OK
{
"subscriber": {
"uuid": "sub_4bc1056297",
"email": "[email protected]",
"name": null,
"ref_code": "c784ef4f",
"referrer_code": null,
"referrals_count": 0,
"ip_address": null,
"user_agent": null,
"origin": "signup",
"utm_source": null,
"utm_campaign": null,
"created_at": "2021-03-24T11:55:02.113Z"
}
}
404: Not Found
Subscriber not found
Campaign not found
Subscriber not found
{
"error": "Subscriber sub_4bc10562d97 not found!"
}
Campaign not found
{
"error": "Campaign MF9a7d8983d1c not found!"
}

get
Get a subscriber by email

https://api.sparkloop.app/v1/campaigns/:campaign_uuid/subscribers
Returns a subscriber by their email.
Request
Response
Request
Path Parameters
campaign_uuid
required
string
Campaign's UUID
Headers
X-Api-Key
optional
string
Your API key
Query Parameters
email
required
string
Subscriber's email
Response
200: OK
{
"subscriber": {
"uuid": "sub_4bc1056297",
"email": "[email protected]",
"name": null,
"ref_code": "c784ef4f",
"referrer_code": null,
"referrals_count": 0,
"ip_address": null,
"user_agent": null,
"origin": "signup",
"utm_source": null,
"utm_campaign": null,
"created_at": "2021-03-24T11:55:02.113Z"
}
}
404: Not Found
Subscriber not found
Campaign not found
Subscriber not found
{
"error": "Subscriber with email [email protected] not found!"
}
Campaign not found
{
"error": "Campaign MF9a7d8983d1c not found!"
}

delete
Delete a subscriber

https://api.sparkloop.app/v1/campaigns/:campaign_uuid/subscribers/:uuid
Request
Response
Request
Path Parameters
uuid
required
string
Subscriber's UUID
campaign_uuid
required
string
Campaign's UUID
Headers
X-Api-Key
required
string
Your API key
Response
200: OK
{
"message": "Successfully deleted subscriber sub_34c8e39cf4"
}
400: Bad Request
{
"error": "Failed to delete subscriber sub_34c8e39ca4"
}
404: Not Found
Subscriber not found
Campaign not found
Subscriber not found
{
"error": "Subscriber sub_34c8e39ca4 not found!"
}
Campaign not found
{
"error": "Campaign MF9a7d8983d1c not found!"
}

put
Update subscriber

https://api.sparkloop.app/v1/campaigns/:campaign_uuid/subscribers/:uuid
At the moment we only allow updating subscriber's status to unsubscribed and back to confirmed.
Request
Response
Request
Path Parameters
uuid
required
string
Subscriber's UUID
campaign_uuid
required
string
Campaign's UUID
Headers
X-Api-Key
required
string
Your API key
Body Parameters
status
required
string
Subscriber's status. Allowed values are unsubscribed and confirmed.
Response
200: OK
Returns the subscriber.
{
"subscriber": {
"uuid": "sub_4da34775cc",
"email": "[email protected]",
"name": "Drago Vrago",
"ref_code": "drago359e",
"referrer_code": null,
"referrals_count": 0,
"ip_address": "12345676543234565432",
"user_agent": null,
"origin": "api",
"utm_source": null,
"utm_campaign": null,
"created_at": "1993-08-30T10:34:56.000Z"
}
}
400: Bad Request
When you try setting status to something other than unsubscribed or confirmed.
Unsupported status
Empty PUT body
Unsupported status
{
"error": "Invalid status!"
}
Empty PUT body
{
"error": "You have to update at least 1 field."
}
404: Not Found
Subscriber not found
Campaign not found
Subscriber not found
{
"error": "Subscriber sub_34c8e39ca4 not found!"
}
Campaign not found
{
"error": "Campaign MF9a7d8983d1c not found!"
}