Mailriser Documentation
Overview
Amazon SES
Integrations
Webhooks
Subscribers API
Learn about the Subscribers API and how to use it.
The Subscribers API is the api you can use to fetch your subscribers.
The Subscribers API uses /api/susbscribers
as the base.
Fetch all Subscribers
To fetch all your subscribers in a list, use the /fetch
endpoint.
It requires:
- the list id
Here's an example request in Node:
const key = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX";
const base = "https://mailriser.com/api";
const endpoint = "/subscribers/fetch";
const data = {
listUuid: "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
};
const request = await fetch(base + endpoint, {
method: "POST",
headers: {
Authorization: key,
"Content-Type": "application/json"
},
body: JSON.stringify(data)
});
const response = await request.json();
console.log(response);
{
"success": true,
"data": [
{
"id": 1,
"email": "[email protected]",
"tags": [],
"confirmed": true,
"unsubscribed": false
}
]
}
Add a Subscriber
To add a subscriber to a list, use the /add
endpoint.
It requires:
- the list id
- the subscriber's email
- the subscriber's tags
Here's an example request in Node:
const key = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX";
const base = "https://mailriser.com/api";
const endpoint = "/subscribers/add";
const data = {
listUuid: 0,
email: "",
tagsUuids: []
};
const request = await fetch(base + endpoint, {
method: "POST",
headers: {
Authorization: key,
"Content-Type": "application/json"
},
body: JSON.stringify(data)
});
const response = await request.json();
console.log(response);
Table of Contents