Skip to content

Contacts

Create, retrieve, update, and delete contacts in your workspace.

GET
/contacts

List all contacts with optional filtering and pagination.

Query Parameters

NameTypeRequiredDescription
searchstringOptionalSearch by email, first name, or last name. Supports multi-word queries.
subscribedbooleanOptionalFilter by subscription status (true or false).
limitintegerOptionalNumber of contacts to return (default: 100, max: 1000).
offsetintegerOptionalNumber of contacts to skip for pagination (default: 0).
curl "https://api.topmail.so/api/v1/contacts?search=jane&subscribed=true&limit=10" \
-H "Authorization: Bearer tm_live_abc123"
POST
/contacts

Create a new contact.

Request Body

NameTypeRequiredDescription
emailstringRequiredEmail address of the contact.
first_namestringOptionalFirst name (max 100 characters).
last_namestringOptionalLast name (max 100 characters).
attributesobjectOptionalCustom key-value attributes for personalization.
subscribedbooleanOptionalSubscription status (default: true).
list_idstring (UUID)OptionalAutomatically add the contact to this list.
curl -X POST https://api.topmail.so/api/v1/contacts \
-H "Authorization: Bearer tm_live_abc123" \
-H "Content-Type: application/json" \
-d '{
"email": "jane@example.com",
"first_name": "Jane",
"last_name": "Doe",
"attributes": {"company": "Acme Inc"},
"subscribed": true
}'
GET
/contacts/:id

Retrieve a single contact by ID, including their list memberships.

curl https://api.topmail.so/api/v1/contacts/CONTACT_ID \
-H "Authorization: Bearer tm_live_abc123"
PATCH
/contacts/:id

Update an existing contact. Only provided fields are modified.

Request Body

NameTypeRequiredDescription
emailstringOptionalUpdated email address.
first_namestring | nullOptionalUpdated first name. Set to null to clear.
last_namestring | nullOptionalUpdated last name. Set to null to clear.
attributesobjectOptionalAttributes to merge with existing values (does not replace).
subscribedbooleanOptionalUpdated subscription status.
curl -X PATCH https://api.topmail.so/api/v1/contacts/CONTACT_ID \
-H "Authorization: Bearer tm_live_abc123" \
-H "Content-Type: application/json" \
-d '{
"first_name": "Janet",
"attributes": {"plan": "pro"}
}'
DELETE
/contacts/:id

Permanently delete a contact.

curl -X DELETE https://api.topmail.so/api/v1/contacts/CONTACT_ID \
-H "Authorization: Bearer tm_live_abc123"
Developer Docs - TopMail