Webhook destinations
For more information on destinations, see the Destinations page.
When new data is read from a SaaS instance via a Read Action, Ampersand sends a payload to your configured webhook.
OpenAPI spec
Check out our OpenAPI spec for the full webhook message schema and more details on the data structure. You can use this to generate types for your language and easily parse the webhook message.
When a record is too big
Ampersand attaches results to a webhook message in two ways:
- Inline: In most cases, the result is directly included in the webhook’s
result
field. - URL: If a single record is over 300KB, it becomes too big to be sent over a webhook. In this case, the result won’t be included inline. Instead, the webhook message will contain a signed download URL in
resultInfo.downloadUrl
. The URL expires after 15 minutes.
resultInfo.type
indicates how the result is attached to the message:
If type is inline
, the full result is in the result
field.
If type is url
, you can fetch the full result by making a GET request to resultInfo.downloadUrl
.
In both cases, resultInfo.numRecords
tells you how many records are available in the result.
Example webhook message (inline)
Here’s a sample webhook message for a Salesforce Contact object:
Example webhook message (URL)
Handling webhook results
Here’s some pseudo-code to illustrate how you can get parse result from a webhook:
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.
Was this page helpful?