Skip to main content
PATCH
https://api.enviaai.app
/
v1
/
webhooks
/
{webhookId}
Atualizar Webhook
curl --request PATCH \
  --url https://api.enviaai.app/v1/webhooks/{webhookId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "url": "<string>",
  "events": [
    {}
  ],
  "status": "<string>"
}
'
{
  "success": true,
  "data": {
    "id": "wh_xyz789",
    "name": "Webhook Principal",
    "url": "https://myapp.com/webhooks/enviaai",
    "events": ["message.received", "message.sent", "message.read"],
    "status": "active"
  }
}

Path Parameters

webhookId
string
required
ID do webhook

Request Body

name
string
Nome do webhook
url
string
URL do endpoint
events
array
Lista de eventos
status
string
Status: active ou inactive

Exemplo

await client.webhooks.update('wh_xyz789', {
  events: ['message.received', 'message.sent', 'message.read'],
  status: 'active'
});
{
  "success": true,
  "data": {
    "id": "wh_xyz789",
    "name": "Webhook Principal",
    "url": "https://myapp.com/webhooks/enviaai",
    "events": ["message.received", "message.sent", "message.read"],
    "status": "active"
  }
}