Takazudo Modular Docs

Type to search...

to open search from anywhere

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

HeaderRequiredValue
Content-TypeYesapplication/json
AuthorizationYesBearer <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

  1. Validates the request body contains a non-empty ids array
  2. Iterates through each subscription ID
  3. Permanently deletes the subscription from the blob store
  4. Removes the subscription from the product index
  5. 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