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
- Open Hooks Explorer.
- Create a new hook (or open an existing one and go to its detail view).
- In the Type dropdown, select webHook.
- 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:orderStatusUpdate is called with:
Writing the code
Whatever the external system sends in the request body is available inside your code asinstance. Whatever your code returns is sent back as the response.
500 response.
Trying it out
You can test a webhook with any HTTP client. For example, withcurl:
Limits
Related
- Hooks — General reference for hook code (querying data, sending emails, error handling).
- Hooks Explorer — Where you create and edit hooks, including webhooks.