AdminPrune the admin-activity projection

Prune the admin-activity projection

Deletes admin-activity rows older than olderThanDays from the D1 projection, keeping it a bounded working set. The append-only R2 archive under {env}/admin-activity/ is NOT touched, so nothing is lost — only the indexed copy the page queries. olderThanDays is required and has no default, because a purge that picks its own cutoff is one keystroke from erasing the log. Requires dual auth: X-Admin-API-Key + JWT.

curl -X DELETE "https://api.spkey.co/admin/activity?olderThanDays=42" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN (JWT)" \
  -H "X-API-Key: YOUR_API_KEY"
{
  "success": true,
  "deleted": 3.14,
  "cutoff": "example_string",
  "olderThanDays": 3.14
}
DELETE
/admin/activity
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
olderThanDaysinteger
Required

Delete projection rows older than this many days. The R2 archive is untouched.

Min: 1
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.

Query Parameters

olderThanDaysinteger
Required

Delete projection rows older than this many days. The R2 archive is untouched.

Responses

successboolean
Required
deletednumber
Required

D1 rows removed.

cutoffstring
Required

ISO-8601 instant rows had to predate to be removed.

olderThanDaysnumber
Required