au1h
Reference

Auth API

The Better Auth endpoints your clients call, all under /api/auth.

All endpoints live under ${AU1H_URL}/api/auth and, except /jwks and /ok, require x-app-id: <slug> (or au1h-admin for the admin portal). Without it they return 401 "Missing application context". Browser clients must send cookies (credentials: "include").

The SDK wraps these; the table is for direct use and other languages.

EndpointMethodPurpose
/sign-up/emailPOST{ email, password, name } → creates the user in this app and a session
/sign-in/emailPOST{ email, password } → session cookie
/sign-in/socialPOST{ provider: "github" | "google", callbackURL } → redirect URL
/send-verification-emailPOST{ email, callbackURL } → resends the verification link
/verify-emailGETOpened from the email (?token=…&app=<slug>); verifies and redirects
/request-password-resetPOST{ email, redirectTo } → emails a link that lands on redirectTo?token=…
/reset-passwordPOST{ newPassword, token }
/sign-in/magic-linkPOST{ email, callbackURL } → emails a sign-in link
/magic-link/verifyGETOpened from the email; sets the session cookie and redirects
/email-otp/send-verification-otpPOST{ email, type: "sign-in" | "email-verification" | "forget-password" }
/sign-in/email-otpPOST{ email, otp } → session cookie
/email-otp/verify-emailPOST{ email, otp }
/email-otp/reset-passwordPOST{ email, otp, password }
/sign-outPOSTEnds the session
/get-sessionGET{ session, user } or null
/tokenGET{ token }: a 15-minute JWT for your backend
/jwksGETPublic signing keys. No app context needed
/organization/**Organization plugin, when enabled for the app

Full endpoint documentation is Better Auth's: every endpoint behaves as documented there, scoped to the application named by x-app-id.

Example

AU1H=http://localhost:4444
curl -c jar -H 'content-type: application/json' -H 'x-app-id: todo' \
  -d '{"email":"[email protected]","password":"password123","name":"John"}' \
  $AU1H/api/auth/sign-up/email

curl -b jar -H 'x-app-id: todo' $AU1H/api/auth/token

Errors

Errors are { "code": "SNAKE_CASE", "message": "..." } with Better Auth's status codes. au1h-specific codes:

CodeMeaning
UNAUTHORIZED_MISSING_APPLICATION_CONTEXT…No x-app-id header
APP_NOT_REGISTERED…Unknown slug
APP_IS_INACTIVE…Application deactivated in the portal
ADMIN_PORTAL_SIGNUP_IS_BY_INVITATION_ONLY…Admin sign-up refused
YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATIONOrganizations are off for this application

On this page