---
updatedAt: 2026-10-17T17:21:35.000Z
agentTools:
  projectIndex: https://developer.surense.com/llms.txt
---

# Search leads

Searches the leads the caller can access, with filters, sorts and pagination. Supports both offset-based (startRow/endRow) and cursor-based (cursor/pageSize) pagination: cursor-based pagination is used when 'cursor' or 'pageSize' is provided, otherwise offset-based pagination is used. For cursor-based pagination, leave 'cursor' empty for the first page, then pass back 'nextCursor' from the response together with the same sort definitions to fetch the following page. The 'nextCursor' field of the response is only populated for cursor-based pagination. A page holds at most 100 leads.

Filterable and sortable fields are the `fieldName`s returned by `GET /leads/fields`; aliases such as `status`, `owner`, `assignedUser`, `interest`, `source` and `dueDate` are also accepted.

**Authorization:** scope `leads:read`. Only leads the caller can access are returned (owner, assignee, customer managers and their teams, agency-wide permission, sensitive-customer permission), never across tenants.

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "Lead API",
    "description": "Manages leads — sales opportunities linked to a customer — with their types, statuses, checklists,\ntemplates, imports and exports. Every lead belongs to a customer: creating a lead either attaches it\nto an existing customer (by ID, ID number, phone or email) or creates the customer.\n\nAll data is tenant-scoped and never crosses tenants. A lead is visible to the users allowed to\naccess it: owner, assignee, customer managers and their teams, the agency with the agency-wide\npermission, and sensitive customers only with the matching permission. Types, statuses and\ntemplates are tenant-wide settings; imports and exports are visible only to the user who created\nthem.\n\nAuthenticate with an OAuth2 bearer token. Each operation lists the scope it requires; some fields\nadditionally require a user permission, as stated in the operation description. Authorization\nfailures are returned as HTTP 400 with error code 40000, invalid input as HTTP 400 with error code\n40001, and unknown resources as HTTP 404.\n",
    "version": "1.0.20"
  },
  "servers": [
    {
      "url": "https://api.surense.com/api/v1",
      "description": "Production"
    }
  ],
  "security": [
    {
      "oauth2": []
    }
  ],
  "tags": [
    {
      "name": "Leads",
      "description": "Create, read, search, update, duplicate, transfer and delete leads (sales opportunities linked to a customer), and manage the tenant's lead types, lead statuses and lead fields."
    }
  ],
  "paths": {
    "/leads/search": {
      "post": {
        "tags": [
          "Leads"
        ],
        "summary": "Search leads",
        "description": "Searches the leads the caller can access, with filters, sorts and pagination. Supports both offset-based (startRow/endRow) and cursor-based (cursor/pageSize) pagination: cursor-based pagination is used when 'cursor' or 'pageSize' is provided, otherwise offset-based pagination is used. For cursor-based pagination, leave 'cursor' empty for the first page, then pass back 'nextCursor' from the response together with the same sort definitions to fetch the following page. The 'nextCursor' field of the response is only populated for cursor-based pagination. A page holds at most 100 leads.\n\nFilterable and sortable fields are the `fieldName`s returned by `GET /leads/fields`; aliases such as `status`, `owner`, `assignedUser`, `interest`, `source` and `dueDate` are also accepted.\n\n**Authorization:** scope `leads:read`. Only leads the caller can access are returned (owner, assignee, customer managers and their teams, agency-wide permission, sensitive-customer permission), never across tenants.",
        "operationId": "searchLeads",
        "requestBody": {
          "description": "Filters, sorts and pagination (offset: `startRow`/`endRow`; cursor: `cursor`/`pageSize`).",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaginatedOrCursorSearchRequest"
              },
              "examples": {
                "offset": {
                  "summary": "Open leads of a status, newest first (offset pagination)",
                  "description": "offset",
                  "value": {
                    "filters": [
                      {
                        "field": "statusId",
                        "operator": "equals",
                        "value": "8d1f4a6b-2c3e-4f5a-9b7c-6e0d1a2b3c4d"
                      }
                    ],
                    "sorts": [
                      {
                        "field": "createdDate",
                        "dir": "desc"
                      }
                    ],
                    "startRow": 0,
                    "endRow": 50
                  }
                },
                "cursor": {
                  "summary": "First page of leads assigned to a user (cursor pagination)",
                  "description": "cursor",
                  "value": {
                    "filters": [
                      {
                        "field": "assignedUser",
                        "operator": "isAnyOf",
                        "value": [
                          "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f"
                        ]
                      }
                    ],
                    "sorts": [
                      {
                        "field": "leadDate",
                        "dir": "desc"
                      }
                    ],
                    "pageSize": 100
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/CursorSearchResponseLeadValue"
                }
              }
            }
          }
        },
        "security": [
          {
            "oauth2": [
              "leads:read"
            ]
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "ContactPointValue": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Contact point ID (UUID)",
            "format": "uuid",
            "example": "b1c2d3e4-f5a6-4b7c-8d9e-0f1a2b3c4d5e"
          },
          "contactDate": {
            "type": "string",
            "description": "When the submission was received",
            "format": "date-time",
            "example": "2026-10-18T07:30:00Z"
          },
          "externalId": {
            "type": "string",
            "description": "External ID sent with the submission",
            "example": "LP-2026-004512"
          },
          "funnel": {
            "type": "string",
            "description": "Funnel (free text) sent with the submission",
            "example": "Landing page - health insurance"
          },
          "notes": {
            "type": "string",
            "description": "Notes sent with the submission"
          },
          "sourceId": {
            "type": "string",
            "description": "ID (UUID) of the source of the submission",
            "format": "uuid",
            "example": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d"
          },
          "statusId": {
            "type": "string",
            "description": "ID (UUID) of the status requested by the submission",
            "format": "uuid"
          },
          "phoneNumber1": {
            "type": "string",
            "description": "Cell phone sent with the submission",
            "example": "0501234567"
          },
          "phoneNumber2": {
            "type": "string",
            "description": "Additional phone sent with the submission"
          },
          "email": {
            "type": "string",
            "description": "Email sent with the submission",
            "example": "noa.levi@example.com"
          },
          "utmId": {
            "type": "string",
            "description": "UTM ID"
          },
          "utmSource": {
            "type": "string",
            "description": "UTM source",
            "example": "facebook"
          },
          "utmMedium": {
            "type": "string",
            "description": "UTM medium",
            "example": "cpc"
          },
          "utmCampaign": {
            "type": "string",
            "description": "UTM campaign",
            "example": "health-q4-2026"
          },
          "utmTerm": {
            "type": "string",
            "description": "UTM term"
          },
          "utmContent": {
            "type": "string",
            "description": "UTM content"
          }
        },
        "description": "One inbound submission (contact point) recorded on a lead"
      },
      "LeadValue": {
        "type": "object",
        "properties": {
          "tenantId": {
            "type": "string",
            "format": "uuid"
          },
          "agencyId": {
            "type": "string",
            "format": "uuid"
          },
          "createdDate": {
            "type": "string",
            "format": "date-time"
          },
          "createdBy": {
            "type": "string",
            "format": "uuid"
          },
          "creatorName": {
            "type": "string"
          },
          "lastModifiedDate": {
            "type": "string",
            "format": "date-time"
          },
          "lastModifiedBy": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer",
            "format": "int64"
          },
          "id": {
            "type": "string",
            "description": "Lead ID (UUID)",
            "format": "uuid",
            "example": "1b2c3d4e-5f60-4718-8a9b-0c1d2e3f4a5b"
          },
          "number": {
            "type": "integer",
            "description": "Sequential lead number within the tenant",
            "format": "int32",
            "example": 10452
          },
          "externalId": {
            "type": "string",
            "description": "Caller-provided external identifier",
            "example": "LP-2026-004512"
          },
          "documentCount": {
            "type": "integer",
            "description": "Number of documents attached to the lead",
            "format": "int32",
            "example": 2
          },
          "ownerId": {
            "type": "string",
            "description": "ID (UUID) of the user who owns the lead",
            "format": "uuid",
            "example": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f"
          },
          "ownerName": {
            "type": "string",
            "description": "Full name of the owner",
            "example": "דנה כהן"
          },
          "assigneeId": {
            "type": "string",
            "description": "ID (UUID) of the user assigned to the lead",
            "format": "uuid",
            "example": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f"
          },
          "assigneeName": {
            "type": "string",
            "description": "Full name of the assignee",
            "example": "דנה כהן"
          },
          "assignedUserId": {
            "type": "string",
            "description": "Deprecated: same as `assigneeId`",
            "format": "uuid",
            "example": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f",
            "deprecated": true
          },
          "assignedUserName": {
            "type": "string",
            "description": "Deprecated: same as `assigneeName`",
            "example": "דנה כהן",
            "deprecated": true
          },
          "assignedAt": {
            "type": "string",
            "description": "When the current assignee was assigned",
            "format": "date-time",
            "example": "2026-10-18T07:30:00Z"
          },
          "assignedBy": {
            "type": "string",
            "description": "ID (UUID) of the user who assigned the current assignee",
            "format": "uuid",
            "example": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f"
          },
          "interestId": {
            "type": "string",
            "description": "ID (UUID) of the lead type (`typeId`; types were formerly called interests)",
            "format": "uuid",
            "example": "3f2b8c1e-7d4a-4e9b-9c2f-1a6d5e8b7c40"
          },
          "interestName": {
            "type": "string",
            "description": "Title of the lead type",
            "example": "ביטוח בריאות"
          },
          "statusId": {
            "type": "string",
            "description": "ID (UUID) of the lead status",
            "format": "uuid",
            "example": "8d1f4a6b-2c3e-4f5a-9b7c-6e0d1a2b3c4d"
          },
          "statusName": {
            "type": "string",
            "description": "Title of the lead status",
            "example": "בטיפול"
          },
          "statusSuccess": {
            "type": "boolean",
            "description": "Whether the current status is a success status",
            "example": false
          },
          "statusClosed": {
            "type": "boolean",
            "description": "Whether the current status closes the lead",
            "example": false
          },
          "statusDate": {
            "type": "string",
            "description": "When the lead entered its current status",
            "format": "date-time",
            "example": "2026-10-18T07:30:00Z"
          },
          "lastStatusUpdateBy": {
            "type": "string",
            "description": "ID (UUID) of the user who last changed the status",
            "format": "uuid",
            "example": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f"
          },
          "priority": {
            "type": "integer",
            "description": "Lead priority (pin level)",
            "format": "int32",
            "example": 0
          },
          "leadDate": {
            "type": "string",
            "description": "Date-time the lead was received",
            "format": "date-time",
            "example": "2026-10-18T07:30:00Z"
          },
          "successDate": {
            "type": "string",
            "description": "Date the lead reached a success status",
            "format": "date"
          },
          "closedDate": {
            "type": "string",
            "description": "Date the lead was closed",
            "format": "date"
          },
          "closedReason": {
            "type": "string",
            "description": "Reason given when closing the lead"
          },
          "dueDate": {
            "type": "string",
            "description": "Deprecated: date part of `dueAt`",
            "format": "date",
            "example": "2026-10-20"
          },
          "dueTime": {
            "type": "string",
            "description": "Deprecated: time part of `dueAt` (Israel time)",
            "format": "time-local",
            "example": "12:00:00"
          },
          "dueAt": {
            "type": "string",
            "description": "Due date-time for handling the lead",
            "format": "date-time",
            "example": "2026-10-20T09:00:00Z"
          },
          "dueAtTimeSet": {
            "type": "boolean",
            "description": "Whether `dueAt` carries a meaningful time of day",
            "example": true
          },
          "overduePeriod": {
            "type": "string",
            "description": "How long the lead is overdue (ISO-8601 period), when past its due date"
          },
          "sourceId": {
            "type": "string",
            "description": "ID (UUID) of the lead source",
            "format": "uuid",
            "example": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d"
          },
          "existingLead": {
            "type": "boolean",
            "description": "Whether the lead was created for an already existing customer",
            "example": false
          },
          "customerId": {
            "type": "string",
            "description": "ID (UUID) of the lead's customer",
            "format": "uuid",
            "example": "2c4e6a8b-0d1f-4a3c-9e5b-7d9f1b3d5f70"
          },
          "customerManagerId": {
            "type": "string",
            "description": "ID (UUID) of the customer's (first) manager",
            "format": "uuid",
            "example": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f"
          },
          "customerManagers": {
            "type": "array",
            "description": "IDs (UUID) of the customer's managers",
            "items": {
              "type": "string",
              "description": "IDs (UUID) of the customer's managers",
              "format": "uuid"
            }
          },
          "customerSensitive": {
            "type": "boolean",
            "description": "Whether the customer is sensitive (visible only to users with the sensitive-customers permission)",
            "example": false
          },
          "idType": {
            "type": "integer",
            "description": "Customer Identity Type:<br/>1 - ת.ז<br/>2 - דרכון<br/>3 - רישיון נהיגה<br/>4 - אחר<br/>5 - ח.פ<br/>6 - ח.צ",
            "format": "int32",
            "enum": [
              1,
              2,
              3,
              4,
              5,
              6
            ]
          },
          "idNumber": {
            "type": "string",
            "description": "Identity number of the customer",
            "example": "000000018"
          },
          "idCardIssueDate": {
            "type": "string",
            "description": "Israeli ID card issue date",
            "format": "date",
            "example": "2015-06-01"
          },
          "firstName": {
            "type": "string",
            "description": "Customer first name",
            "example": "נועה"
          },
          "lastName": {
            "type": "string",
            "description": "Customer last name",
            "example": "לוי"
          },
          "customerFullName": {
            "type": "string",
            "description": "Customer full name (same as `fullName`)",
            "example": "נועה לוי"
          },
          "fullName": {
            "type": "string",
            "description": "Customer full name (first then last)",
            "example": "נועה לוי"
          },
          "customerFullNameReverse": {
            "type": "string",
            "description": "Customer full name, last name first (same as `fullNameReverse`)",
            "example": "לוי נועה"
          },
          "fullNameReverse": {
            "type": "string",
            "description": "Customer full name, last name first",
            "example": "לוי נועה"
          },
          "cellNumber": {
            "type": "string",
            "description": "Customer cell phone (same as `phoneNumber1`)",
            "example": "0501234567"
          },
          "phoneNumber": {
            "type": "string",
            "description": "Customer additional phone (same as `phoneNumber2`)",
            "example": "036123456"
          },
          "phoneNumber1": {
            "type": "string",
            "description": "Customer cell phone",
            "example": "0501234567"
          },
          "phoneNumber2": {
            "type": "string",
            "description": "Customer additional phone",
            "example": "036123456"
          },
          "email": {
            "type": "string",
            "description": "Customer email",
            "example": "noa.levi@example.com"
          },
          "otherEmail": {
            "type": "string",
            "description": "Customer secondary email"
          },
          "customerStatusId": {
            "type": "string",
            "description": "ID (UUID) of the customer's status",
            "format": "uuid"
          },
          "mailingStatus": {
            "type": "integer",
            "description": "Mailing Status:<br/>1 - אושר דיוור<br/>2 - לא אושר דיוור<br/>3 - הוסר מדיוור<br/>4 - לא התבקש אישור",
            "format": "int32",
            "enum": [
              1,
              2,
              3,
              4
            ]
          },
          "customerDeath": {
            "type": "boolean",
            "description": "Whether the customer is deceased",
            "example": false
          },
          "swiftnessProxyInviteDate": {
            "type": "string",
            "description": "Date the pension clearing-house (Swiftness) power of attorney was sent for signature",
            "format": "date"
          },
          "swiftnessProxySignDate": {
            "type": "string",
            "description": "Date the pension clearing-house power of attorney was signed",
            "format": "date"
          },
          "swiftnessProxyExpired": {
            "type": "boolean",
            "description": "Whether the pension clearing-house power of attorney has expired"
          },
          "lastE9100DataDate": {
            "type": "string",
            "description": "Date of the latest pension clearing-house (E9100) data",
            "format": "date"
          },
          "hbProxyInviteDate": {
            "type": "string",
            "description": "Date the Har HaBituah power of attorney was sent for signature",
            "format": "date"
          },
          "hbProxySignDate": {
            "type": "string",
            "description": "Date the Har HaBituah power of attorney was signed",
            "format": "date"
          },
          "hbProxyExpired": {
            "type": "boolean",
            "description": "Whether the Har HaBituah power of attorney has expired"
          },
          "hbDataDate": {
            "type": "string",
            "description": "Date of the latest Har HaBituah (insurance) data",
            "format": "date"
          },
          "policiesProxyInviteDate": {
            "type": "string",
            "description": "Date the insurance-policies power of attorney was sent for signature",
            "format": "date"
          },
          "policiesProxySignDate": {
            "type": "string",
            "description": "Date the insurance-policies power of attorney was signed",
            "format": "date"
          },
          "street": {
            "type": "string",
            "description": "Street name",
            "example": "הרצל"
          },
          "streetNumber": {
            "type": "string",
            "description": "Street number",
            "example": "12"
          },
          "apartmentNumber": {
            "type": "string",
            "description": "Apartment number",
            "example": "5"
          },
          "postalBox": {
            "type": "integer",
            "description": "Postal box (P.O.B.) number",
            "format": "int32"
          },
          "city": {
            "type": "string",
            "description": "City",
            "example": "תל אביב"
          },
          "postalCode": {
            "type": "integer",
            "description": "Postal (ZIP) code",
            "format": "int32",
            "example": 6100001
          },
          "gender": {
            "type": "integer",
            "description": "Gender:<br/>1 - לא מוגדר<br/>2 - זכר<br/>3 - נקבה",
            "format": "int32",
            "enum": [
              1,
              2,
              3
            ]
          },
          "birthDate": {
            "type": "string",
            "description": "Customer birth date",
            "format": "date",
            "example": "1988-04-12"
          },
          "death": {
            "type": "boolean",
            "description": "Whether the customer is deceased",
            "example": false
          },
          "age": {
            "type": "integer",
            "description": "Age in years",
            "format": "int32",
            "example": 38
          },
          "maritalStatus": {
            "type": "integer",
            "description": "Marital Status:<br/>1 - רווק/ה<br/>2 - נשוי/אה<br/>3 - גרוש/ה<br/>4 - אלמן/ה<br/>5 - ידוע/ה בציבור",
            "format": "int32",
            "enum": [
              1,
              2,
              3,
              4,
              5
            ]
          },
          "profession": {
            "type": "string",
            "description": "Customer profession"
          },
          "monthlyIncome": {
            "type": "integer",
            "description": "Monthly income, in ILS",
            "format": "int32",
            "example": 15000
          },
          "notes": {
            "type": "string",
            "description": "Free-text notes",
            "example": "מעוניינת בבדיקת ביטוח בריאות ופנסיה"
          },
          "unseen": {
            "type": "boolean",
            "description": "Whether the lead has not been viewed yet",
            "example": true
          },
          "employerName": {
            "type": "string",
            "description": "Employer name",
            "example": "אלקטרה"
          },
          "smoker": {
            "type": "boolean",
            "description": "Whether the person smokes",
            "example": false
          },
          "meetingDate": {
            "type": "string",
            "description": "Date of the scheduled meeting",
            "format": "date"
          },
          "meetingTime": {
            "type": "string",
            "description": "Time of the scheduled meeting",
            "format": "time-local"
          },
          "meetingFirstScheduledDate": {
            "type": "string",
            "description": "When a meeting was first scheduled for the lead",
            "format": "date-time"
          },
          "meetingFirstScheduledById": {
            "type": "string",
            "description": "ID (UUID) of the user who first scheduled a meeting",
            "format": "uuid"
          },
          "meetingFirstScheduledByName": {
            "type": "string",
            "description": "Name of the user who first scheduled a meeting"
          },
          "meetingCoordinatedDate": {
            "type": "string",
            "description": "When the meeting was coordinated",
            "format": "date-time"
          },
          "meetingCoordinatedById": {
            "type": "string",
            "description": "ID (UUID) of the user who coordinated the meeting",
            "format": "uuid"
          },
          "meetingCoordinatedByName": {
            "type": "string",
            "description": "Name of the user who coordinated the meeting"
          },
          "meetingLocation": {
            "type": "string",
            "description": "Meeting location"
          },
          "meetingCoordinatorId": {
            "type": "string",
            "description": "ID (UUID) of the meeting coordinator",
            "format": "uuid"
          },
          "meetingCoordinatorName": {
            "type": "string",
            "description": "Name of the meeting coordinator"
          },
          "tags": {
            "type": "array",
            "description": "IDs (UUID) of the lead's tags",
            "items": {
              "type": "string",
              "description": "IDs (UUID) of the lead's tags",
              "format": "uuid"
            }
          },
          "customFields": {
            "uniqueItems": true,
            "type": "array",
            "description": "Custom field values of the lead",
            "items": {
              "$ref": "#/components/schemas/SmartDialogFieldValue"
            }
          },
          "checkLists": {
            "uniqueItems": true,
            "type": "array",
            "description": "Checklists of the lead, in display order",
            "items": {
              "$ref": "#/components/schemas/SmartDialogCheckList"
            }
          },
          "nextItem": {
            "$ref": "#/components/schemas/SmartDialogCheckListItem"
          },
          "lastActivityDate": {
            "type": "string",
            "description": "When the last activity was logged on the lead",
            "format": "date-time"
          },
          "lastActivityBy": {
            "type": "string",
            "description": "ID (UUID) of the user who logged the last activity",
            "format": "uuid"
          },
          "sharable": {
            "type": "boolean",
            "description": "Whether the lead can be shared"
          },
          "appMailAddress": {
            "type": "string",
            "description": "Email address that files emails into this lead"
          },
          "lastExternalPartyId": {
            "type": "string",
            "description": "ID (UUID) of the external party the lead was last transferred to",
            "format": "uuid"
          },
          "lastTransferDate": {
            "type": "string",
            "description": "When the lead was last transferred to an external party",
            "format": "date-time"
          },
          "tromStats": {
            "$ref": "#/components/schemas/TromStats"
          },
          "utmId": {
            "type": "string",
            "description": "UTM ID",
            "example": "utm-4512"
          },
          "utmSource": {
            "type": "string",
            "description": "UTM source",
            "example": "facebook"
          },
          "utmMedium": {
            "type": "string",
            "description": "UTM medium",
            "example": "cpc"
          },
          "utmCampaign": {
            "type": "string",
            "description": "UTM campaign",
            "example": "health-q4-2026"
          },
          "utmTerm": {
            "type": "string",
            "description": "UTM term"
          },
          "utmContent": {
            "type": "string",
            "description": "UTM content"
          },
          "contactPointCount": {
            "type": "integer",
            "description": "Number of contact points (inbound submissions) recorded on the lead",
            "format": "int32",
            "example": 1
          },
          "lastContactPointDate": {
            "type": "string",
            "description": "Date-time of the latest contact point",
            "format": "date-time",
            "example": "2026-10-18T07:30:00Z"
          },
          "contactPoints": {
            "type": "array",
            "description": "Contact-point history, oldest first (returned by single-lead operations; absent in search results)",
            "items": {
              "$ref": "#/components/schemas/ContactPointValue"
            }
          },
          "typeId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "description": "A lead: a sales opportunity linked to a customer, with the customer's details"
      },
      "SmartDialogCheckList": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "position": {
            "type": "integer",
            "format": "int32"
          },
          "items": {
            "uniqueItems": true,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SmartDialogCheckListItem"
            }
          },
          "done": {
            "type": "boolean"
          },
          "doneItems": {
            "type": "integer",
            "format": "int64"
          },
          "todoItems": {
            "type": "integer",
            "format": "int64"
          }
        },
        "description": "Checklists of the lead, in display order"
      },
      "SmartDialogCheckListItem": {
        "required": [
          "description"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "checkListId": {
            "type": "string",
            "format": "uuid"
          },
          "position": {
            "type": "integer",
            "format": "int32"
          },
          "description": {
            "minLength": 1,
            "type": "string"
          },
          "done": {
            "type": "boolean"
          }
        },
        "description": "The next not-done checklist item"
      },
      "SmartDialogFieldValue": {
        "type": "object",
        "properties": {
          "fieldId": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "type": "integer",
            "format": "int32"
          },
          "value": {
            "type": "object"
          }
        },
        "description": "Custom field values of the lead"
      },
      "TromStats": {
        "type": "object",
        "properties": {
          "validityMonth": {
            "type": "string"
          },
          "calculatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "tzvira": {
            "type": "number"
          },
          "tzviraHon": {
            "type": "number"
          },
          "tzviraKitzba": {
            "type": "number"
          },
          "tzviraPitsuim": {
            "type": "number"
          },
          "tzviraPensia": {
            "type": "number"
          },
          "tzviraPensiaVatika": {
            "type": "number"
          },
          "tzviraMenaalim": {
            "type": "number"
          },
          "tzviraHishtalmut": {
            "type": "number"
          },
          "tzviraGemelLeashkaa": {
            "type": "number"
          },
          "tzviraGemel": {
            "type": "number"
          },
          "tzviraGemel190": {
            "type": "number"
          },
          "tzviraHisahonFinansi": {
            "type": "number"
          },
          "tzviraAlternativiim": {
            "type": "number"
          },
          "tzviraNihulTikim": {
            "type": "number"
          },
          "tzviraNezila": {
            "type": "number"
          },
          "hafkadot": {
            "type": "number"
          },
          "hafkadotHishtalmut": {
            "type": "number"
          },
          "hafkadotGemelLeashkaa": {
            "type": "number"
          },
          "dmeiNihulHazuim": {
            "type": "number"
          },
          "revahimMithilatShana": {
            "type": "number",
            "deprecated": true
          },
          "avgNetReturnPercentStartYear": {
            "type": "number"
          },
          "kitzbaHazuyaKolelHafkadot": {
            "type": "number"
          },
          "kitzbaHazuyaLeloHafkadot": {
            "type": "number"
          },
          "kayamHalvaot": {
            "type": "boolean"
          },
          "kayamIkulimShiabudim": {
            "type": "boolean"
          },
          "premia": {
            "type": "number"
          },
          "kayamHaim": {
            "type": "boolean"
          },
          "premiaHaim": {
            "type": "number"
          },
          "kayamHaimMashkanta": {
            "type": "boolean"
          },
          "premiaHaimMashkanta": {
            "type": "number"
          },
          "kayamBriut": {
            "type": "boolean"
          },
          "premiaBriut": {
            "type": "number"
          },
          "kayamMahalotKashot": {
            "type": "boolean"
          },
          "premiaMahalotKashot": {
            "type": "number"
          },
          "kayamTeunotIshiot": {
            "type": "boolean"
          },
          "premiaTeunotIshiot": {
            "type": "number"
          },
          "kayamSiudi": {
            "type": "boolean"
          },
          "premiaSiudi": {
            "type": "number"
          },
          "kayamSiudiKupah": {
            "type": "boolean"
          },
          "kayamAka": {
            "type": "boolean"
          },
          "kayamNehutMiteuna": {
            "type": "boolean"
          },
          "kitzbaNehut": {
            "type": "number"
          },
          "kitzbaLealman": {
            "type": "number"
          },
          "kitzbaLeyetom": {
            "type": "number"
          },
          "kisuiHadPaamiSheerim": {
            "type": "number"
          }
        },
        "description": "Statistics of the lead's pre-meeting (TROM) process"
      },
      "FilterDefinition": {
        "required": [
          "field",
          "operator"
        ],
        "type": "object",
        "properties": {
          "field": {
            "type": "string",
            "description": "Field name to filter by. Available fields can be fetched using GET /{entity}/fields (e.g., /meetings/fields, /workflows/fields, /leads/fields). The field name is shown under `fieldName`",
            "example": "status"
          },
          "value": {
            "type": "object",
            "description": "Filter value. Can be a string or an array of values.",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "operator": {
            "type": "string",
            "description": "Filter operator",
            "example": "equals",
            "enum": [
              "inRange",
              "notInRange",
              "greaterThan",
              "lessThan",
              "equals",
              "isAnyOf",
              "isNoneOf",
              "notEquals",
              "isEmpty",
              "greaterThanOrEqual"
            ]
          },
          "list": {
            "type": "boolean"
          }
        },
        "description": "Filter definition for search criteria"
      },
      "SortDefinition": {
        "required": [
          "field"
        ],
        "type": "object",
        "properties": {
          "field": {
            "type": "string",
            "description": "Field name to sort by. Available fields can be fetched using GET /{entity}/fields (e.g., /meetings/fields, /workflows/fields, /leads/fields). The field name is shown under `fieldName`",
            "example": "name"
          },
          "dir": {
            "type": "string",
            "description": "Sort direction: 'asc' for ascending order, 'desc' for descending order (defaults to 'asc' if not specified)",
            "example": "asc",
            "enum": [
              "asc",
              "desc"
            ]
          }
        },
        "description": "Sort definition for search results"
      },
      "CursorSearchResponseLeadValue": {
        "type": "object",
        "properties": {
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LeadValue"
            }
          },
          "hasNextPage": {
            "type": "boolean"
          },
          "nextCursor": {
            "type": "string"
          },
          "totalElements": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "PaginatedOrCursorSearchRequest": {
        "type": "object",
        "properties": {
          "sorts": {
            "type": "array",
            "description": "List of sort definitions for search results",
            "items": {
              "$ref": "#/components/schemas/SortDefinition"
            }
          },
          "filtersOperator": {
            "type": "string",
            "description": "Operator to combine multiple filters (defaults to 'and' if not specified)",
            "example": "and",
            "enum": [
              "and",
              "or"
            ]
          },
          "filters": {
            "type": "array",
            "description": "List of filter definitions for search criteria",
            "items": {
              "$ref": "#/components/schemas/FilterDefinition"
            }
          },
          "startRow": {
            "minimum": 0,
            "type": "integer",
            "description": "Offset pagination: starting row index (0-based), at most 10000; use cursor pagination to read further (defaults to 0 if not specified)",
            "format": "int32",
            "example": 0
          },
          "endRow": {
            "type": "integer",
            "description": "Offset pagination: ending row index (exclusive). The page size (endRow - startRow) must be less than or equal to 100. (defaults to 50 if not specified)",
            "format": "int32",
            "example": 50
          },
          "cursor": {
            "type": "string",
            "description": "Cursor pagination: opaque cursor identifying the position after which results should be returned. Obtain it from 'nextCursor' of the previous response. Omit or leave null to fetch the first page. The cursor is only valid together with the same sort definitions used to produce it.",
            "example": "WyIyMDI0LTAxLTAxVDAwOjAwOjAwWiIsIjAxOTAtLi4uIl0"
          },
          "pageSize": {
            "maximum": 100,
            "minimum": 1,
            "type": "integer",
            "description": "Cursor pagination: maximum number of rows to return (defaults to 50 if not specified). Providing this field (or 'cursor') switches the request to cursor-based pagination.",
            "format": "int32",
            "example": 50
          }
        },
        "description": "Request for search operations supporting both offset-based (startRow/endRow) and cursor-based (cursor/pageSize) pagination. Cursor-based pagination is used when 'cursor' or 'pageSize' is provided; otherwise offset-based pagination is used."
      }
    },
    "securitySchemes": {
      "oauth2": {
        "type": "oauth2",
        "description": "OAuth2 client credentials. Tokens are issued by the Surense authorization server and presented as `Authorization: Bearer <token>`.",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "https://api.surense.com/oauth/token",
            "scopes": {
              "leads:read": "Read leads, lead types, statuses, templates and checklist templates",
              "leads:create": "Create leads, including bulk creation and duplication",
              "leads:update": "Update leads",
              "leads:delete": "Delete leads",
              "leads:checklists:manage": "Create, edit, reorder and delete lead checklists and their items",
              "global:metadata:manage": "Manage tenant settings such as lead types, statuses and templates",
              "global:import": "Import data from files",
              "global:export": "Export data to files",
              "global:dashboards:read": "Read dashboards"
            }
          }
        }
      }
    }
  }
}
```