1. Callbacks
  2. Delete Callback URLs
DELETE
/callbacks
curl --request DELETE \
     --url https://sandbox.masonhub.co/dragonfly-cosmetics-demo/api/v1/callbacks \
     --header 'Authorization: Bearer <token>' \
     --header 'Content-Type: application/json' \
     --data '{
  "callback_ids": []
}'

Delete registered callback URLs to stop receiving webhook notifications. Deletion is immediate and cannot be undone.

Permanent Action: Callback deletion is immediate and irreversible. You’ll need to re-register callbacks if deleted by mistake.

​
Request Body

Send an array of callback UUIDs to delete. These IDs are obtained from the Get Callback URLs or Create Callback URLs endpoints.

callback_ids
required
array

Array of callback UUID strings to delete.

curl -X DELETE "https://app.masonhub.co/{account}/api/v1/callbacks" \
  -H "Authorization: Bearer your_jwt_token" \
  -H "Content-Type: application/json" \
  -d '["callback-uuid-123", "callback-uuid-456"]'
{
  "deleted": [
    {
      "id": "callback-uuid-123",
      "status": "success"
    },
    {
      "id": "callback-uuid-456",
      "status": "success"
    }
  ]
}

​
Common Failure Reasons

Deletions may fail if:

  • Callback ID doesn’t exist in your account
  • Callback was already deleted
  • Invalid UUID format provided
  • Insufficient permissions for the callback

​
Temporary Suspension Alternative

Instead of permanently deleting callbacks, consider using Callback Holds to temporarily pause delivery:

  • Create Hold

  • Remove Hold

Pause event delivery without losing configuration:

POST /callback_holds
[
  "skuInventoryChange",
  "orderEvent"
]

Events won’t be delivered while holds are active, but callbacks remain registered.

Callback holds are useful for maintenance windows, system upgrades, or temporary service disruptions without losing your webhook configuration.

​
Deletion Process

1

List Callbacks

Use Get Callback URLs to retrieve callback IDs

2

Identify Targets

Select which callbacks to delete based on URL, message type, or other criteria

3

Submit Deletion

Send array of callback IDs to the DELETE endpoint

4

Verify Response

Check that all deletions succeeded, handle any failures

​
Batch Deletion

Delete multiple callbacks efficiently in a single request:

[
  "callback-uuid-001",
  "callback-uuid-002",
  "callback-uuid-003",
  "callback-uuid-004"
]

The response includes individual status for each deletion in the deleted array.

​
Example: Clean Up Old Callbacks

import requests

def cleanup_old_callbacks(base_url, token, old_domain):
    """Remove callbacks pointing to decommissioned endpoints"""

    headers = {"Authorization": f"Bearer {token}"}

    # Get all callbacks
    response = requests.get(
        f"{base_url}/callbacks",
        headers=headers,
        params={"message_type": "all"}
    )
    callbacks = response.json()

    # Find callbacks to delete
    to_delete = [
        cb['id'] for cb in callbacks
        if old_domain in cb['url']
    ]

    if not to_delete:
        print("No callbacks to delete")
        return

    # Delete in batch
    response = requests.delete(
        f"{base_url}/callbacks",
        headers=headers,
        json=to_delete
    )

    result = response.json()
    print(f"Deleted {len([d for d in result['deleted'] if d['status'] == 'success'])} callbacks")

​
Monitoring Impact

After deletion, the following changes take effect immediately:

1

Stop Deliveries

Webhook deliveries stop immediately for deleted callbacks

2

Cancel Pending

Any queued events for deleted callbacks are discarded

3

Clear Retries

Previously failed delivery attempts are canceled

4

Remove Configuration

Callback configuration is permanently removed from the system

​
Best Practices

​
Re-registration

If you need to re-register a deleted callback:

  1. Use Create Callback URLs with the same URL and message type
  2. A new callback ID will be assigned
  3. Events will resume delivery after successful creation

Before deleting production callbacks, test your system’s behavior without webhook events to ensure graceful degradation.