List WhatsApp Web chats
Lists chats for a session you own. Each item includes a ready conversationContext. Use type=group for native WhatsApp groups. Hits the live WhatsApp Web provider — keep limit low (max 50).
When to use it. To copy chatId and conversationContext into POST /api/v2/messages/send.
Code example
Correct: Session groups
curl --location 'https://raselsms.com/api/v2/whatsapp-web/chats' \--header 'X-API-Key: YOUR_API_KEY'Incorrect: Incorrect: missing accountId
curl --location 'https://raselsms.com/api/v2/whatsapp-web/chats' \--header 'X-API-Key: YOUR_API_KEY'accountId is required.
Response example
200 — Session groups
{ "success": true, "data": { "accountId": "session-user-whatsapp-1", "chats": [ { "accountId": "session-user-whatsapp-1", "chatId": "120363012345678901@g.us", "kind": "group", "title": "Support group", "phoneNumber": null, "conversationKey": "whatsapp_web:session-user-whatsapp-1:120363012345678901@g.us", "conversationContext": { "moduleType": "whatsapp_web", "accountId": "session-user-whatsapp-1", "chatId": "120363012345678901@g.us" } } ], "nextCursor": null, "hasMore": false }}400 — Incorrect: missing accountId
{ "success": false, "code": "VALIDATION_ERROR", "error": "accountId is required"}accountId is required.
401 — Missing or invalid API key.
{ "success": false, "requestId": "msgreq_1739012345678_abc123", "code": "UNAUTHORIZED", "error": "Missing or invalid API key"}403 — Phone is not verified or the key lacks permission (usually messages:create or api_keys:read).
{ "success": false, "requestId": "msgreq_1739012345678_abc123", "code": "FORBIDDEN", "error": "Phone not verified or missing permission"}429 — Rate limit exceeded. Honor Retry-After when present.
{ "success": false, "requestId": "msgreq_1739012345678_abc123", "code": "RATE_LIMITED", "error": "Rate limit exceeded", "retryAfterSeconds": 30}HTTP request
GET /api/v2/whatsapp-web/chats
Request Headers
| Header | Type | Description |
|---|---|---|
| X-API-Key | string | Your Rasel API key. Send it on every documented request except inbound webhooks. * |
Query parameters
| Field | Type | Description |
|---|---|---|
| accountId | string | WhatsApp Web session name, or Telegram bot id used as conversationContext.accountId. * |
| type | all | direct | group | Filter value. On chats: all, direct, or group. On wallet movements: credit or debit. |
| limit | integer | Page size. Typical range is 1-50 for conversation context and 1-500 for account lists. |
| cursor | string | Opaque pagination cursor from the previous response. |
Response Fields
| Field | Type | Description | Example |
|---|---|---|---|
| success | boolean | True when the operation succeeded, or when at least one batch recipient succeeded. | |
| data | json | Primary payload for list and snapshot endpoints. |
Status Codes
| Status | Description |
|---|---|
| 200 | Success. |
| 400 | Invalid request, validation error, or the resource cannot be used in this state. |
| 401 | Missing or invalid API key. |
| 403 | Phone not verified, missing permission, or the account cannot perform this action. |
| 404 | Resource not found for this API key owner. |
| 409 | Conflict, such as an idempotency key reuse with a different body, or a session that is not ready. |
| 429 | Rate limit exceeded, or the maximum number of verification attempts was reached. |
| 502 | The external provider failed to process the request. |
| 503 | The provider is unavailable or timed out. |
Try it
Parameters
WhatsApp Web session name, or Telegram bot id used as conversationContext.accountId.
Filter value. On chats: all, direct, or group. On wallet movements: credit or debit.
Page size. Typical range is 1-50 for conversation context and 1-500 for account lists.
Opaque pagination cursor from the previous response.
Request
GET /api/v2/whatsapp-web/chats?type=allResponse
Send a request to see the response.