Skip to main content

Search contacts

This endpoint will let you search contacts by phone number, name, and associated channel UUID.

Search fields

Each contact must have at least a first name and some contact details like a phone number or an email address.

FieldDescriptionExample
querySearch term to look for.2123334444 or Kate Smith
channel_uuidOptional. Used to search for contacts associated with a connected number using its UUID.WPNCON68a88d95-bad8-4607-9a68-35f72cb64ae0
results_per_pageNumber of results returned per page. This value needs to be between 1 and 100.10
page_numberGet a result set from the given page.1

Invocation

curl --location 'https://api.p.2chat.io/open/contacts/search?query=augusto&results_per_page=30&page_number=0&channel_uuid=' \
--header 'Content-Type: application/json' \
--header 'X-User-API-Key: your_api_key_here'

Response

{
"success": true,
"page": 0,
"count": 2,
"contacts": [
{
"id": 566,
"uuid": "CON5dbf28a9-44f5-4ca2-9eae-fd33b124097a",
"first_name": "Augusto",
"last_name": "Gonzalez",
"channel_uuid": "WPNc568c832-606c-4d50-8092-fc51b5149d16",
"profile_pic_url": "https://2chat-user-data-dev.s3.amazonaws.com/...",
"details": [
{
"id": 566,
"value": "+595981222333",
"type": "WAPH",
"created_at": "2025-03-03T18:43:51Z",
"updated_at": "2025-03-30T08:30:12Z"
}
]
},
{
"id": 978,
"uuid": "CONf3039b0c-67e6-4bef-a9e9-170f0fa7d805",
"first_name": "Carlo",
"last_name": "Saugusto",
"channel_uuid": null,
"profile_pic_url": null,
"details": [
{
"id": 976,
"value": "+595212223333",
"type": "WAPH",
"created_at": "2025-03-03T18:43:51Z"
},
{
"id": 977,
"value": "carlos@test.tld",
"type": "E",
"created_at": "2025-03-03T18:43:51Z"
}
]
}
]
}