API Documentation

Chats

Use chat APIs to build chat lists, fetch chat pictures, read messages, and inspect or update individual chat messages. These endpoints require a connected dashboard session owned by the API key account.

Common rules

Authentication

Send Authorization: Bearer YOUR_API_KEY with every request.

Session

Use the dashboard session name, such as {session}, or the session ID.

Chat ID

Use chat_id like {number}@c.us, or send to with a phone number.

Endpoints

Method Endpoint Purpose
GET https://chatflow.zeltacode.com/api/v1/chats Return chats for a connected session. Use pagination for large accounts.
GET https://chatflow.zeltacode.com/api/v1/chats/overview Return chat list data with name, picture, and last message.
POST https://chatflow.zeltacode.com/api/v1/chats/overview Use POST overview when filtering many chat IDs.
GET https://chatflow.zeltacode.com/api/v1/chats/picture Return the profile picture URL for one direct chat or group chat.
POST https://chatflow.zeltacode.com/api/v1/chats/unread Mark a chat as unread.
POST https://chatflow.zeltacode.com/api/v1/chats/messages/read Mark unread messages in one chat as read.
GET https://chatflow.zeltacode.com/api/v1/chats/messages Return messages from one chat. Use chat_id=all only when searching by message id across chats.
GET https://chatflow.zeltacode.com/api/v1/chats/messages/{message_id} Return one message by ID from a chat.
PUT https://chatflow.zeltacode.com/api/v1/chats/messages/{message_id} Edit a text message or media caption.
DELETE https://chatflow.zeltacode.com/api/v1/chats/messages/{message_id} Delete one message from a chat.

1. Get all chats

Return chats for a connected session. Use pagination for large accounts.

API name

Get all chats

Purpose

Return chats for a connected session. Use pagination for large accounts. Use it when your application needs chat data without opening the dashboard.

Endpoint

GET https://chatflow.zeltacode.com/api/v1/chats
curl
curl -X GET "https://chatflow.zeltacode.com/api/v1/chats?session={session}&limit=20&offset=0&sortBy=conversationTimestamp&sortOrder=desc" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"
Query parameters
{
    "session": "{session}",
    "limit": 20,
    "offset": 0,
    "sortBy": "conversationTimestamp",
    "sortOrder": "desc"
}
Example response
{
    "success": true,
    "message": "Chat action completed.",
    "data": {
        "action": "list",
        "session": "{session}",
        "chat_id": null,
        "chat_response": [
            {
                "id": "{number}@c.us",
                "name": "Test Contact"
            }
        ]
    }
}

2. Get chats overview

Return chat list data with name, picture, and last message.

API name

Get chats overview

Purpose

Return chat list data with name, picture, and last message. Use it when your application needs chat data without opening the dashboard.

Endpoint

GET https://chatflow.zeltacode.com/api/v1/chats/overview
curl
curl -X GET "https://chatflow.zeltacode.com/api/v1/chats/overview?session={session}&limit=20&offset=0" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"
Query parameters
{
    "session": "{session}",
    "limit": 20,
    "offset": 0
}
Example response
{
    "success": true,
    "message": "Chat action completed.",
    "data": {
        "action": "overview",
        "session": "{session}",
        "chat_id": null,
        "chat_response": [
            {
                "id": "{number}@c.us",
                "name": "Test Contact",
                "picture": null,
                "lastMessage": {
                    "id": "false_{number}@c.us_MESSAGE_ID",
                    "body": "Hello"
                }
            }
        ]
    }
}

3. Get chats overview by ids

Use POST overview when filtering many chat IDs.

API name

Get chats overview by ids

Purpose

Use POST overview when filtering many chat IDs. Use it when your application needs chat data without opening the dashboard.

Endpoint

POST https://chatflow.zeltacode.com/api/v1/chats/overview
curl
curl -X POST "https://chatflow.zeltacode.com/api/v1/chats/overview" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "session": "{session}",
    "pagination": {
        "limit": 20,
        "offset": 0
    },
    "filter": {
        "ids": [
            "{number}@c.us"
        ]
    }
}'
JSON body
{
    "session": "{session}",
    "pagination": {
        "limit": 20,
        "offset": 0
    },
    "filter": {
        "ids": [
            "{number}@c.us"
        ]
    }
}
Example response
{
    "success": true,
    "message": "Chat action completed.",
    "data": {
        "action": "overview",
        "session": "{session}",
        "chat_id": null,
        "chat_response": [
            {
                "id": "{number}@c.us",
                "name": "Test Contact",
                "picture": null
            }
        ]
    }
}

4. Get chat picture

Return the profile picture URL for one direct chat or group chat.

API name

Get chat picture

Purpose

Return the profile picture URL for one direct chat or group chat. Use it when your application needs chat data without opening the dashboard.

Endpoint

GET https://chatflow.zeltacode.com/api/v1/chats/picture
curl
curl -X GET "https://chatflow.zeltacode.com/api/v1/chats/picture?session={session}&chat_id={number}@c.us&refresh=0" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"
Query parameters
{
    "session": "{session}",
    "chat_id": "{number}@c.us",
    "refresh": false
}
Example response
{
    "success": true,
    "message": "Chat action completed.",
    "data": {
        "action": "picture",
        "session": "{session}",
        "chat_id": "{number}@c.us",
        "chat_response": {
            "url": "https://example.com/picture.jpg"
        }
    }
}

5. Mark chat unread

Mark a chat as unread.

API name

Mark chat unread

Purpose

Mark a chat as unread. Use it when your application needs chat data without opening the dashboard.

Endpoint

POST https://chatflow.zeltacode.com/api/v1/chats/unread
curl
curl -X POST "https://chatflow.zeltacode.com/api/v1/chats/unread" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "session": "{session}",
    "chat_id": "{number}@c.us"
}'
JSON body
{
    "session": "{session}",
    "chat_id": "{number}@c.us"
}
Example response
{
    "success": true,
    "message": "Chat action completed.",
    "data": {
        "action": "unread",
        "session": "{session}",
        "chat_id": "{number}@c.us",
        "chat_response": {
            "success": true
        }
    }
}

6. Read chat messages

Mark unread messages in one chat as read.

API name

Read chat messages

Purpose

Mark unread messages in one chat as read. Use it when your application needs chat data without opening the dashboard.

Endpoint

POST https://chatflow.zeltacode.com/api/v1/chats/messages/read
curl
curl -X POST "https://chatflow.zeltacode.com/api/v1/chats/messages/read" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "session": "{session}",
    "chat_id": "{number}@c.us",
    "messages": 30,
    "days": 7
}'
JSON body
{
    "session": "{session}",
    "chat_id": "{number}@c.us",
    "messages": 30,
    "days": 7
}
Example response
{
    "success": true,
    "message": "Chat action completed.",
    "data": {
        "action": "read-messages",
        "session": "{session}",
        "chat_id": "{number}@c.us",
        "chat_response": {
            "ids": [
                "false_{number}@c.us_MESSAGE_ID"
            ]
        }
    }
}

7. Get chat messages

Return messages from one chat. Use chat_id=all only when searching by message id across chats.

API name

Get chat messages

Purpose

Return messages from one chat. Use chat_id=all only when searching by message id across chats. Use it when your application needs chat data without opening the dashboard.

Endpoint

GET https://chatflow.zeltacode.com/api/v1/chats/messages
curl
curl -X GET "https://chatflow.zeltacode.com/api/v1/chats/messages?session={session}&chat_id={number}@c.us&limit=10&offset=0&downloadMedia=0" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"
Query parameters
{
    "session": "{session}",
    "chat_id": "{number}@c.us",
    "limit": 10,
    "offset": 0,
    "downloadMedia": false
}
Example response
{
    "success": true,
    "message": "Chat action completed.",
    "data": {
        "action": "messages",
        "session": "{session}",
        "chat_id": "{number}@c.us",
        "chat_response": [
            {
                "id": "false_{number}@c.us_MESSAGE_ID",
                "from": "{number}@c.us",
                "fromMe": false,
                "body": "Hello"
            }
        ]
    }
}

8. Get message by id

Return one message by ID from a chat.

API name

Get message by id

Purpose

Return one message by ID from a chat. Use it when your application needs chat data without opening the dashboard.

Endpoint

GET https://chatflow.zeltacode.com/api/v1/chats/messages/{message_id}
curl
curl -X GET "https://chatflow.zeltacode.com/api/v1/chats/messages/false_{number}@c.us_MESSAGE_ID?session={session}&chat_id={number}@c.us&downloadMedia=1" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"
Query parameters
{
    "session": "{session}",
    "chat_id": "{number}@c.us",
    "downloadMedia": true
}
Example response
{
    "success": true,
    "message": "Chat action completed.",
    "data": {
        "action": "message",
        "session": "{session}",
        "chat_id": "{number}@c.us",
        "chat_response": {
            "id": "false_{number}@c.us_MESSAGE_ID",
            "from": "{number}@c.us",
            "body": "Hello",
            "hasMedia": false
        }
    }
}

9. Edit message

Edit a text message or media caption.

API name

Edit message

Purpose

Edit a text message or media caption. Use it when your application needs chat data without opening the dashboard.

Endpoint

PUT https://chatflow.zeltacode.com/api/v1/chats/messages/{message_id}
curl
curl -X PUT "https://chatflow.zeltacode.com/api/v1/chats/messages/false_{number}@c.us_MESSAGE_ID" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "session": "{session}",
    "chat_id": "{number}@c.us",
    "text": "Updated message text"
}'
JSON body
{
    "session": "{session}",
    "chat_id": "{number}@c.us",
    "text": "Updated message text"
}
Example response
{
    "success": true,
    "message": "Chat action completed.",
    "data": {
        "action": "update-message",
        "session": "{session}",
        "chat_id": "{number}@c.us",
        "chat_response": {
            "success": true
        }
    }
}

10. Delete message

Delete one message from a chat.

API name

Delete message

Purpose

Delete one message from a chat. Use it when your application needs chat data without opening the dashboard.

Endpoint

DELETE https://chatflow.zeltacode.com/api/v1/chats/messages/{message_id}
curl
curl -X DELETE "https://chatflow.zeltacode.com/api/v1/chats/messages/false_{number}@c.us_MESSAGE_ID" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "session": "{session}",
    "chat_id": "{number}@c.us"
}'
JSON body
{
    "session": "{session}",
    "chat_id": "{number}@c.us"
}
Example response
{
    "success": true,
    "message": "Chat action completed.",
    "data": {
        "action": "delete-message",
        "session": "{session}",
        "chat_id": "{number}@c.us",
        "chat_response": {
            "success": true
        }
    }
}