# Find a bot's chats

`POST /service/@id/tinopay/notification-apps/find-chats` · TinoPay, service owner's sign-in token

Step 2: returns `{chats: [{id, title, type}], error}`; pick one `id` as the `endpoint`. Telegram: groups and people that messaged the bot in the last 24 hours; a non-null `error` (the bot is attached to another system's webhook) means entering the ID by hand. Zalo keeps no old messages: the request waits up to about 20 seconds and only catches messages sent to the bot meanwhile (groups: mention the bot); set the HTTP timeout to at least 30 seconds, and `chats` is empty when nothing arrives. Not retried on network errors.

## HTTP request

| Item | Value |
| --- | --- |
| URL | `https://api.tino.vn/service/@id/tinopay/notification-apps/find-chats` |
| Method | `POST` |
| Authentication | the TinoPay service owner's sign-in token (`Authorization: Bearer <token>`); the `/v1` gateway does not expose TinoPay yet |
| Content-Type | `application/json` |

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | int | yes | TinoPay service ID |
| `type` | body | string | — | telegram \| zalo |
| `bot_token` | body | string | — | — |
| `app_id` | body | int | — | — |

## Example request

```bash
curl -X POST "https://api.tino.vn/service/100001/tinopay/notification-apps/find-chats" \
  -H "Authorization: Bearer $TINO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "type": "zalo",
  "bot_token": "<bot_token>"
}'
```

`$TINO_TOKEN` is the TinoPay service owner's sign-in token. Path parameters in the example are sample values.

SDK ([SDK & examples](/en/docs/sdk)): no dedicated function yet, use `client.request("POST", "/service/@id/tinopay/notification-apps/find-chats")`.

## Example response

```json
{
 "data": {
  "chats": [
   {
    "id": "zgr-1a2b3c4d5e6f7a8b9c0d",
    "title": "Nhóm kế toán",
    "type": "group"
   }
  ],
  "error": null
 }
}
```

Sample built from the TinoPay API v1 documentation (Tino relays TinoPay data as is); values are examples.
