Contacts
Create, retrieve, update, and delete contacts in your workspace.
/contactsList all contacts with optional filtering and pagination.
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| search | string | Optional | Search by email, first name, or last name. Supports multi-word queries. |
| string | Optional | Exact email match. The value is lowercased and trimmed before comparing (emails are stored lowercased). Takes precedence over search. | |
| attribute_key | string | Optional | Top-level custom attribute to match exactly. Must be sent together with attribute_value. |
| attribute_value | string | Optional | Exact value for attribute_key. Case-sensitive, not trimmed. Compared as text, so a stored number 12345 and a stored string "12345" both match 12345. |
| subscribed | boolean | Optional | Filter by subscription status (true or false). |
| bounced | boolean | Optional | Filter to only contacts that have bounced (true). |
| limit | integer | Optional | Number of contacts to return (default: 100, max: 1000). |
| offset | integer | Optional | Number 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"
/contactsCreate a new contact.
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| string | Required | Email address of the contact. | |
| first_name | string | Optional | First name (max 100 characters). |
| last_name | string | Optional | Last name (max 100 characters). |
| attributes | object | Optional | Custom key-value attributes for personalization. |
| subscribed | boolean | Optional | Subscription status (default: true). |
| list_id | string (UUID) | Optional | Automatically 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}'
/contacts/:idRetrieve 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"
/contacts/:idUpdate an existing contact. Only provided fields are modified.
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| string | Optional | Updated email address. | |
| first_name | string | null | Optional | Updated first name. Set to null to clear. |
| last_name | string | null | Optional | Updated last name. Set to null to clear. |
| attributes | object | Optional | Attributes to merge with existing values (does not replace). |
| subscribed | boolean | Optional | Updated 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"}}'
/contacts/:idPermanently delete a contact.
curl -X DELETE https://api.topsend.com/api/v1/contacts/CONTACT_ID \-H "Authorization: Bearer ts_live_abc123"
/contacts/bulk-deleteDelete up to 5,000 contacts in one request.
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| contact_ids | string[] | Required | Array 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"]}'
/contacts/delete-allSoft-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
| Name | Type | Required | Description |
|---|---|---|---|
| confirm | boolean | Required | Must 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}'
/contacts/duplicatesFind contacts that appear in multiple lists. Useful for cleaning up overlapping list memberships.
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| list_id | string (uuid) | Optional | Only find duplicates for contacts in this specific list. |
| limit | integer | Optional | Number of results to return (default: 100, max: 1000). |
| offset | integer | Optional | Number 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"