Listar webhooks
/v1/webhooksdesde M3token da instância ou adminQuando usar
Com token de instância, lista os webhooks da própria instância. Com token admin, lista todos (globais e de instâncias); instance_id filtra por uma instância. O secret nunca aparece aqui.
Autenticação
Aceita o token da instância (só a própria instância) ou o token admin. Um token de outra instância recebe 403 forbidden (ou 404 not_found em webhooks de outra instância).
Parâmetros
Query
| Nome | Tipo | Descrição |
|---|---|---|
instance_id | string | Só admin: filtra pelos webhooks desta instância. |
Exemplo
curl -s "$LITEZAP_URL/v1/webhooks" \ -H "Authorization: Bearer $LITEZAP_TOKEN"const res = await fetch("http://localhost:8787/v1/webhooks", { headers: { Authorization: `Bearer ${process.env.LITEZAP_TOKEN}` },});console.log(res.status, res.status === 204 ? "" : await res.json());import osimport requests
r = requests.get( "http://localhost:8787/v1/webhooks", headers={"Authorization": f"Bearer {os.environ['LITEZAP_TOKEN']}"}, timeout=150,)print(r.status_code, r.json() if r.content else "")package main
import ( "fmt" "io" "net/http" "os")
func main() { req, _ := http.NewRequest("GET", "http://localhost:8787/v1/webhooks", nil) req.Header.Set("Authorization", "Bearer "+os.Getenv("LITEZAP_TOKEN")) resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(resp.Status, string(out))}<?phprequire 'vendor/autoload.php'; // composer require guzzlehttp/guzzle
$client = new GuzzleHttp\Client(['base_uri' => 'http://localhost:8787']);$res = $client->request('GET', '/v1/webhooks', [ 'headers' => ['Authorization' => 'Bearer ' . getenv('LITEZAP_TOKEN')], 'http_errors' => false,]);echo $res->getStatusCode(), ' ', $res->getBody(), PHP_EOL;Nos exemplos, LITEZAP_URL é a URL base (ex.: http://localhost:8787) e o token vem deLITEZAP_TOKEN (instância) ou LITEZAP_ADMIN_TOKEN.
Resposta
200 Webhooks visíveis para o token.
Campos de object
webhooks | Webhook[] |
{ "webhooks": [ { "id": "wh_3c7e1a9f5b2d4806", "instance_id": "inst_7f3a9c2e5b1d4086", "url": "https://exemplo.com/litezap", "events": [ "message.*", "instance.status" ], "version": 1, "enabled": true, "created_at": "2026-10-17T14:00:00Z", "updated_at": "2026-10-17T14:00:00Z" } ]}Erros
| Código | HTTP | Retentável | O que fazer |
|---|---|---|---|
unauthorized | 401 | não | Envie Authorization: Bearer <token> válido. |
Todo erro usa o envelope {"error":{"code","message","retryable"}}. Tabela completa em Erros.
Equivalente na Z-API: (sem equivalente). Veja Migrar da Z-API.
Outras operações de Webhooks: Criar webhook · Consultar webhook · Atualizar webhook · Apagar webhook · Listar entregas · Reenviar entrega

