- Callbacks
- Delete Callback URLs
Callbacks
Delete Callback URLs
Remove callback subscriptions by ID
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.
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
List Callbacks
Use Get Callback URLs to retrieve callback IDs
Identify Targets
Select which callbacks to delete based on URL, message type, or other criteria
Submit Deletion
Send array of callback IDs to the DELETE endpoint
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:
Stop Deliveries
Webhook deliveries stop immediately for deleted callbacks
Cancel Pending
Any queued events for deleted callbacks are discarded
Clear Retries
Previously failed delivery attempts are canceled
Remove Configuration
Callback configuration is permanently removed from the system
​Best Practices
Use Holds First
Try callback holds before permanent deletion for temporary issues.
Verify Before Delete
Use Get Callback URLs to confirm IDs before deletion to avoid mistakes.
Backup Configuration
Keep records of callback URLs and message types for easy re-registration.
Batch Operations
Delete multiple callbacks in single requests for efficiency.
Monitor Endpoints
Remove callbacks for decommissioned endpoints to keep configuration clean.
Document Changes
Keep audit logs of callback deletions for troubleshooting and compliance.
​Re-registration
If you need to re-register a deleted callback:
- Use Create Callback URLs with the same URL and message type
- A new callback ID will be assigned
- Events will resume delivery after successful creation
Before deleting production callbacks, test your system’s behavior without webhook events to ensure graceful degradation.
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"]'
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": []
}'{
"deleted": [
{
"id": "callback-uuid-123",
"status": "success"
},
{
"id": "callback-uuid-456",
"status": "success"
}
]
}