List webhooks by channel
Agent Skill
Automate this endpoint with an AI agent using the 2chat-webhooks skill:
npx skills add 2ChatCo/agent-skills -s 2chat-webhooks
This endpoint will return all configured and enabled webhooks you have in your 2Chat account for the given channel UUID.
tip
The channel_uuid parameter must referencing a supported channel.
For example, to obtain your list of WhatsApp channels, use the list numbers endpoint. Likewise, for Virtual Numbers, you can use the List virtual numbers endpoint.
API costโ
1API credit
Each call to this endpoint deducts 1 API credit from your plan's API credit pool.
Invocationโ
- cURL
- Python
- JavaScript
curl -L -G 'https://api.p.2chat.io/open/webhooks/channel/WPN711900b4-ab2a-47cb-846e-b49bc28b8057' \
--header 'X-User-API-Key: your_api_key_here'
import requests
url = "https://api.p.2chat.io/open/webhooks/WPN711900b4-ab2a-47cb-846e-b49bc28b8057"
payload = ""
headers = {
'X-User-API-Key': 'your_api_key_here'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
var axios = require('axios');
var data = '';
var config = {
method: 'get',
url: 'https://api.p.2chat.io/open/webhooks/WPN711900b4-ab2a-47cb-846e-b49bc28b8057',
headers: {
'X-User-API-Key': 'your_api_key_here'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
Responseโ
A list of enabled webhooks will be returned together with their corresponding information
{
"success": true,
"webhooks": [
{
"uuid": "WHKdc78c87e-5b18-47c7-9183-5bf527fd6c69",
"event_name": "whatsapp.message.received",
"channel_uuid": "WPN95841312-b54d-46e3-b0bc-6414f4a5296b",
"hook_url": "https://www.toptal.com/developers/postbin/1681755466939-3421728690154",
"hook_params": {
"waweb_uuid": "WPN95841312-b54d-46e3-b0bc-6414f4a5296b"
},
"created_at": "2023-04-17T18:50:50Z"
},
{
"uuid": "WHKe768c62c-d41f-49a9-82ff-8982a0683902",
"event_name": "whatsapp.message.sent",
"channel_uuid": "WPN95841312-b54d-46e3-b0bc-6414f4a5296b",
"hook_url": "https://www.toptal.com/developers/postbin/1681755466939-3421728690154",
"hook_params": {
"waweb_uuid": "WPN95841312-b54d-46e3-b0bc-6414f4a5296b"
},
"created_at": "2023-04-17T18:50:45Z"
}
]
}
| Field | Description | Example values |
|---|---|---|
uuid | The unique identifier of the webhook that you will need to make changes to it | WHKdc78c87e-5b18-47c7-9183-5bf527fd6c69 |
event_name | The name of the event this webhook is subscribed to | whatsapp.call.received. |
channel_uuid | The unique UUID of the channel this webhook is subscribed to | WPN95841312-b54d-46e3-b0bc-6414f4a5296b |
hook_url | The URL 2Chat will call when a event is triggered | https://my-dev-server |
hook_params | Custom parameters 2Chat sets to make the webhook functional | {} |
created_at | UTC timestamp for when the webhook was created | 2023-04-17T18:50:45Z |