---
title: "Search leads"
method: POST
path: "/lead/search"
tags: ["Lead"]
---

# Search leads

`POST /lead/search`

## Request body

- SearchQueryInput
  - `totalOnly` boolean, nullable
  - `sourceOnlyFast` boolean, nullable
  - `offset` integer, nullable — The offset of the search results.
  - `count` integer, nullable — The count of the search results.
  - `search` string, nullable — The search query.
  - `sourceIds` string[], nullable — The source IDs.
  - `channels` string[], nullable — The channel IDs.
  - `botIds` string[], nullable — The bot IDs.
  - `personaIds` string[], nullable — The persona IDs.
  - `minimumResponses` integer, nullable — The minimum number of responses.
  - `lastMessageDirection` string, nullable — The last message direction.
  - `followUpScheduled` boolean, nullable — Whether the follow up is scheduled.

## Response `200`

Success

- SearchLeadResultDto
  - `leads` LeadDto[], nullable
    - `id` string, nullable
    - `name` string, nullable
    - `contactId` string, nullable
    - `lastMessageTime` string, date-time, nullable
    - `lastMessage` string, nullable
    - `lastMessageDirection` string, nullable
    - `lastMessageBotId` string, nullable
    - `mostRecentFailureReason` string, nullable
    - `mimicSourceId` string, nullable
    - `starred` boolean
    - `unread` boolean
    - `source` LeadSourceDto
      - `name` string, nullable
      - `id` string, nullable
    - `wontRespondUntil` string, date-time, nullable
    - `tags` string[], nullable
    - `fields` LeadFieldDto[], nullable
      - `field` string, nullable
      - `name` string, nullable
      - `value` string, nullable
      - `aiProduced` boolean
    - `instances` BotInstanceDto[], nullable
      - `botId` string, nullable
      - `botVersion` string, nullable
      - `followUpTimezoneKind` string, nullable
      - `followUpTimezone` string, nullable
      - `followUpTime` string, date-time, nullable
      - `isSmartFollowUpTime` boolean
      - `scheduleRespondTime` string, date-time, nullable
  - `total` integer

## Other responses

- `401` — Unauthorized

---

[API](https://skmtc.dev/closebot/apis/closebot-api.md) · [All operations](https://skmtc.dev/closebot/apis/closebot-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/closebot/closebot-api/revisions/da5f5fb58534/schema)
