Admin Notify Delete
Admin Notify Delete
Permanently delete notify subscriptions from the blob store. This action cannot be undone.
This endpoint permanently deletes data. Use with caution - deleted subscriptions cannot be recovered.
Endpoint
POST /api/admin/notify/delete
Authentication
Requires Bearer token authentication.
Authorization: Bearer <PREORDER_API_TOKEN>
Request
Headers
| Header | Required | Value |
|---|---|---|
Content-Type | Yes | application/json |
Authorization | Yes | Bearer <token> |
Body
interface AdminBulkDeleteRequest {
ids: Array<{
id: string; // Subscription ID
productSlug: string; // Product slug for the subscription
}>;
}
Example Request
curl -X POST https://preview--takazudomodular.netlify.app/api/admin/notify/delete \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $PREORDER_API_TOKEN" \
-d '{
"ids": [
{ "id": "sub-001", "productSlug": "n32b-slim" },
{ "id": "sub-002", "productSlug": "n32b-slim" }
]
}'
Response
Success Response (200)
interface AdminBulkDeleteResponse {
success: true;
deletedCount: number; // Number of successfully deleted subscriptions
deletedIds: string[]; // IDs that were successfully deleted
errors?: Array<{ // Optional: any errors that occurred
id: string;
error: string;
}>;
}
Example Success Response
{
"success": true,
"deletedCount": 2,
"deletedIds": ["sub-001", "sub-002"]
}
Partial Success Response
When some items fail to delete:
{
"success": true,
"deletedCount": 1,
"deletedIds": ["sub-001"],
"errors": [
{ "id": "sub-999", "error": "Failed to delete subscription" }
]
}
Error Responses
Validation Error (400)
{
"success": false,
"error": "ids array is required"
}
{
"success": false,
"error": "ids array cannot be empty"
}
Authentication Error (401)
{
"success": false,
"error": "Unauthorized"
}
Behavior
- Validates the request body contains a non-empty
idsarray - Iterates through each subscription ID
- Permanently deletes the subscription from the blob store
- Removes the subscription from the product index
- Returns summary of deleted items and any errors
Use Cases
- Cleaning up test data
- Removing duplicate entries
- GDPR compliance (data deletion requests)
- Pruning old archived records
Related Endpoints
- Admin Notify Archive - Archive (soft delete) subscriptions
- Admin Notify Unarchive - Restore archived subscriptions
- Admin Notify Archives List - List archived subscriptions