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
FieldTypeStatusFormatNotes
countint
read-only optional
-Total number of matching contacts.
pageint
read-only optional
-Zero-based page index.
per_pageint
read-only optional
-Results per page.
dataobject
required
--
data.iduuid
read-only optional
uuidContact ID (UUID).
data.first_namestring
required
--
data.last_namestring
required
--
data.emailstring
required
email-
data.tag_iduuid
read-only optional
uuidThe tag ID each result is linked to.
data.companystring
optional nullable
--
data.ownerstring
required
--
data.last_activityISO 8601 datetime
read-only optional nullable
date-timeMost recent activity timestamp for the contact, if any.