curl --request GET \
--url https://api.omni.z-api.io/v1/channels/{channelId}/webhooks \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.omni.z-api.io/v1/channels/{channelId}/webhooks"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.omni.z-api.io/v1/channels/{channelId}/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.omni.z-api.io/v1/channels/{channelId}/webhooks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.omni.z-api.io/v1/channels/{channelId}/webhooks"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.omni.z-api.io/v1/channels/{channelId}/webhooks")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.omni.z-api.io/v1/channels/{channelId}/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"id": "A1B2C3D4E5F6789012345678901234AB",
"channelId": "019E4C54B1B375A28970B605CA9B03C3",
"instanceId": "019E4C54B1B375A28970B605CA9B03C3",
"url": "https://app.suempresa.com/webhooks/omni-zapi",
"description": "Webhook principal de producción",
"events": [
"MESSAGE_RECEIVED",
"MESSAGE_STATUS"
],
"status": "ENABLED",
"signing": true,
"auth": {
"type": "BEARER",
"configured": true
},
"payloadFormat": "DEFAULT",
"customAttributes": {},
"createdAt": "2025-01-15T10:30:00.000+0000",
"updatedAt": "2025-01-15T10:30:00.000+0000"
},
{
"id": "B2C3D4E5F6789012345678901234AB12",
"channelId": "019E4C54B1B375A28970B605CA9B03C3",
"instanceId": "019E4C54B1B375A28970B605CA9B03C3",
"url": "https://app.suempresa.com/webhooks/eventos-conexion",
"description": "Eventos de conexión",
"events": [
"CONNECTED",
"DISCONNECTED"
],
"status": "ENABLED",
"signing": false,
"auth": {
"type": "NONE",
"configured": false
},
"payloadFormat": "DEFAULT",
"customAttributes": {},
"createdAt": "2025-01-16T08:00:00.000+0000",
"updatedAt": "2025-01-16T08:00:00.000+0000"
}
]{
"error": 401,
"message": "Unauthorized"
}{
"error": 422,
"message": "This action requires ENTERPRISE role"
}Listar webhooks
Lista todos los webhooks de un canal
curl --request GET \
--url https://api.omni.z-api.io/v1/channels/{channelId}/webhooks \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.omni.z-api.io/v1/channels/{channelId}/webhooks"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.omni.z-api.io/v1/channels/{channelId}/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.omni.z-api.io/v1/channels/{channelId}/webhooks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.omni.z-api.io/v1/channels/{channelId}/webhooks"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.omni.z-api.io/v1/channels/{channelId}/webhooks")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.omni.z-api.io/v1/channels/{channelId}/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"id": "A1B2C3D4E5F6789012345678901234AB",
"channelId": "019E4C54B1B375A28970B605CA9B03C3",
"instanceId": "019E4C54B1B375A28970B605CA9B03C3",
"url": "https://app.suempresa.com/webhooks/omni-zapi",
"description": "Webhook principal de producción",
"events": [
"MESSAGE_RECEIVED",
"MESSAGE_STATUS"
],
"status": "ENABLED",
"signing": true,
"auth": {
"type": "BEARER",
"configured": true
},
"payloadFormat": "DEFAULT",
"customAttributes": {},
"createdAt": "2025-01-15T10:30:00.000+0000",
"updatedAt": "2025-01-15T10:30:00.000+0000"
},
{
"id": "B2C3D4E5F6789012345678901234AB12",
"channelId": "019E4C54B1B375A28970B605CA9B03C3",
"instanceId": "019E4C54B1B375A28970B605CA9B03C3",
"url": "https://app.suempresa.com/webhooks/eventos-conexion",
"description": "Eventos de conexión",
"events": [
"CONNECTED",
"DISCONNECTED"
],
"status": "ENABLED",
"signing": false,
"auth": {
"type": "NONE",
"configured": false
},
"payloadFormat": "DEFAULT",
"customAttributes": {},
"createdAt": "2025-01-16T08:00:00.000+0000",
"updatedAt": "2025-01-16T08:00:00.000+0000"
}
]{
"error": 401,
"message": "Unauthorized"
}{
"error": 422,
"message": "This action requires ENTERPRISE role"
}Conceptos
Devuelve todos los webhooks registrados en un canal. El campoauth.configured indica si hay credenciales de autenticación definidas, pero las credenciales en sí no se devuelven por seguridad.
El campo secret (firma HMAC) tampoco se devuelve en el listado: solo está disponible en el momento de la creación o de la actualización con signing: true.
Autorizaciones
Secret Key generada en el panel de Seguridad de Omni Z-API
Parámetros de ruta
ID del canal
"019E4C54B1B375A28970B605CA9B03C3"
Respuesta
Lista de webhooks del canal
ID único del webhook
"A1B2C3D4E5F6789012345678901234AB"
ID del canal al que pertenece el webhook
"019E4C54B1B375A28970B605CA9B03C3"
Obsoleto: usa channelId
"019E4C54B1B375A28970B605CA9B03C3"
URL de destino de los eventos
"https://app.suempresa.com/webhooks/omni-zapi"
Descripción del webhook
"Webhook principal de producción"
Tipos de evento configurados
["MESSAGE_RECEIVED", "MESSAGE_STATUS"]
Estado actual del webhook
ENABLED, DISABLED "ENABLED"
Indica si la firma HMAC está habilitada
true
Resumen de la autenticación configurada: las credenciales no se devuelven por seguridad
Show child attributes
Show child attributes
Formato del payload entregado
DEFAULT, Z_API, CHATWOOT "DEFAULT"
Atributos extra configurados
{}
Fecha de creación
"2025-01-15T10:30:00.000+0000"
Fecha de la última actualización
"2025-01-15T10:30:00.000+0000"