Destinations
Ampersand currently supports webhook destinations. When new data is read from a SaaS instance via a Read Action, a webhook message will be sent to you. See Example webhook message for what the payload will look like.
Add a destination to the Ampersand Dashboard
Go to the Destinations page of Ampersand Dashboard to add a new Destination. You’ll need:
- Destination name: this is an alias for the webhook that you can then refer to in the
amp.yaml
file. - URL: this is the URL of your webhook, it must start with
https
. If you do not have a webhook already, you can easily create a temporary one using tools like Hookdeck Console.
Refer to the destination in your integration
For read and subscribe actions, you can specify destinations for each object. You can either have one destination for each object or route multiple objects to the same destination. Here’s what your amp.yaml
file might look like if you had created 2 destinations in the Ampersand Dashboard, one named accountWebhook
and one named contactWebhook
.
Ensure your destination can handle the payload size
The maximum size of a webhook payload Ampersand may send to your destination is 300 KB. Most API gateways can handle this by default. If you implement your webhook using AWS Lambda or Google Cloud Run Functions, they will also be able to handle this payload size by default.
If you are using the Node.js framework Express in your webhook receiver, and are using the json middleware to parse request bodies, you will need to modify it to increase the maximum request body size.
Other Destinations
We have many other destination types on the roadmap, including:
- Postgres
- Ampersand-hosted Postgres
- Amazon S3
- Google Cloud Storage