Webhooks provide a way to configure Spare to make requests (JSON though HTTP POST) to your server (or another external service) whenever certain events occur in Spare. A webhook consists of:

There are two parts to getting a webhook to work: creating the webhook and triggering the webhook. After you create a webhook for an event, every time that event occurs, Spare sends a payload request that describes the event to the specified URL. Thus, you can think of webhooks as a kind of notification system.

When to use Webhooks

Use webhooks to integrate applications with Spare, for example:

Create webhooks

You can create a webhook through Spare Admin Panel. The administrators are the only ones who can create a webhook. Using the following steps:

  1. Open the Admin Panel and make sure that you are logged in as an admin.
  2. Click Settings on the left sidebar, and select Webhooks.
  3. Click the Plus Icon on the right, enter a Name with a short description.
  4. Choose a Topic to determine when the webhook will be triggered.
  5. Enter the URL to the application or server.
  6. (Optional) Activate the Authorization HTTP Header, and add a secret as a value.
  7. After you entered all the necessary information for your webhook, click Add.

Secure webhooks

Spare webhooks work by sending an HTTP POST request to the customer service at a particular URL. It's important that you protect your service from potential attacks. As a workaround, you could allowlist the Spare IPs to restrict who can access your webhook resource.