Contact Lists
Organize contacts into lists
Manage contact lists
Get all contact lists existing in your account
Pass the API token in the Api-Token
Filter contact lists by name (case-insensitive prefix match).
newsOK.
Returns unauthorized error message. Check your credentials.
Returns forbidden error message. Check your permissions.
Rate limit exceeded for the current account.
Internal error. Retry later or contact support.
curl -X GET https://mailtrap.io/api/contacts/lists \
-H 'Authorization: Bearer YOUR_API_KEY'
# Filter lists by name (case-insensitive prefix match)
curl -X GET 'https://mailtrap.io/api/contacts/lists?search=news' \
-H 'Authorization: Bearer YOUR_API_KEY'
[
{
"id": 26730,
"name": "Customers"
},
{
"id": 26731,
"name": "Old Contacts"
}
]Create new Contact Lists
Pass the API token in the Api-Token
Contact List Created.
Returns unauthorized error message. Check your credentials.
Returns forbidden error message. Check your permissions.
Rate limit exceeded for the current account.
Internal error. Retry later or contact support.
curl -X POST https://mailtrap.io/api/contacts/lists \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"name": "Customers"}'
{
"id": 26730,
"name": "Customers"
}Get a contact list by ID
Pass the API token in the Api-Token
Unique list ID
3229Returns attributes of the contact list.
Returns unauthorized error message. Check your credentials.
Returns forbidden error message. Check your permissions.
Resource not found
Rate limit exceeded for the current account.
Internal error. Retry later or contact support.
curl -X GET https://mailtrap.io/api/contacts/lists/{list_id} \
-H 'Authorization: Bearer YOUR_API_KEY'
{
"id": 26730,
"name": "My Contact List"
}Delete existing Contact List
Pass the API token in the Api-Token
Unique list ID
3229Contact List successfully deleted
No content
Returns unauthorized error message. Check your credentials.
Returns forbidden error message. Check your permissions.
Resource not found
Rate limit exceeded for the current account.
Internal error. Retry later or contact support.
curl -X DELETE https://mailtrap.io/api/contacts/lists/{list_id} \
-H 'Authorization: Bearer YOUR_API_KEY'
No content
Update existing Contact List
Pass the API token in the Api-Token
Unique list ID
3229OK.
Returns unauthorized error message. Check your credentials.
Returns forbidden error message. Check your permissions.
Resource not found
Rate limit exceeded for the current account.
Internal error. Retry later or contact support.
curl -X PATCH https://mailtrap.io/api/contacts/lists/{list_id} \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"name": "Former Customers"}'
{
"id": 26730,
"name": "Former Customers"
}Last updated
Was this helpful?

