Skip to main content
POST
/
lead
/
search
Search leads
curl --request POST \
  --url https://api.closebot.com/lead/search \
  --header 'Content-Type: application/json' \
  --header 'X-CB-KEY: <api-key>' \
  --data '
{
  "totalOnly": true,
  "sourceOnlyFast": true,
  "offset": 123,
  "count": 123,
  "search": "<string>",
  "sourceIds": [
    "<string>"
  ],
  "channels": [
    "<string>"
  ],
  "botIds": [
    "<string>"
  ],
  "personaIds": [
    "<string>"
  ],
  "minimumResponses": 123,
  "lastMessageDirection": "<string>",
  "followUpScheduled": true
}
'
{
  "leads": [
    {
      "id": "<string>",
      "name": "<string>",
      "contactId": "<string>",
      "lastMessageTime": "2023-11-07T05:31:56Z",
      "lastMessage": "<string>",
      "lastMessageDirection": "<string>",
      "lastMessageBotId": "<string>",
      "mostRecentFailureReason": "<string>",
      "mimicSourceId": "<string>",
      "starred": true,
      "unread": true,
      "source": {
        "name": "<string>",
        "id": "<string>"
      },
      "wontRespondUntil": "2023-11-07T05:31:56Z",
      "tags": [
        "<string>"
      ],
      "fields": [
        {
          "field": "<string>",
          "name": "<string>",
          "value": "<string>",
          "aiProduced": true
        }
      ],
      "instances": [
        {
          "botId": "<string>",
          "botVersion": "<string>",
          "followUpTimezoneKind": "<string>",
          "followUpTimezone": "<string>",
          "followUpTime": "2023-11-07T05:31:56Z",
          "isSmartFollowUpTime": true,
          "scheduleRespondTime": "2023-11-07T05:31:56Z"
        }
      ]
    }
  ],
  "total": 123
}

Authorizations

X-CB-KEY
string
header
required

CloseBot API Key Authorization

Body

The search query input.

totalOnly
boolean | null
sourceOnlyFast
boolean | null
offset
integer<int32> | null

The offset of the search results.

count
integer<int32> | null

The count of the search results.

search
string | null

The search query.

sourceIds
string[] | null

The source IDs.

channels
string[] | null

The channel IDs.

botIds
string[] | null

The bot IDs.

personaIds
string[] | null

The persona IDs.

minimumResponses
integer<int32> | null

The minimum number of responses.

lastMessageDirection
string | null

The last message direction.

followUpScheduled
boolean | null

Whether the follow up is scheduled.

Response

Success

leads
object[] | null
total
integer<int32>