API Documentation

Labels

Use label APIs to create business labels, attach them to chats, and build CRM-style workflows such as new leads, follow-up queues, paid customers, and support stages.

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.

Label color

Use color from 0 to 19, or pass colorHex such as #64c4ff.

Endpoints

Method Endpoint Purpose
GET https://chatflow.zeltacode.com/api/v1/labels Return all labels available in a connected session.
POST https://chatflow.zeltacode.com/api/v1/labels Create a label for organizing chats in your customer workflow.
PUT https://chatflow.zeltacode.com/api/v1/labels/{label_id} Rename a label or change its color.
DELETE https://chatflow.zeltacode.com/api/v1/labels/{label_id} Delete a label that is no longer needed.
GET https://chatflow.zeltacode.com/api/v1/labels/{label_id}/chats Return chats assigned to one label.
GET https://chatflow.zeltacode.com/api/v1/labels/chats/{chat_id} Return labels currently assigned to one chat.
PUT https://chatflow.zeltacode.com/api/v1/labels/chats/{chat_id} Set the full label list for a chat. Labels not included in the request are removed from that chat.

Events

Label changes can appear in webhook deliveries. These event names are useful when you want to sync label changes into your own system.

label.upsert
label.deleted
label.chat.added
label.chat.deleted

1. Get labels

Return all labels available in a connected session.

API name

Get labels

Purpose

Return all labels available in a connected session. Use it to keep customer labels and chat organization synced with your own application.

Endpoint

GET https://chatflow.zeltacode.com/api/v1/labels
curl
curl -X GET "https://chatflow.zeltacode.com/api/v1/labels?session={session}" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"
Query parameters
{
    "session": "{session}"
}
Example response
{
    "success": true,
    "message": "Label action completed.",
    "data": {
        "action": "list",
        "session": "{session}",
        "label_id": null,
        "chat_id": null,
        "label_response": [
            {
                "id": "1",
                "name": "New Client",
                "color": 1,
                "colorHex": "#64c4ff"
            }
        ]
    }
}

2. Create label

Create a label for organizing chats in your customer workflow.

API name

Create label

Purpose

Create a label for organizing chats in your customer workflow. Use it to keep customer labels and chat organization synced with your own application.

Endpoint

POST https://chatflow.zeltacode.com/api/v1/labels
curl
curl -X POST "https://chatflow.zeltacode.com/api/v1/labels" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "session": "{session}",
    "name": "New Client",
    "color": 1
}'
JSON body
{
    "session": "{session}",
    "name": "New Client",
    "color": 1
}
Example response
{
    "success": true,
    "message": "Label action completed.",
    "data": {
        "action": "create",
        "session": "{session}",
        "label_id": null,
        "chat_id": null,
        "label_response": {
            "id": "1",
            "name": "New Client",
            "color": 1,
            "colorHex": "#64c4ff"
        }
    }
}

3. Update label

Rename a label or change its color.

API name

Update label

Purpose

Rename a label or change its color. Use it to keep customer labels and chat organization synced with your own application.

Endpoint

PUT https://chatflow.zeltacode.com/api/v1/labels/{label_id}
curl
curl -X PUT "https://chatflow.zeltacode.com/api/v1/labels/1" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "session": "{session}",
    "name": "Paid Client",
    "colorHex": "#64c4ff"
}'
JSON body
{
    "session": "{session}",
    "name": "Paid Client",
    "colorHex": "#64c4ff"
}
Example response
{
    "success": true,
    "message": "Label action completed.",
    "data": {
        "action": "update",
        "session": "{session}",
        "label_id": "1",
        "chat_id": null,
        "label_response": {
            "id": "1",
            "name": "Paid Client",
            "color": 1,
            "colorHex": "#64c4ff"
        }
    }
}

4. Delete label

Delete a label that is no longer needed.

API name

Delete label

Purpose

Delete a label that is no longer needed. Use it to keep customer labels and chat organization synced with your own application.

Endpoint

DELETE https://chatflow.zeltacode.com/api/v1/labels/{label_id}
curl
curl -X DELETE "https://chatflow.zeltacode.com/api/v1/labels/1" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "session": "{session}"
}'
JSON body
{
    "session": "{session}"
}
Example response
{
    "success": true,
    "message": "Label action completed.",
    "data": {
        "action": "delete",
        "session": "{session}",
        "label_id": "1",
        "chat_id": null,
        "label_response": {
            "success": true
        }
    }
}

5. Get chats by label id

Return chats assigned to one label.

API name

Get chats by label id

Purpose

Return chats assigned to one label. Use it to keep customer labels and chat organization synced with your own application.

Endpoint

GET https://chatflow.zeltacode.com/api/v1/labels/{label_id}/chats
curl
curl -X GET "https://chatflow.zeltacode.com/api/v1/labels/1/chats?session={session}" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"
Query parameters
{
    "session": "{session}"
}
Example response
{
    "success": true,
    "message": "Label action completed.",
    "data": {
        "action": "label-chats",
        "session": "{session}",
        "label_id": "1",
        "chat_id": null,
        "label_response": [
            {
                "id": "{number}@c.us",
                "name": "Test Contact"
            }
        ]
    }
}

6. Get labels by chat id

Return labels currently assigned to one chat.

API name

Get labels by chat id

Purpose

Return labels currently assigned to one chat. Use it to keep customer labels and chat organization synced with your own application.

Endpoint

GET https://chatflow.zeltacode.com/api/v1/labels/chats/{chat_id}
curl
curl -X GET "https://chatflow.zeltacode.com/api/v1/labels/chats/{number}@c.us?session={session}" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"
Query parameters
{
    "session": "{session}"
}
Example response
{
    "success": true,
    "message": "Label action completed.",
    "data": {
        "action": "chat-labels",
        "session": "{session}",
        "label_id": null,
        "chat_id": "{number}@c.us",
        "label_response": [
            {
                "id": "1",
                "name": "New Client",
                "color": 1,
                "colorHex": "#64c4ff"
            }
        ]
    }
}

7. Update labels to chat

Set the full label list for a chat. Labels not included in the request are removed from that chat.

API name

Update labels to chat

Purpose

Set the full label list for a chat. Labels not included in the request are removed from that chat. Use it to keep customer labels and chat organization synced with your own application.

Endpoint

PUT https://chatflow.zeltacode.com/api/v1/labels/chats/{chat_id}
curl
curl -X PUT "https://chatflow.zeltacode.com/api/v1/labels/chats/{number}@c.us" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "session": "{session}",
    "labels": [
        {
            "id": "1"
        }
    ]
}'
JSON body
{
    "session": "{session}",
    "labels": [
        {
            "id": "1"
        }
    ]
}
Example response
{
    "success": true,
    "message": "Label action completed.",
    "data": {
        "action": "update-chat-labels",
        "session": "{session}",
        "label_id": null,
        "chat_id": "{number}@c.us",
        "label_response": {
            "success": true
        }
    }
}