Campaigns

Endpoints that allow you to work with your campaign.

get
Get Campaigns

https://api.sparkloop.app/v1/campaigns
Returns all of your campaigns. At the moment you're only allowed to have one campaign per Sparkloop account.
Request
Response
Request
Headers
X-Api-Key
required
string
API key
Response
200: OK
Campaigns successfully retrieved.
{
"campaigns": [
{
"uuid": "MF9a78983d1c",
"webhook_url": "https://coolnewsletter.com/webhooks/sparkloop",
"name": "My cool newsletter"
}
]
}
401: Unauthorized
Missing API key
User not found for API key
Missing API key
{ "error": "API key is missing!" }
User not found for API key
{ "error": "User not found!" }

get
Get Campaign

https://api.sparkloop.app/v1/campaigns/:uuid
Returns the campaign.
Request
Response
Request
Path Parameters
uuid
required
string
Campaign's UUID, for example MF9a78983d1c
Headers
X-Api-Key
required
string
API key
Response
200: OK
{
"campaign": {
"uuid": "MF9a78983d1c",
"webhook_url": "https://coolnewsletter.com/webhooks/sparkloop",
"name": "My cool newsletter"
}
}
401: Unauthorized
Missing API key
User not found for API key
Missing API key
{ "error": "API key is missing!" }
User not found for API key
{ "error": "User not found!" }
404: Not Found
{ "error": "Campaign MF9a78983d1c not found!"}

put
Update Campaign

https://api.sparkloop.app/v1/campaigns/:uuid
Updates the campaign
Request
Response
Request
Path Parameters
uuid
required
string
Campaign's UUID, for example MF9a78983d1c
Headers
X-Api-Key
required
string
API key
Body Parameters
name
optional
string
Campaign's name
webhook_url
optional
string
URL where you want to receive Sparkloop webhooks
Response
200: OK
{
"campaign": {
"uuid": "MF9a78983d1c",
"webhook_url": "https://coolnewsletter.com/webhooks/sparkloop",
"name": "Even better campaign name!"
}
}
400: Bad Request
Happens when you try to update the webhook URL to a bad URL.
{ "error": "Validation failed: Webhook url [your webhook url] failed webhook test" }
401: Unauthorized
Missing API key
User not found for API key
Missing API key
{ "error": "API key is missing!" }
User not found for API key
{ "error": "User not found!" }
404: Not Found
{ "error": "Campaign MF9a78983d1c not found!"}