This endpoint will return a listing of all available email lists for a given site.
GET /lists/
Example Response:
[
{'id': 'JWMBkGx', 'name': 'Demo Newsletter List'},
{'id': 'pDvez0G', 'name': 'Test New List'},
{'id': 'k9BZe9O', 'name': 'Unsubscribed Customers'}
]
This paginated endpoint will return a listing of the contacts that have been added to a given list. This endpoint returns 100 contacts per page. You can find the List ID from the lists page:
GET /lists/LIST_ID/contacts/?page=PAGE_NUMBER
Example Response:
{
"count": 1234,
"next": "https://rj2.rejoiner.com/api/v1/SITE_ID/lists/LIST_ID/contacts/?page=2",
"previous": null,
"results": [
{
"customer": {
"id": "CUSTOMER_ID",
"email": "test@example.com",
"first_name": "Test"
},
"custom_fields": {}
},
{
"customer": {
"id": "CUSTOMER_ID",
"email": "another@example.com",
"first_name": "Another"
},
"custom_fields": {}
},
...
]
}
This endpoint will add a customer to a list, or if the customer already exists, will update the record of that customer with the supplied data. The List ID can be found on the page for the list or via the above Email List endpoint.
POST /lists/LIST_ID/contacts/
Note: The trailing slash at the end of the endpoint is required
Payload Structure:
Param Name | Required | Type | Description |
---|---|---|---|
email |
Yes | String | The email address of the customer |
first_name |
No | String | The first name of the customer |
Any additional params will be treated as strings and added to the custom_fields
of the list contact.
The first_name
param will update the customer's first name across Rejoiner, not just for the given list.
Example Payload:
{
"email": "test@example.com",
"first_name": "Test",
"age": "28",
"another_custom_field": "abc"
}
On a successful request, the response will return a structured response representing the entire list contact.
Example Response:
{
"customer": {
"id": "CUSTOMER_ID",
"email": "test@example.com",
"first_name": "Test"
},
"custom_fields": {
"existing_custom_field": "xyz",
"age": "28",
"another_custom_field": "abc"
}
}
This endpoint will remove a customer from a list.
POST /lists/LIST_ID/contacts/remove/
Note: The trailing slash at the end of the endpoint is required
Payload Structure:
Param Name | Required | Type | Description |
---|---|---|---|
email |
Yes | String | The email address of the customer |
Example Payload:
{"email": "test@example.com"}