Overview
This node manages webhooks on the Sapo platform, allowing users to create, retrieve details of, update, list, or delete webhooks. It is useful for automating integrations where external systems need to be notified about events occurring in Sapo, such as order creation or product updates.
Common scenarios include:
- Creating a new webhook to receive notifications when orders are created.
- Retrieving detailed information about a specific webhook by its ID.
- Updating an existing webhook’s configuration.
- Listing multiple webhooks with optional filters and limits.
- Deleting a webhook that is no longer needed.
For example, a user might create a webhook to trigger a workflow whenever a new customer is added, enabling real-time synchronization between Sapo and a CRM system.
Properties
| Name | Meaning |
|---|---|
| operation | The action to perform on the webhook resource. Options: "create", "delete", "get", "getMany", "update". |
| webhookId | The unique identifier of the webhook. Required for "get", "update", and "delete" operations. |
| returnAll | (Only for "getMany") Whether to return all webhook records or limit the number returned. Boolean. |
| limit | (Only for "getMany" when returnAll is false) Maximum number of webhook records to return. Number. |
| data | (Only for "create" and "update") JSON object containing webhook details such as topic, address, format, fields, and metafield namespaces. |
| additionalFields | (Only for "getMany") Optional filters and parameters to refine the list of webhooks, including topic selection and date ranges for creation or update times. |
Output
The node outputs an array with one element containing a json property:
- For create, get, update, and getMany operations, the
jsoncontains the webhook data returned from the Sapo API. This includes webhook properties like ID, topic, address, and other metadata. - For the delete operation, the output
jsoncontains{ success: true }if deletion was successful. - If an error occurs and the node is set to continue on failure, the output will contain an
errorfield with the error message.
The node does not output binary data.
Dependencies
- Requires an active connection to the Sapo API via an API key credential configured in n8n.
- Uses the internal Sapo API base class to interact with webhook endpoints.
- No additional external dependencies beyond the Sapo API access.
Troubleshooting
Common issues:
- Invalid or missing webhook ID when performing "get", "update", or "delete" operations will cause errors.
- Incorrectly formatted JSON in the
dataproperty for "create" or "update" can lead to API rejections. - Network or authentication failures with the Sapo API will result in errors.
Error messages:
- Errors from the Sapo API are propagated with their message and stack trace.
- If the node is not set to continue on failure, it will throw an error stopping the workflow.
- To resolve, verify webhook IDs, ensure valid JSON input, and confirm API credentials are correct.
Links and References
- Sapo API Documentation (general reference for webhook topics and payloads)
- n8n documentation on creating custom nodes