Admin API
Platform admin endpoints for tenant lifecycle and invite code management.
Overview
The Admin API provides platform-level management of tenants and invite codes. All routes require an API key whose userId is listed in the BRAINSTORMROUTER_PLATFORM_ADMIN_IDS environment variable (comma-separated). This is an allowlist, not RBAC -- only founder-level user IDs have access.
All state-mutating endpoints support ?dry_run=true, which returns what _would_ happen without persisting changes. Useful for Virtual C-Suite agents.
Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /v1/admin/tenants | List tenants |
| GET | /v1/admin/tenants/:id | Get tenant detail |
| POST | /v1/admin/tenants/:id/approve | Approve a tenant |
| POST | /v1/admin/tenants/:id/reject | Reject a tenant |
| POST | /v1/admin/tenants/:id/suspend | Suspend a tenant |
| GET | /v1/admin/invite-codes | List invite codes |
| POST | /v1/admin/invite-codes | Create an invite code |
| DELETE | /v1/admin/invite-codes/:id | Delete an invite code |
| GET | /v1/admin/digest | Business summary digest |
List tenants
curl https://api.brainstormrouter.com/v1/admin/tenants?status=pending \
-H "Authorization: Bearer br_live_..."
Optional query: ?status=pending|active|suspended|rejected.
Approve / reject / suspend
curl -X POST https://api.brainstormrouter.com/v1/admin/tenants/:id/approve?dry_run=true \
-H "Authorization: Bearer br_live_..."
Dry-run response:
{
"dry_run": true,
"would_execute": { "action": "approve_tenant", "id": "..." }
}
Create invite code
curl -X POST https://api.brainstormrouter.com/v1/admin/invite-codes \
-H "Authorization: Bearer br_live_..." \
-H "Content-Type: application/json" \
-d '{ "code": "LAUNCH2026", "max_uses": 100, "expires_at": "2026-12-31T00:00:00Z" }'
All fields are optional. If code is omitted, one is auto-generated.
Business digest
curl https://api.brainstormrouter.com/v1/admin/digest \
-H "Authorization: Bearer br_live_..."
Returns an aggregate summary: tenant counts by status, active API keys, and usage metrics.
SDK and MCP
- TypeScript SDK:
client.admin.listTenants(),client.admin.getTenant(id),
client.admin.approveTenant(id), client.admin.rejectTenant(id), client.admin.suspendTenant(id), client.admin.listInviteCodes(), client.admin.createInviteCode(opts), client.admin.deleteInviteCode(id), client.admin.getDigest()
- MCP tools:
br_list_tenants,br_approve_tenant,br_reject_tenant,
br_get_business_digest, br_create_invite_code