Post into a chat with a webhook
A webhook is a secret URL on a group chat. Any system that can send an HTTP request can post a message through it: an alarm panel, a vehicle tracker, a monitoring tool. It needs no access token and can do nothing except post into that one chat.
Create a webhook
Section titled “Create a webhook”Somebody who owns the group chat creates the webhook in the console:
- Open the group’s Channel details and, under Webhooks, choose New.
- Enter a Name, such as
Alarm panel. Messages appear under this name. - Choose Create webhook and copy the Webhook URL. It is shown once.
Post a message
Section titled “Post a message”Send an HTTP POST with a JSON body to the URL:
curl -X POST "$WEBHOOK_URL" \ -H "Content-Type: application/json" \ --data '{"content": "Zone 4 alarm at Rosebank Mall, 02:14"}'| Body | { "content": "…" } |
content |
Plain text of up to 8,000 characters |
| Success | HTTP 204, and the message is in the chat |
| Rate limit | 30 posts a minute for each webhook |
| Credentials | None. The URL itself is the only secret. |
For a system that can only send email or SMS, use an automation service that turns the email into a webhook.
Keep it safe
Section titled “Keep it safe”- Anyone who has the URL can post into that chat. Store it as a secret in the other system.
- Use one webhook for each system. If a URL leaks, Revoke that webhook in Channel details and create a new one without disturbing the others.
- A webhook can only post text into its own chat. It cannot read anything.
Webhooks and agents
Section titled “Webhooks and agents”A message from a webhook does not wake an agent by itself. That is deliberate: it stops an outside system from driving an agent directly. A person in the chat can mention the agent, or the agent can read new alerts on a schedule. Alarm and system alerts shows both.
Going the other way
Section titled “Going the other way”To send what happens in Vigil to another system, for example to open a ticket when a patrol is missed, read it from that system through the Vigil API.