Skip to main content

Deleting a webhook

Deleting a webhook​

Contents​

Overview​

  • Call name: delete-webhook
  • Endpoint URL: https://{API hostname}/internal/delete-webhook
  • Request methods: DELETE
  • Request Content-Type: application/x-www-form-urlencoded or application/json
  • Response Content-Type: application/json
  • Auth required: yes

This endpoint deletes a webhook configuration. Once deleted, the webhook will no longer fire for the associated event.

A webhook with delivery_role primary cannot be deleted while its standby is still live, so that a backup provider is never left standing behind nothing. Either exchange the roles with swap-webhook-delivery-roles and then delete the webhook that is now the standby, or delete the standby first. A standby can always be deleted.

Version-specific information​

The following version-specific changes apply to this endpoint. See the versioning page for more details.

VersionChange details
N/AN/A

Permissions and Authentication​

This API call requires a valid Spaaza session. See the authentication page for more details. The session can be as follows:

  • Admin authentication: The performing user needs to be logged in and have write access to the chain to which the webhook belongs.

Headers​

The following headers can/must be passed to the API call:

ParameterDescription
N/AN/A

HTTP Parameters​

The following HTTP parameters can be passed to the API:

ParameterDescription
id(integer, mandatory) The ID of the webhook configuration to delete.
chain_id(integer, mandatory) The ID of the chain to which the webhook belongs. Must match the webhook's chain.

Example response JSON​

The endpoint returns JSON showing the details of the deleted webhook configuration. An example response is shown below:

{
"result": {
"code": 1,
"status": "ok"
},
"results": {
"webhook": {
"active": false,
"applies_legacy_hmac": false,
"campaign_id": null,
"created_date": "2026-06-20T10:00:00+00:00",
"delivery_role": null,
"deleted": true,
"deleted_by": {
"name": "Admin User",
"user_id": 213112
},
"event_name": "shopper.voucher-issued",
"event_trigger": null,
"filter": null,
"id": 1234,
"identifier_key": null,
"identifier_secret": null,
"is_default": false,
"last_modified_date": "2026-06-26T12:45:00+00:00",
"payload_spaaza_api_version": "1.4.8",
"send_from": null,
"task_id": null,
"type": "https",
"url": "https://example.com/webhooks/spaaza",
"webhook_signature": null
},
"result_type": "delete-webhook"
}
}

Possible error responses​

CodeNameDescriptionHTTP Status
3http_vars_missingRequired parameter is missing (id or chain_id)400
6no_valid_sessionNo valid session key provided or session has expired401
19http_request_method_non_DELETE_not_allowedOnly HTTP DELETE allowed for this API call405
68permission_denied_or_non_existentUser has insufficient permissions or the chain does not exist403
405entity_mismatchThe webhook does not belong to the specified chain400
495webhook_not_foundNo webhook found for the specified ID400
562webhook_delivery_role_conflictThe webhook is a primary whose standby is still live400