Ammit Portal
Shop Sign in
Feature overview

Webhooks

Premium

Connect the server to Zapier, Make, n8n or your own service.

At a glance

Availability
Premium
In the portal
Communication › Webhooks

Overview

Webhooks connect your server to an external service, such as Zapier, Make, n8n, IFTTT or your own application. Ammit offers two kinds of links. An incoming link lets that service post messages in a channel of your server. An outgoing link sends that service the events of your server, such as an arrival or the opening of a ticket, to trigger your own automations.

How it works

Incoming link

Each incoming link has a secret address on the Ammit portal. The external service sends a POST request to it, and Ammit posts the message right away in the link's channel. The request body can be JSON, form data, or plain text.

Without a template, Ammit posts the content, message or text field. If the body also contains a title field, Ammit posts an embed carrying that title, and a url field that starts with https:// makes the title clickable. With a message Template, each field name placed in braces is replaced by the value received. A field stored in an object is written with a dot, for example {client.nom}.

Mentions contained in the message notify no one. Ammit replies to the service with code 200 when the message is posted, and otherwise with an error code and its cause. Code 403 is returned for a paused link, a server without Premium or when the page's switch is turned off.

Outgoing link

An outgoing link sends to an https address the events of the ticked categories, from Messages, Members, Server, Automod, Anti-raid, Anti-nuke, Team and Security. These are the events that Ammit records in the server's Event log. Each send is a POST request in JSON that contains the following fields. The content of messages is never transmitted.

FieldContent
The unique ID of the delivery, repeated in the X-Ammit-Delivery header.
The event type, repeated in the X-Ammit-Event header.
The event's category.
The summary of the event, in one sentence.
The ID and name of the server.
The ID and name of the person who performed the action, if there is one.
The ID and name of the member targeted, if there is one.
The ID of the channel concerned, if there is one.
The date of the event.

Each delivery is signed. The X-Ammit-Signature header contains sha256= followed by the HMAC-SHA256 calculated with the link's secret on the timestamp, a period, and the request body. The timestamp is in the X-Ammit-Timestamp header. By recalculating this signature, your service checks that the delivery really comes from Ammit.

If the service does not respond, or responds with a 5xx or 429 error, Ammit retries the send up to three times, after 5 seconds, 30 seconds, then 2 minutes. A link sends at most 60 events per minute. Beyond that, further events are not sent.

Call log

Each call received or sent is noted in the link's log, with its date, the event, the response and the details of any failure. Calls refused by an incoming link also appear there, with their cause, except those that exceed the number of calls per minute or the allowed size. The page shows the last 10 calls of each link, and the link's header says whether the last one succeeded.

Configuration

In your server's menu, open Webhooks, in the Communication section. Check that the switch at the top of the page is turned on.

Screenshot taken on the “Les Gardiens du Nord” demo server.

Create an incoming link

  1. In Add a link, Incoming link card, enter a Name and choose the Channel.
  2. Write a message Template if needed, for example “New order from {client} for €{montant}”.
  3. Click Create the incoming link.
  4. Copy the Address of the incoming link shown at the top of the card right away, then paste it into your service. It will not be shown again.

Create an outgoing link

  1. In the Outgoing link card, enter a Name and the https address provided by your service.
  2. Tick the Event categories to send.
  3. Click Create the outgoing link, then copy the Signing secret shown. It will not be shown again.
  4. Open the link in the list and click Test delivery. Ammit sends a test event and tells you whether your service received it.

Open a link in the list to change its name, channel and template, or its address and categories, then click Save. Pause stops a link without deleting it, and Reactivate puts it back into service. Renew the secret replaces the address of an incoming link or the secret of an outgoing link, and the old one stops working immediately.

Settings

SettingDescriptionDefault value
Webhooks (external automations)PremiumEnabled

Usage

Messages received through an incoming link appear in the chosen channel, posted by Ammit. An online shop service can thus announce each new order in a channel reserved for your team.

With an outgoing link, your service receives events as they happen. For example, a Zapier scenario can add a row to a spreadsheet each time a member joins, with the Members category.

Required permissions

For an incoming link, Ammit must be able to see the channel, write in it and embed links in it. An outgoing link requires no particular Discord permission.

In the portal, only the server owner and administrators manage webhooks. The feature requires Premium.

Free version and Premium

FeatureFreePremium
External automations: incoming and outgoing webhooks (Zapier, Make, n8n, IFTTT)Signed deliveries, call logNot included10

Limits

  • The number of links depends on your plan.
  • An incoming link accepts 30 calls per minute and a body of 16,000 bytes at most. The message posted is at most 2,000 characters long.
  • An outgoing link only accepts a public https address, never a local network address. Ammit does not follow redirects and waits at most 10 seconds for the response.
  • When the page's switch is off, or without Premium, no event is sent and incoming links refuse messages. The links remain saved.
  • Ammit keeps the last 50 calls of each link.

Frequently asked questions

I lost the address of an incoming link. How do I find it again?

Ammit does not keep the address itself. Click Renew the secret to get a new address, then replace the old one in your service.

How does my service verify the signature?

Calculate the HMAC-SHA256 of the timestamp received in X-Ammit-Timestamp, followed by a period and the raw body of the request, with the link's secret. Compare the result with the value that follows sha256= in X-Ammit-Signature, and reject the delivery if they differ.

Why does my service receive nothing?

Check that the page's switch is turned on, that the link is not paused and that the ticked categories match the events expected. The link's log shows your service's response or the cause of the failure, for example a timeout or a rejected certificate.

Learn more