Record Webhooks
Record Webhooks send import data to your system in real-time
Overview
Record Webhooks send import data to your system in batches in real-time.
Receiving large amounts of data by webhook can be more complex than pulling data from the Fuse API, so you should only use Record Webhooks if you need to show backend validation errors to the user during import.
Record Webhooks send data in batches of up to 1,000. An import with 10,000 records will have ten batches of records sent by webhook, each with 1,000 records.
Record Webhook Flow
There are three steps that you need to set up to get Record Webhooks working properly.
Step 1: Receive Batches
Fuse will send records to your webhook in batches of 1,000. The payload looks like this:
Here is the definition of each key in the payload:
- batch_slug: A unique identifier for the batch.
- import_slug: A unique identifier for the import.
- batches_count: The number of batches that will be sent.
- records: The records in the current batch.
- complete: The final batch sent will have this marked as true.
Your server should respond to batches within 5 seconds. If you can process each batch in less than 5 seconds, you can give us an inline response telling us that the batch has been completed
with any associated validation issues, as seen below.
If your server might take longer than 5 seconds to process a batch, then you should process the batch in a background job and respond to our webhook telling us that the batch is still processing
.
Here is the definition of each key in the response payload:
- status: Must be ‘completed’ if you have finished processing the batch, or ‘processing’ if, for example, you are processing the batch in a background job.
- record_slug: The unique slug of the record.
- validation_type: Must be ‘warning’ or ‘error’.
- column_name: The
internal_key
from the column in Fuse. - issue_description: A user-facing message to show the user.
Step 2: Update Batch Status
If you responded with a status of processing
to any batches in step 1, then you must update us once each batch has been completed
.
You can send an HTTP request to Fuse to update the status of your batch.
Security
See Webhook Security to verify record webhook requests.