> For the complete documentation index, see [llms.txt](https://docs.cekat.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cekat.ai/api-documentation/crm/contact/search-contacts.md).

# Search contacts

Finds contacts that match a filter on standard fields, custom properties, or additional fields. Results are sorted by most recently updated.

Call `GET /api/crm/contact/filter-fields` first: it lists every field you can filter on, with its `field_category`, `id`, `type`, and allowed `operations`. Leave out `filter` to list all contacts.

```json
{"openapi":"3.0.3","info":{"title":"Cekat Open API","version":"1.0.0"},"tags":[{"name":"Contact","description":"Contacts are the people your business talks to. Each contact has standard fields (name, phone number, email, and so on) plus **custom properties** that you define as columns on your contact board.\n\n## Custom properties\n1. Call `GET /api/crm/contact/filter-fields` or `GET /api/crm/contact/{id}/property` to see the available properties and their column IDs and types.\n2. Read a contact's values from `crm_column` in `GET /api/crm/contact/{contact_id}`. Values are keyed by property name.\n3. Write values with `PUT /api/crm/contact/{id}/property`, or with `values` when creating a contact.\n4. Create new properties with `POST /api/crm/contact/property`.\n"}],"servers":[{"url":"https://api.cekat.ai","description":"Production"}],"security":[{"CekatApiKey":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"CekatApiKey":{"type":"apiKey","in":"header","name":"api_key","description":"Your business's Cekat API key, from **Settings → Developers & API** in the Cekat dashboard (https://chat.cekat.ai/developers?section=apikeys). Available on the Business and Enterprise plans."},"BearerAuth":{"type":"http","scheme":"bearer","description":"The same Cekat API key, sent as `Authorization: Bearer YOUR_API_KEY`. Accepted only by endpoints under `/api/...`."}},"schemas":{"Contact":{"type":"object","description":"A contact with its standard fields, relations and custom property values. Additional fields may be present.","additionalProperties":true,"properties":{"id":{"type":"string","format":"uuid"},"display_name":{"type":"string"},"phone_number":{"type":"string","nullable":true},"country_code":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"type":{"type":"string","description":"Channel the contact came from, for example `whatsapp`."},"platform_id":{"type":"string","nullable":true},"note":{"type":"string","nullable":true},"additional_data":{"type":"object","nullable":true,"additionalProperties":true},"stage_id":{"type":"string","format":"uuid","nullable":true},"agent_id":{"type":"string","format":"uuid","nullable":true,"description":"The contact owner's agent ID."},"company_id":{"type":"string","format":"uuid","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time","nullable":true},"created_by_name":{"type":"string"},"business":{"$ref":"#/components/schemas/NamedRef"},"stage":{"$ref":"#/components/schemas/NamedRef"},"agent":{"$ref":"#/components/schemas/NamedRef"},"pipeline_status":{"$ref":"#/components/schemas/NamedRef"},"company":{"type":"object","nullable":true,"additionalProperties":true},"conversations":{"type":"array","description":"The contact's conversations, one per inbox.","items":{"type":"object","additionalProperties":true}},"crm_column":{"type":"object","description":"Custom property values, keyed by property (column) name.","additionalProperties":true}}},"NamedRef":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}}},"ApiError":{"type":"object","description":"Error body returned by the `/api/...` endpoints.","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"statusCode":{"type":"integer"},"error":{"type":"object","properties":{"message":{"type":"string"}}},"correlationId":{"type":"string","description":"Request ID. Include it when contacting Cekat support."}}},"RateLimitError":{"type":"object","properties":{"message":{"type":"string"}}}},"responses":{"ApiUnauthorized":{"description":"The API key is missing or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"ApiNotFound":{"description":"The resource was not found or does not belong to your business.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"TooManyRequests":{"description":"Rate limit exceeded. Wait and retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitError"}}}}}},"paths":{"/api/crm/contact/search":{"post":{"tags":["Contact"],"operationId":"SearchContacts","summary":"Search contacts","description":"Finds contacts that match a filter on standard fields, custom properties, or additional fields. Results are sorted by most recently updated.\n\nCall `GET /api/crm/contact/filter-fields` first: it lists every field you can filter on, with its `field_category`, `id`, `type`, and allowed `operations`. Leave out `filter` to list all contacts.\n","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"page":{"type":"integer","minimum":1,"default":1},"limit":{"type":"integer","minimum":1,"maximum":200,"default":200},"filter":{"type":"object","required":["condition","criteria"],"properties":{"condition":{"type":"string","enum":["AND","OR"]},"criteria":{"type":"array","items":{"type":"object","required":["field_category","field_id","operator","value"],"properties":{"field_category":{"type":"string","enum":["primary","crm_column","additional_field"]},"field_id":{"type":"string","description":"The field's `id` from `GET /api/crm/contact/filter-fields`."},"operator":{"type":"string","description":"One of the field's `operations`, for example `is`, `contains`, `before`, `after`, `on_or_before`, or `on_or_after`."},"value":{"description":"Value to compare against."}}}}}}}}}}},"responses":{"200":{"description":"Matching contacts.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"data":{"type":"object","properties":{"contacts":{"type":"array","items":{"$ref":"#/components/schemas/Contact"}},"filter":{"type":"object","nullable":true,"additionalProperties":true,"description":"The filter you sent."},"pagination":{"type":"object","properties":{"page":{"type":"integer"},"limit":{"type":"integer"},"total_items":{"type":"integer"},"total_pages":{"type":"integer"},"has_next_page":{"type":"boolean"},"has_previous_page":{"type":"boolean"}}}}}}}}}},"400":{"description":"The filter, page or limit is invalid, or an operator is not allowed for the field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"$ref":"#/components/responses/ApiUnauthorized"},"404":{"$ref":"#/components/responses/ApiNotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}}}}
```
