AM
EN
Get Started Free
Menu
Features

Auth

Sign-in, sign-up, and session endpoints for authenticating users directly on your domain.

authentication sessions login registration

Auth

AM’s auth endpoints let you build sign-in, sign-up, and password flows without managing tokens, sessions, or security yourself.

These endpoints run on your auth domain and handle the complete authentication lifecycle—from registration to password reset.

Overview

Browser(your domain)/auth/*endpointsTokensissued

Endpoints

EndpointPurpose
POST /auth/sign-upRegister new user with email/password
POST /auth/sign-inAuthenticate with credentials
POST /auth/sign-in-with-tokenPasswordless token authentication
GET /auth/meGet current user profile
POST /auth/refreshRefresh access token
GET /auth/csrf-sessionInitialize CSRF session cookie
GET /auth/csrf-tokenGenerate CSRF token
POST /auth/check-emailCheck email and available login methods
POST /auth/verifyVerify email address
POST /auth/send-magic-linkSend passwordless login link
POST /auth/send-password-resetSend password reset email
POST /auth/reset-passwordSet new password with reset token
POST /auth/accept-inviteAccept account invitation

Authentication Flow

DatabaseAM AuthUserDatabaseAM AuthUserPOST /auth/sign-inValidate credentials (PBKDF2)User recordAccess + Refresh tokens

What You Get Back

Successful authentication returns:

  • Access Token: Short-lived JWT (default 1 hour) for API requests
  • Refresh Token: Long-lived token (default 14 days) for getting new access tokens
  • User Profile: Email, memberships, identity data

CSRF Protection

State-changing requests require CSRF tokens:

  1. Initialize session: GET /auth/csrf-session (sets HttpOnly cookie)
  2. Get token: GET /auth/csrf-token (returns token in X-CSRF-Token header)
  3. Include token in requests via X-CSRF-Token header or csrf_token body field