Skip to content
TTopSend

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.
emailstringOptionalExact email match. The value is lowercased and trimmed before comparing (emails are stored lowercased). Takes precedence over search.
attribute_keystringOptionalTop-level custom attribute to match exactly. Must be sent together with attribute_value.
attribute_valuestringOptionalExact value for attribute_key. Case-sensitive, not trimmed. Compared as text, so a stored number 12345 and a stored string "12345" both match 12345.
subscribedbooleanOptionalFilter by subscription status (true or false).
bouncedbooleanOptionalFilter to only contacts that have bounced (true).
limitintegerOptionalNumber of contacts to return (default: 100, max: 1000).
offsetintegerOptionalNumber of contacts to skip for pagination (default: 0).
curl "https://api.topsend.com/api/v1/contacts?search=jane&subscribed=true&limit=10" \
-H "Authorization: Bearer ts_live_abc123"

Exact lookups

Use email or attribute_key + attribute_value to find a specific contact without paging through the list. Both return every exact match, including unsubscribed and bounced contacts (unless you also pass subscribed); deleted contacts are never returned. No match is a 200 with an empty data array and pagination.total of 0. Emails are unique per workspace, so an email lookup returns at most one contact. Attribute values are not unique, so pagination.total greater than 1 means several contacts share that value. The filters can be combined, and results reflect creates and updates immediately.

curl "https://api.topsend.com/api/v1/contacts?email=jane%40example.com" \
-H "Authorization: Bearer ts_live_abc123"
curl "https://api.topsend.com/api/v1/contacts?attribute_key=crm_id&attribute_value=12345" \
-H "Authorization: Bearer ts_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.topsend.com/api/v1/contacts \
-H "Authorization: Bearer ts_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.topsend.com/api/v1/contacts/CONTACT_ID \
-H "Authorization: Bearer ts_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.topsend.com/api/v1/contacts/CONTACT_ID \
-H "Authorization: Bearer ts_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.topsend.com/api/v1/contacts/CONTACT_ID \
-H "Authorization: Bearer ts_live_abc123"
POST
/contacts/bulk-delete

Delete up to 5,000 contacts in one request.

Request Body

NameTypeRequiredDescription
contact_idsstring[]RequiredArray of contact IDs to delete. Maximum 5,000 IDs per request.
curl -X POST https://api.topsend.com/api/v1/contacts/bulk-delete \
-H "Authorization: Bearer ts_live_abc123" \
-H "Content-Type: application/json" \
-d '{
"contact_ids": [
"c1a2b3c4-d5e6-7890-abcd-ef1234567890",
"d2b3c4d5-e6f7-8901-bcde-f23456789012"
]
}'
POST
/contacts/delete-all

Soft-delete all contacts in the workspace. Contacts can be restored within 30 days.

This wipes your entire contact list. You must confirm by sending { "confirm": true } in the body — a request without it returns 400 confirmation_required and deletes nothing. The action is recorded in your workspace activity log.

Body Parameters

NameTypeRequiredDescription
confirmbooleanRequiredMust be true to confirm deleting all contacts.
curl -X POST https://api.topsend.com/api/v1/contacts/delete-all \
-H "Authorization: Bearer ts_live_abc123" \
-H "Content-Type: application/json" \
-d '{"confirm": true}'
GET
/contacts/duplicates

Find contacts that appear in multiple lists. Useful for cleaning up overlapping list memberships.

Query Parameters

NameTypeRequiredDescription
list_idstring (uuid)OptionalOnly find duplicates for contacts in this specific list.
limitintegerOptionalNumber of results to return (default: 100, max: 1000).
offsetintegerOptionalNumber of results to skip for pagination (default: 0).
curl "https://api.topsend.com/api/v1/contacts/duplicates?limit=10" \
-H "Authorization: Bearer ts_live_abc123"