Labels

Callbacks that Whapi.Cloud generates when using Labels in WhatsApp

You can find more details about all parameters and their types in the WebHook documentation.

Set the specified events in the webhook settings to receive some information about their changes. We mentioned more about the events here:Mode setting

Label created

Use the labels.post setting to get this webhook.

{
  "labels": [
    {
      "id": "76",
      "name": "Order complete",
      "color": "lightsteelblue"
    }
  ],
  "event": {
    "type": "labels",
    "event": "post"
  },
  "channel_id": "MANTIS-M72HC"
}

Label removed

Use the labels.delete setting to get this webhook.

{
  "labels_removed": [
    "New order"
  ],
  "event": {
    "type": "labels",
    "event": "delete"
  },
  "channel_id": "MANTIS-M72HC"
}

Label changed


Label is assigned to chat

Use the chats.patch setting to get this webhook. Note that chats.patch sends notifications putting in the callback information that was there before the entity was updated and after the entity was updated, showing the difference and what has changed. We have described this in more detail here: Webhook Events and Update Types (POST / PUT / PATCH / DELETE)

Pay attention to the information that has been updated in the changes array.

{
  "chats_updates": [
    {
      "before_update": {
        "id": "[email protected]",
        "type": "group",
        "timestamp": 1747391325,
        "name": "Jack Smith and his team",
        "not_spam": true,
        "last_message": {
          "id": "EHdEMDU-kmEBq53fm7NK5g-E8JdK1c",
          ..........................
        }
      },
      "after_update": {
        "id": "[email protected]",
        "type": "group",
        "timestamp": 1747391325,
        "name": "Jack Smith and his team",
        "not_spam": true,
        "last_message": {
          "id": "EHdEMDU-kmEBq53fm7NK5g-E8JdK1c",
          ..........................
        },
        "labels": [
          {
            "id": "76",
            "name": "New order",
            "color": "gold"
          }
        ]
      },
      "changes": [
        "labels"
      ]
    }
  ],
  "event": {
    "type": "chats",
    "event": "patch"
  },
  "channel_id": "MANTIS-M72HC"
}

Label is removed from chat

{
  "chats_updates": [
    {
      "before_update": {
        "id": "[email protected]",
        "type": "group",
        "timestamp": 1747391325,
        "name": "Jack Smith and his team",
        "not_spam": true,
        "last_message": {
          "id": "EHdEMDU-kmEBq53fm7NK5g-E8JdK1c",
          ..........................
        },
        "labels": [
          {
            "id": "76",
            "name": "New order",
            "color": "gold"
          }
        ]
      },
      "after_update": {
        "id": "[email protected]",
        "type": "group",
        "timestamp": 1747391325,
        "name": "Jack Smith and his team",
        "not_spam": true,
        "last_message": {
          "id": "EHdEMDU-kmEBq53fm7NK5g-E8JdK1c",
          ..........................
        },
        "labels": []
      },
      "changes": [
        "labels"
      ]
    }
  ],
  "event": {
    "type": "chats",
    "event": "patch"
  },
  "channel_id": "MANTIS-M72HC"
}

Format

contact_id*

ContactID string pattern: ^([\d]{7,15})?$

Contact ID

last_seen

number

Last seen timestamp

status

string

Presence status

Enum: [ online, offline, typing, recording, pending ]

Last updated

Was this helpful?