StatsHub Docs
APIEndpoint referenceAdmin

/admin/bot-routing

The legacy route allowed anonymous callers to redirect superadmin bot traffic.

PUT
/api/admin/bot-routing

The legacy route allowed anonymous callers to redirect superadmin bot traffic. The replacement deliberately requires a superadmin in production.

The original builds its INSERT with sql.raw and hand-escaped quotes. The values happen to be safe — one is checked against an allow-list and the other is a boolean — but the pattern is not, so these are bound parameters instead. Same rows written, no string concatenation.

Authorization

AuthorizationBearer <token>

Supabase access token.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X PUT "https://example.com/api/admin/bot-routing" \  -H "Content-Type: application/json" \  -d '{    "superadmin_default_target": "string",    "workers_force_prod": true  }'
{  "superadmin_default_target": "string",  "updated": true,  "workers_force_prod": true}