curl --request POST \
--url https://api.hubmessage.io/v1/channels/{channelId}/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://app.suaempresa.com/webhooks/hubmessage",
"events": [
"MESSAGE_RECEIVED"
]
}
'{
"id": "A1B2C3D4E5F6789012345678901234AB",
"channelId": "019E4C54B1B375A28970B605CA9B03C3",
"instanceId": "019E4C54B1B375A28970B605CA9B03C3",
"url": "https://app.suaempresa.com/webhooks/hubmessage",
"description": null,
"events": [
"MESSAGE_RECEIVED",
"MESSAGE_STATUS"
],
"status": "ENABLED",
"signing": true,
"secret": "a3f1c2d4e5b6789012345678901234abcdef0123456789abcdef0123456789ab",
"auth": {
"type": "NONE",
"configured": false
},
"payloadFormat": "DEFAULT",
"customAttributes": {},
"createdAt": "2025-01-15T10:30:00.000+0000",
"updatedAt": "2025-01-15T10:30:00.000+0000"
}Canais
Criar webhook
Registre um endpoint de webhook em um canal
POST
/
v1
/
channels
/
{channelId}
/
webhooks
curl --request POST \
--url https://api.hubmessage.io/v1/channels/{channelId}/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://app.suaempresa.com/webhooks/hubmessage",
"events": [
"MESSAGE_RECEIVED"
]
}
'{
"id": "A1B2C3D4E5F6789012345678901234AB",
"channelId": "019E4C54B1B375A28970B605CA9B03C3",
"instanceId": "019E4C54B1B375A28970B605CA9B03C3",
"url": "https://app.suaempresa.com/webhooks/hubmessage",
"description": null,
"events": [
"MESSAGE_RECEIVED",
"MESSAGE_STATUS"
],
"status": "ENABLED",
"signing": true,
"secret": "a3f1c2d4e5b6789012345678901234abcdef0123456789abcdef0123456789ab",
"auth": {
"type": "NONE",
"configured": false
},
"payloadFormat": "DEFAULT",
"customAttributes": {},
"createdAt": "2025-01-15T10:30:00.000+0000",
"updatedAt": "2025-01-15T10:30:00.000+0000"
}Conceituação
Registra um novo endpoint de webhook no canal. A partir da criação, o passa a enviar os eventos configurados para a URL informada. Um canal pode ter múltiplos webhooks — útil para enviar eventos diferentes para sistemas diferentes, ou para manter webhooks com formatos distintos.Assinatura HMAC
Sesigning: true, o campo secret é gerado automaticamente e retornado apenas nesta resposta. Armazene-o com segurança — ele não será exibido novamente em nenhuma outra chamada.
Use o secret para verificar a autenticidade das requisições recebidas no seu servidor. Calcule o HMAC-SHA256 sobre o body recebido usando o secret e compare com o header de assinatura enviado pelo .
Este endpoint requer a role ENTERPRISE na sua conta.
O
channelId é obtido através do endpoint Criar canal.Autorizações
Parâmetros de caminho
Corpo
application/json
Tipos de evento a receber. Pelo menos um obrigatório.
Opções disponíveis:
MESSAGE_RECEIVED, MESSAGE_DELIVERY, MESSAGE_STATUS, RECEIVED_STATUS, RECEIVED_AND_DELIVERY, CONNECTED, DISCONNECTED, PRESENCE_CHAT, INITIAL_DATA, BLOCK Exemplo:
["MESSAGE_RECEIVED", "MESSAGE_STATUS"]
Resposta
Webhook criado com sucesso. O campo secret é retornado apenas nesta resposta quando signing é true — armazene-o com segurança.