Admin API
Admin API
Admin endpoints require an admin JWT (pb_adm_*) from /v1/admin/auth/login. User JWTs (pb_usr_*), API keys, and server keys are rejected for browser admin operations.
Admin users are stored in the standalone admin_users table. Create the first admin with:
PRINTBASE_PG_DSN='postgres://user:pass@127.0.0.1:5432/printbase?sslmode=disable' \
go run ./cmd/adminctl create-admin --email admin@example.com --password 'Passw0rd!'Admin authentication
POST /v1/admin/auth/loginreturns apb_adm_*token.GET /v1/admin/auth/mereturns the current admin profile and scopes.
Enterprise management
GET /v1/admin/enterpriseslists enterprises.GET /v1/admin/enterprises/{id}returns the enterprise, organizations, members, and usage counts.PATCH /v1/admin/enterprises/{id}updates enterprise profile fields and requiresadmin:write.GET /v1/admin/organizationslists organizations across enterprises with enterprise summary fields.GET /v1/admin/enterprises/{id}/organizationslists organizations for an enterprise.
Organization resources
Use GET /v1/admin/organizations/{org_id}/{resource} with one of:
print-jobsprinterscomputersapi-keyswebhooksbilling
print-jobs also accepts an optional status query parameter.
Enterprise applications
GET /v1/admin/enterprise-applications?status=pendingGET /v1/admin/enterprise-applications/{id}POST /v1/admin/enterprise-applications/{id}/approvePOST /v1/admin/enterprise-applications/{id}/reject
Application review requires enterprise_applications:read or enterprise_applications:write.