Skip to main content
A Webhook is a hook that exposes a public HTTP endpoint in your application. Use it when an external service (Stripe, a form provider, another system, a script, etc.) needs to send data into your application by making an HTTP request.
Webhooks only work in one direction: an external system calls into your application. If instead you want your application to call an external URL when something happens (a record is created, updated, etc.), do that from a regular hook (for example afterSave) using axios or fetch — see Hooks.

How to create a Webhook

  1. Open Hooks Explorer.
  2. Create a new hook (or open an existing one and go to its detail view).
  3. In the Type dropdown, select webHook.
  4. Fill in the fields described below and save.

Fields

  • Name: The identifier for this webhook. It must be at least 2 characters long and can only contain letters, numbers, _ and -. This name becomes part of the URL external services will call, so keep it short and hard to guess.
  • Type: Select webHook.
  • Table: Not used by webhooks — a webhook runs at the application level, not tied to any table’s records. You can leave the default value here.
  • Code: The JavaScript code that runs every time someone calls your webhook.

The Webhook URL

Once saved, the URL to give to the external service is:
For example, a webhook named orderStatusUpdate is called with:
If the Name doesn’t match an existing webhook, the request gets a 404 response. Anyone who knows (or guesses) the URL can call it — there is no built-in authentication, so if you need to restrict who can call it, validate a token/header yourself inside the Code.

Writing the code

Whatever the external system sends in the request body is available inside your code as instance. Whatever your code returns is sent back as the response.
You can use the same helpers available in any other hook (querying the database, sending emails, importing modules, etc.) — see Hooks for those examples. If your code throws an error, the caller receives a 500 response.

Trying it out

You can test a webhook with any HTTP client. For example, with curl:

Limits

All the webhooks in an application share a limit of 10 requests per minute. If the external service you’re integrating with sends bursts of traffic, keep this in mind.
  • Hooks — General reference for hook code (querying data, sending emails, error handling).
  • Hooks Explorer — Where you create and edit hooks, including webhooks.