This page will help you get started with the Contact API.
Create your first list
Before you can add a contact, you will need to create your first List. A list allows you to group your contacts in one place and define additional custom fields. You can also build segments to better target your audience.
To create a list, you will call the Create a list endpoint along with a name and a default sender.
This call will return you a list object containing an ID. But before you can use this list, you will need to accept our anti-spam policy for that list. You can call the Accept policy for a list endpoint to accept the policy for your new list.
In case you already have a list of contacts, you might want to import it in Cakemail instead of adding it one by one. You can do so by calling the Import contacts endpoint along with your list of contacts.
You now have plenty of contacts in your list. It is important to note that you might have to call this endpoint multiple times as we have a limit to import a maximum of 1,000 contacts at a time.
Display all your contacts
At any time, you can show the contacts of your contact list by calling the Show all contacts in a list endpoint.
This call will return the first 50 contacts of your list who are subscribed. You can change how the pagination is done by using the query parameters Page and Per Page. If you want the Pagination object to also contain the total count of contacts in your list, you can specify the query parameters With Count to be true. Finally the query parameter Filter which is optional can be used to search the list.
Unsubscribe a contact
Although this can be done automatically using our tracking links, there are times where you might want to manage the subscriptions on your side. To remain compliant, you still need to sync the people who unsubscribed on your side with our API. This can be done by calling the Unsubscribe a contact from a list endpoint.