Search Omnichannel Contacts

Prev Next
Get
/api/v1/omnichannel/contacts.search

Retrieve a list of omnichannel contacts based on search criteria like name, email or phone number. Permission required: view-livechat-contact.

Note: Ensure to URL-encode special characters such as @, +, /, and * in query parameters to prevent issues with the endpoint. For example, encode email addresses as mail%40example.com instead of [email protected].

Header parameters
X-Auth-Token
stringRequired

The authToken of the authenticated user.

ExampleRScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f
X-User-Id
stringRequired

The userId of the authenticated user.

ExamplerbAXPnMktTFbNpwtJ
Query parameters
offset
integer

Number of items to "skip" in the query, i.e. requests return count items, skipping the first offset items. Refer to the official documentation to learn more.

Example50
count
integer

The number of items to return. Refer to the official documentation to learn more.

Example25
sort
(object)

List of fields to order by, and in which direction. JSON object, with properties listed in desired order, with values of 1 for ascending, or -1 for descending. For example, sort = {"value": -1, "_id": 1}. Refer to the official documentation to learn more.

searchText
string

Text to search for in contact details.

ExampleJohn
unknown
boolean

Filter by contact's unknown status.

ExampleFalse
Responses
200

OK

Example 1
{
  "contacts": [
    {
      "_id": "673be1711e2e6feb77939a7b",
      "createdAt": "2024-11-19T00:53:05.468Z",
      "name": "Boris Doe",
      "emails": [
        {
          "address": "[email protected]"
        }
      ],
      "phones": [],
      "channels": [
        {
          "name": "widget",
          "visitor": {
            "visitorId": "673be2101e2e6feb77939a7f",
            "source": {
              "type": "widget"
            }
          },
          "blocked": false,
          "verified": false,
          "details": {
            "type": "widget",
            "destination": "example.com"
          },
          "lastChat": {
            "_id": "NMee5zFPv62N7RAhh",
            "ts": "2024-11-19T00:55:46.723Z"
          }
        }
      ],
      "customFields": {
        "social-number": "45600-00"
      },
      "unknown": false,
      "_updatedAt": "2024-11-19T00:56:43.140Z",
      "conflictingFields": [],
      "lastChat": {
        "_id": "NMee5zFPv62N7RAhh",
        "ts": "2024-11-19T00:55:46.723Z"
      },
      "contactManager": {
        "_id": "mAwAgmNndK7SHnQ89",
        "name": "Jane",
        "username": "Jane"
      }
    }
  ],
  "count": 1,
  "offset": 0,
  "total": 1,
  "success": true
}
Expand All
object
contacts
Array of object
object
_id
string
createdAt
string
name
string
emails
Array of object
object
address
string
phones
Array of object
object
channels
Array of object
object
name
string
visitor
object
visitorId
string
source
object
type
string
blocked
boolean
verified
boolean
details
object
type
string
destination
string
lastChat
object
_id
string
ts
string
customFields
object
social-number
string
unknown
boolean
_updatedAt
string
conflictingFields
Array of object
object
lastChat
object
_id
string
ts
string
contactManager
object
_id
string
name
string
username
string
count
integer
offset
integer
total
integer
success
boolean
400

Bad Request

Example 1
{
  "success": false,
  "error": "must be number [invalid-params]",
  "errorType": "invalid-params"
}
Example 2
{
  "success": false,
  "error": "must be boolean [invalid-params]",
  "errorType": "invalid-params"
}
object
success
boolean
error
string
errorType
string
401

Unauthorized

Authorization Error
{
  "status": "error",
  "message": "You must be logged in to do this."
}
object
status
string
message
string
403

Forbidden

Permission Error
{
  "success": false,
  "error": "User does not have the permissions required for this action [error-unauthorized]"
}
Unauthorized
{
  "success": false,
  "error": "unauthorized"
}
object
success
boolean
error
string