Better Auth in Rust

API Routes

Complete list of all authentication endpoints.

All routes are relative to the auth mount point (e.g., /auth when using nest("/auth", ...)).

For interactive API documentation with request/response schemas, see the OpenAPI Reference.

Core Endpoints

MethodPathAuthDescription
GET/okNoHealth check ({ "status": true })
GET/reference/openapi.jsonNoOpenAPI specification
POST/update-userYesUpdate user profile
POST/delete-userYesDelete user account
POST/change-emailYesChange email address
GET/delete-user/callbackNoConfirm deletion via email token

Email & Password (EmailPasswordPlugin)

MethodPathAuthDescription
POST/sign-up/emailNoRegister with email and password
POST/sign-in/emailNoSign in with email and password
POST/sign-in/usernameNoSign in with username and password

Session Management (SessionManagementPlugin)

MethodPathAuthDescription
GET/get-sessionYesGet current session and user
POST/get-sessionYesGet current session (alt method)
POST/sign-outYesRevoke current session
GET/list-sessionsYesList all user sessions
POST/revoke-sessionYesRevoke a specific session by token
POST/revoke-sessionsYesRevoke all user sessions
POST/revoke-other-sessionsYesRevoke all sessions except current

Password Management (PasswordManagementPlugin)

MethodPathAuthDescription
POST/forget-passwordNoRequest password reset email
POST/reset-passwordNoReset password with token
GET/reset-password/{token}NoValidate a reset token
POST/change-passwordYesChange password (requires current)
POST/set-passwordYesSet password for OAuth-only users

Email Verification (EmailVerificationPlugin)

MethodPathAuthDescription
POST/send-verification-emailYesSend verification email
GET/verify-emailNoVerify email with token (query param)

Account Management (AccountManagementPlugin)

MethodPathAuthDescription
GET/list-accountsYesList linked accounts
POST/unlink-accountYesUnlink an account provider

OAuth / Social Login (OAuthPlugin)

MethodPathAuthDescription
POST/sign-in/socialNoStart OAuth sign-in flow
GET/callback/{provider}NoOAuth provider callback
POST/link-socialYesLink a social account to current user
POST/get-access-tokenYesGet stored OAuth access token
POST/refresh-tokenYesRefresh OAuth access token

Two-Factor Authentication (TwoFactorPlugin)

MethodPathAuthDescription
POST/two-factor/enableYesEnable 2FA (requires password)
POST/two-factor/disableYesDisable 2FA (requires password)
POST/two-factor/get-totp-uriYesGet TOTP URI for authenticator app
POST/two-factor/verify-totpNo*Verify TOTP code during sign-in
POST/two-factor/send-otpNo*Send OTP via email
POST/two-factor/verify-otpNo*Verify OTP code
POST/two-factor/generate-backup-codesYesGenerate new backup codes
POST/two-factor/verify-backup-codeNo*Verify backup code during sign-in

*These endpoints use a pending verification token instead of a session token.

Organization (OrganizationPlugin)

MethodPathAuthDescription
POST/organization/createYesCreate an organization
POST/organization/updateYesUpdate organization details
POST/organization/deleteYesDelete an organization
GET/organization/listYesList user's organizations
GET/organization/get-full-organizationYesGet org with members and invitations
POST/organization/check-slugYesCheck slug availability
POST/organization/set-activeYesSet active organization on session
POST/organization/leaveYesLeave an organization
GET/organization/get-active-memberYesGet current member in active org
GET/organization/list-membersYesList organization members
POST/organization/remove-memberYesRemove a member
POST/organization/update-member-roleYesChange a member's role
POST/organization/invite-memberYesInvite user by email
GET/organization/get-invitationYesGet invitation details
GET/organization/list-invitationsYesList org's pending invitations
GET/organization/list-user-invitationsYesList user's pending invitations
POST/organization/accept-invitationYesAccept an invitation
POST/organization/reject-invitationYesReject an invitation
POST/organization/cancel-invitationYesCancel a pending invitation
POST/organization/has-permissionYesCheck RBAC permission

Admin (AdminPlugin)

MethodPathAuthDescription
POST/admin/set-roleAdminSet user role
POST/admin/create-userAdminCreate a new user
GET/admin/list-usersAdminList users with search/filter/sort
POST/admin/list-user-sessionsAdminList user's sessions
POST/admin/ban-userAdminBan a user
POST/admin/unban-userAdminUnban a user
POST/admin/impersonate-userAdminStart impersonating a user
POST/admin/stop-impersonatingAdminStop impersonation
POST/admin/revoke-user-sessionAdminRevoke a specific session
POST/admin/revoke-user-sessionsAdminRevoke all user sessions
POST/admin/remove-userAdminPermanently delete a user
POST/admin/set-user-passwordAdminReset a user's password
POST/admin/has-permissionYesCheck admin permission

API Key (ApiKeyPlugin)

MethodPathAuthDescription
POST/api-key/createYesCreate a new API key
GET/api-key/getYesGet API key by ID
POST/api-key/updateYesUpdate an API key
POST/api-key/deleteYesDelete an API key
GET/api-key/listYesList user's API keys

Passkey / WebAuthn (PasskeyPlugin)

MethodPathAuthDescription
GET/passkey/generate-register-optionsYesGet WebAuthn registration options
POST/passkey/verify-registrationYesVerify and store a new passkey
POST/passkey/generate-authenticate-optionsNoGet WebAuthn authentication options
POST/passkey/verify-authenticationNoVerify passkey and create session
GET/passkey/list-user-passkeysYesList user's passkeys
POST/passkey/delete-passkeyYesDelete a passkey
POST/passkey/update-passkeyYesRename a passkey

Authentication

Authenticated endpoints require a session token sent as:

  • Bearer token: Authorization: Bearer session_abc123...
  • Cookie: Cookie: better-auth.session-token=session_abc123...

Admin endpoints additionally require the user to have the admin role (configurable, default: "admin").

On this page