Admin Users
GET /api/admin/users
Section titled “GET /api/admin/users”List Users
List/search every user on the platform, cross-tenant.
Org counts and platform-admin flags come from public; the sign-in
columns are a second pass over Better Auth’s tables, joined by email and
omitted entirely when that schema is unreadable.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| admins_only | query | boolean | no | Only users holding platform-admin access. |
| limit | query | integer | no | |
| offset | query | integer | no | |
| org_id | query | string (uuid) | no | Only members of this organization. |
| q | query | string | no | Search email/name (substring, case-insensitive) |
| status | query | string | no | Filter on the account’s is_active flag. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | UserListResponse |
| 422 | Validation Error | HTTPValidationError |
GET /api/admin/users/{user_id}
Section titled “GET /api/admin/users/{user_id}”Get User
One user: account, org memberships, API tokens, and sign-in identity.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| user_id | path | string (uuid) | yes |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | UserDetailResponse |
| 422 | Validation Error | HTTPValidationError |
GET /api/admin/users/{user_id}/audit
Section titled “GET /api/admin/users/{user_id}/audit”Get User Audit
Admin-panel actions this user performed, plus actions performed on them.
Three shapes have to be matched, because admin_audit_log records a user
in three different places: as the actor, as a user-typed target
(deactivate, admin grant), and — for membership changes — as
meta.user_id behind an org_membership target id. Matching only the
first two silently drops every “added to org X” row, which is exactly the
history a support question asks about.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| limit | query | integer | no | |
| offset | query | integer | no | |
| user_id | path | string (uuid) | yes |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | UserAuditResponse |
| 422 | Validation Error | HTTPValidationError |
GET /api/admin/users/{user_id}/sessions
Section titled “GET /api/admin/users/{user_id}/sessions”Get User Sessions
Sign-in history: the Better Auth sessions still on record for this user.
Empty with auth_directory_available: false means “we cannot see the
auth tables”, which is a different statement from “this user never signed
in” — the console distinguishes the two.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| limit | query | integer | no | |
| offset | query | integer | no | |
| user_id | path | string (uuid) | yes |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | SignInHistoryResponse |
| 422 | Validation Error | HTTPValidationError |