AdminDelete hub aggregate

Delete hub aggregate

Admin-only endpoint for deleting a hub aggregate. Supports two modes: DELETE_DO_ONLY removes the Durable Object instance while preserving R2 events (state restored on next access), and DELETE_DO_AND_EVENTS archives all events then permanently removes the DO instance. Requires dual authentication: X-Admin-API-Key header and a JWT with @smartphonekey.com email domain.

curl -X DELETE "https://api.spkey.co/admin/cleanup/hubs/example_string?mode=DELETE_DO_ONLY" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN (JWT)" \
  -H "X-API-Key: YOUR_API_KEY"
{
  "success": true,
  "hubId": "example_string",
  "mode": "example_string",
  "operations": [
    "null"
  ],
  "deletionSummary": "example_string",
  "auditLogPath": "example_string",
  "duration": 3.14,
  "errors": [
    "example_string"
  ]
}
DELETE
/admin/cleanup/hubs/{hubId}
DELETE
Base URLstring

Target server for requests. Edit to use your own host.

Bearer Token (JWT)
Bearer Tokenstring
Required

JWT token from SmartphoneKey authentication. Identifies the B2C user or B2B service.

JWT token from SmartphoneKey authentication. Identifies the B2C user or B2B service.
API Key (header: X-API-Key)
X-API-Keystring
Required

API key for B2B organization access. Provided during organization onboarding.

API key for B2B organization access. Provided during organization onboarding.
query
modestring
Required

Deletion mode: DELETE_DO_ONLY preserves R2 events, DELETE_DO_AND_EVENTS archives and removes everything

Options: DELETE_DO_ONLY, DELETE_DO_AND_EVENTS
Request Preview
Response

Response will appear here after sending the request

Authentication

header
Authorizationstring
Required

Bearer token (JWT). JWT token from SmartphoneKey authentication. Identifies the B2C user or B2B service.

header
X-API-Keystring
Required

API Key for authentication. API key for B2B organization access. Provided during organization onboarding.

Path Parameters

hubIdstring
Required

Hub ID (UUID)

Query Parameters

modestring
Required

Deletion mode: DELETE_DO_ONLY preserves R2 events, DELETE_DO_AND_EVENTS archives and removes everything

Allowed values:DELETE_DO_ONLYDELETE_DO_AND_EVENTS

Responses

successboolean
Required
hubIdstring
Required
modestring
Required
operationsstring[]
Required
deletionSummarystring
auditLogPathstring
Required
durationnumber
Required
errorsstring[]
Required