Admin


GET /admin/orgs

List all organizations (super-admin)

Super-admin only. Cross-tenant org list with member/project counts. Excludes soft-deleted orgs.

Auth: Bearer token required

Responses

StatusDescriptionSchema
200OKAdminOrgList
401UnauthorizedError
403ForbiddenError

GET /admin/orgs/{id}

Get organization detail (super-admin)

Super-admin only. Org fields plus member and project lists.

Auth: Bearer token required

Path parameters

NameTypeDescription
idstringOrganization ID

Responses

StatusDescriptionSchema
200OKAdminOrgDetail
401UnauthorizedError
403ForbiddenError
404Not FoundError

POST /admin/orgs/{id}/suspend

Suspend an organization (super-admin)

Super-admin only. Sets suspended_at = now(). Idempotent. Audited in the same transaction.

Auth: Bearer token required

Path parameters

NameTypeDescription
idstringOrganization ID

Responses

StatusDescriptionSchema
200OKAdminOrgSuspendResult
401UnauthorizedError
403ForbiddenError
404Not FoundError

POST /admin/orgs/{id}/unsuspend

Unsuspend an organization (super-admin)

Super-admin only. Clears suspended_at. Audited in the same transaction.

Auth: Bearer token required

Path parameters

NameTypeDescription
idstringOrganization ID

Responses

StatusDescriptionSchema
200OKAdminOrgSuspendResult
401UnauthorizedError
403ForbiddenError
404Not FoundError

GET /admin/audit

List control-plane admin audit events

Super-admin only. Paginated, filterable list of control-plane audit events — super-admin actions, plus platform events that belong to no tenant (a GitHub installation.created arriving before any org owns the installation). Behind the /admin/* session + requireSuperAdmin mount.

Auth: Bearer token required

Query parameters

NameTypeDescription
limitintegerMax results (1-200)
offsetintegerPagination offset
actorstringFilter by actor user ID
actionstringFilter by action name
resourceKindstringFilter by resource kind
sincestring(date-time)ISO 8601 datetime lower bound
untilstring(date-time)ISO 8601 datetime upper bound

Responses

StatusDescriptionSchema
200OKAdminAuditList
401UnauthorizedError
403ForbiddenError

GET /admin/metrics/overview

Control-plane metrics overview

Super-admin only. User/session/signup counts for the control-plane dashboard. Behind the /admin/* session + requireSuperAdmin mount.

Auth: Bearer token required

Responses

StatusDescriptionSchema
200OKAdminMetricsOverview
401UnauthorizedError
403ForbiddenError

DELETE /admin/projects/{projectId}/nuke

Wipe a project's data (super-admin)

Super-admin only. Destroys every row in every table the target project's data reaches, leaving the project itself, its members, its repo links, its tokens, and its audit trail. Counts are keyed by SQL table name. Idempotent.

Auth: Bearer token required

Path parameters

NameTypeDescription
projectIdstringProject ID to nuke

Query parameters

NameTypeDescription
orgIdstringDisambiguates when the project name exists in more than one org

Responses

StatusDescriptionSchema
200OKNukeResult
401UnauthorizedError
403ForbiddenError

GET /admin/orphans

Preview rows whose organization no longer exists (super-admin)

Super-admin only. Groups the purgeable rows by table and by the org id they name, which resolves to no organization. Reads through the orphan-purge role, so a row belonging to a live org is not in the relation at all — this cannot report one. Behind the /admin/* session + requireSuperAdmin mount.

Auth: Bearer token required

Responses

StatusDescriptionSchema
200OKOrphanSurvey
401UnauthorizedError
403ForbiddenError

DELETE /admin/orphans

Delete rows whose organization no longer exists (super-admin)

Super-admin only. Hard-deletes every row the survey reports and returns the per-table counts. Irreversible: these rows outlived their org deliberately, so this is an operator act — preview with GET first. Behind the /admin/* session + requireSuperAdmin mount.

Auth: Bearer token required

Responses

StatusDescriptionSchema
200OKOrphanPurgeResult
401UnauthorizedError
403ForbiddenError

GET /admin/integrations/github-installations

List all GitHub installations (super-admin)

Super-admin only. Cross-tenant list of every GitHub App installation. No pagination. Behind the /admin/* session + requireSuperAdmin mount.

Auth: Bearer token required

Responses

StatusDescriptionSchema
200OKAdminGithubInstallationList
401UnauthorizedError
403ForbiddenError

Schemas

AdminAuditEvent

FieldTypeDescription
idstring(required)
actorUserIdstring(required)
actionstring(required)
resourceKindstring(required)
resourceIdstring | null(required)
payloadobject(required)
createdAtstring | string(required)

AdminAuditList

FieldTypeDescription
dataAdminAuditEvent[](required)
totalinteger(required)
limitinteger(required)
offsetinteger(required)

AdminGithubInstallation

FieldTypeDescription
idstring(required)
githubInstallationIdstring(required)
githubOrgLoginstring(required)
statusstring(required)
grantedReposCountinteger(required)
installedAtstring | string(required)
lastEventAtstring | string(required)
orgNamestring | null(required)
orgSlugstring | null(required)

AdminGithubInstallationList

FieldTypeDescription
dataAdminGithubInstallation[](required)

AdminMetricsOverview

FieldTypeDescription
totalUsersinteger(required)
signups24hinteger(required)
signups7dinteger(required)
signups30dinteger(required)
activeSessionsinteger(required)
mauApproxinteger(required)

AdminOrgDetail

FieldTypeDescription
idstring(required)
namestring(required)
slugstring(required)
logostring | null(required)
createdAtstring | string(required)
metadatastring | null(required)
suspendedAtstring | string | null(required)
membersAdminOrgMember[](required)
projectsAdminOrgProject[](required)

AdminOrgList

FieldTypeDescription
dataAdminOrgSummary[](required)

AdminOrgMember

FieldTypeDescription
userIdstring(required)
emailstring(required)
usernamestring | null(required)
namestring | null(required)
rolestring(required)
joinedAtstring | string(required)

AdminOrgProject

FieldTypeDescription
idstring(required)
namestring(required)
slugstring(required)
createdAtstring | string(required)

AdminOrgSummary

FieldTypeDescription
idstring(required)
namestring(required)
slugstring(required)
createdAtstring | string(required)
suspendedAtstring | string | null(required)
memberCountinteger(required)
projectCountinteger(required)

AdminOrgSuspendResult

FieldTypeDescription
idstring(required)
suspendedAtstring | string | null(required)

Error

FieldTypeDescription
errorstring(required)
codestring

NukeResult

FieldTypeDescription
projectIdstring(required)
rowCountsDeletedobject(required)

OrphanPurgeResult

FieldTypeDescription
deletedobject(required)
totalinteger(required)

OrphanSurvey

FieldTypeDescription
groupsOrphanedRowGroup[](required)
totalinteger(required)

OrphanedRowGroup

FieldTypeDescription
tablestring(required)
orgIdstring(required)
rowsinteger(required)