Create a new user account. Email verification will be sent automatically.
{
"email": "user@example.com",
"password": "securepassword123",
"confirmPassword": "securepassword123",
"firstName": "John",
"lastName": "Doe",
"appId": "your-app-id"
}{
"message": "User registered successfully. Please check your email to verify your account.",
"userId": "user_123456"
}curl -X POST "https://your-auth-server.com/api/auth/register" \
-H "x-api-key: your-app-api-key" \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"password": "securepassword123",
"confirmPassword": "securepassword123",
"firstName": "John",
"lastName": "Doe",
"appId": "your-app-id"
}'Authenticate a user and receive access tokens.
{
"email": "user@example.com",
"password": "securepassword123",
"appId": "your-app-id"
}{
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"user": {
"id": "user_123456",
"email": "user@example.com",
"firstName": "John",
"lastName": "Doe",
"role": "user"
}
}curl -X POST "https://your-auth-server.com/api/auth/login" \
-H "x-api-key: your-app-api-key" \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"password": "securepassword123",
"appId": "your-app-id"
}'Verify a user's email address using the token sent via email.
{
"token": "verification_token_from_email"
}curl -X POST "https://your-auth-server.com/api/auth/verify" \
-H "x-api-key: your-app-api-key" \
-H "Content-Type: application/json" \
-d '{
"token": "verification_token_from_email"
}'Send a password reset email to the user.
{
"email": "user@example.com",
"appId": "your-app-id"
}curl -X POST "https://your-auth-server.com/api/auth/forgot-password" \
-H "x-api-key: your-app-api-key" \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"appId": "your-app-id"
}'Reset a user's password using the token from the reset email.
{
"token": "reset_token_from_email",
"password": "newsecurepassword123",
"confirmPassword": "newsecurepassword123"
}curl -X POST "https://your-auth-server.com/api/auth/reset-password" \
-H "x-api-key: your-app-api-key" \
-H "Content-Type: application/json" \
-d '{
"token": "reset_token_from_email",
"password": "newsecurepassword123",
"confirmPassword": "newsecurepassword123"
}'