Search Contacts by Tag
Search what contacts a tag is linked to.
GET
/v2/tag/contacts/tag/search
Query Parameters
search_term string
Term to search for (e.g., 'ABCompany' or 'Josh').
search_by string
Field to search by (e.g., 'company' or 'owner').
tag_id uuid
Required
The tag ID to search against.
page number
Zero-based page index (default 0).
query_amount number
Max results per page (alias for per_page).
cURl example
curl -X GET 'https://lunarsend.com/api/v2/tag/contacts/tag/search?tag_id=a0cb441b-afc6-4b5c-8689-0c4577193f99&page=0&query_amount=20' \
-H 'x-api-key: $LUNARSEND_API_KEY' \
-H 'Accept: application/json'Response
{
"data": [
{
"id": "20de0a85-b09f-41a5-9935-c2746a8f10bb",
"first_name": "Kathy",
"last_name": "",
"email": "kathy@ABLogistics.com",
"tag_id": "a0cb441b-afc6-4b5c-8689-0c4577193f99",
"company": "ABLogistics",
"owner": "Joshua",
"last_activity": "2025-09-29T23:34:54.967+00:00"
},
{
"id": "8cdf49f3-b5fd-4dc5-9a03-78b7debcc8ae",
"first_name": "Ralph",
"last_name": "",
"email": "Ralph@Acme_Logistics.com",
"tag_id": "a0cb441b-afc6-4b5c-8689-0c4577193f99",
"company": "Acme Logistics",
"owner": "Joshua",
"last_activity": "2025-09-01T17:02:12.721+00:00"
}
],
"count": 2,
"page": 0,
"per_page": 20
}Response Fields
| Field | Type | Status | Format | Notes |
|---|---|---|---|---|
| count | int | read-only optional | - | Total number of matching contacts. |
| page | int | read-only optional | - | Zero-based page index. |
| per_page | int | read-only optional | - | Results per page. |
| data | object | required | - | - |
| data.id | uuid | read-only optional | uuid | Contact ID (UUID). |
| data.first_name | string | required | - | - |
| data.last_name | string | required | - | - |
| data.email | string | required | - | |
| data.tag_id | uuid | read-only optional | uuid | The tag ID each result is linked to. |
| data.company | string | optional nullable | - | - |
| data.owner | string | required | - | - |
| data.last_activity | ISO 8601 datetime | read-only optional nullable | date-time | Most recent activity timestamp for the contact, if any. |