---
title: "Search contacts and messages"
method: GET
path: "/chat/sessions/search"
---

# Search contacts and messages

`GET /chat/sessions/search`

Full-text search across contacts (by name, email, phone) and chat messages. Returns matching contacts and messages with their session IDs. Pass `contact_id` to scope message hits to a single contact — strongly recommended for customer-facing workflows so the response can never leak another customer’s messages.

## Query parameters

- `q` string, required
- `contact_id` string

## Response `200`

Default Response

- SearchPublicResponseDto
  - `contacts` object[], required
    - `id` string, required — Contact ID
    - `name` string, nullable, required — Contact name
    - `email` string, nullable, required — Contact email
    - `phone` string, nullable, required — Contact phone number
  - `messages` object[], required
    - `id` string, required — Message ID
    - `session_id` string, required — Session this message belongs to
    - `message` string, nullable, required — Message content
    - `type` string, required — Message type

## Other responses

- `500` — Internal Server Error

---

[API](https://skmtc.net/open/apis/opencx-api.md) · [All operations](https://skmtc.net/open/apis/opencx-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/open/opencx-api/versions/57b06b52302d/schema)
