Authentication

User authentication and authorization endpoints including OAuth2 (Google, GitHub)

User login

post

Authenticate user with email and password

Body

Request payload for user login

emailstring · emailRequired

User's email address

Example: [email protected]
passwordstring · passwordWrite-onlyRequired

User's password

Example: SecurePass@123
Responses
200

User authenticated successfully

application/json
post
/api/v1/auth/login

User logout

post

Logout user and invalidate authentication tokens

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Responses
200

User logged out successfully

application/json
post
/api/v1/auth/logout

Refresh access token

post

Generate a new access token using a valid refresh token

Body

Request payload for refreshing access token

refresh_tokenstringRequired

Valid refresh token

Example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Responses
200

Access token refreshed successfully

application/json
post
/api/v1/auth/refresh

Forgot password

post

Send password reset email

Body

Request payload for initiating password reset

emailstring · emailRequired

Email address of the account to reset password for

Example: [email protected]
Responses
200

Password reset email sent

application/json
post
/api/v1/auth/forgot-password

Reset password

post

Reset user password using the reset token received via email

Body

Request payload for resetting user password

reset_tokenstringRequired

Password reset token received via email

Example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiMTIzZTQ1NjctZTg5Yi0xMmQzLWE0NTYtNDI2NjE0MTc0MDAwIiwiaWF0IjoxNjkxOTYyMzQ1LCJleHAiOjE2OTE5NjU5NDV9.signature
new_passwordstring · password · min: 8 · max: 50Write-onlyRequired

New password for the user account. Must be at least 8 characters long, and contain at least one uppercase letter, one lowercase letter, one digit, and one special character.

Example: NewSecurePass@123
Responses
200

Password reset successfully

application/json
post
/api/v1/auth/reset-password

Sign up with Google (Option 1)

get

Redirect user to Google OAuth2 authorization URL. Backend generates secure state parameter.

Query parameters
redirect_urlstring · uriOptional

Optional client redirect URL. Must be validated against a backend whitelist (e.g., https://app.neevai.com/, https://staging.neevai.com/). If not provided or invalid, the backend will use a default redirect URL.

Example: https://app.neevai.com/dashboard
invite_tokenstringOptional

Optional invitation token for joining an organization

Example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
referral_codestringOptional

Optional referral code for refer-and-earn attribution

Example: AB12CD34EF
Responses
get
/api/v1/auth/oauth/google

No content

Sign up with GitHub (Option 2)

get

Redirect user to GitHub OAuth2 authorization URL. Backend generates secure state parameter.

Query parameters
redirect_urlstring · uriOptional

Optional client redirect URL. Must be validated against a backend whitelist (e.g., https://app.neevai.com/, https://staging.neevai.com/). If not provided or invalid, the backend will use a default redirect URL.

Example: https://app.neevai.com/dashboard
invite_tokenstringOptional

Optional invitation token for joining an organization

Example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
referral_codestringOptional

Optional referral code for refer-and-earn attribution

Example: AB12CD34EF
Responses
get
/api/v1/auth/oauth/github

No content

Handle OAuth2 callback

get

Handle OAuth2 callback from providers and return authentication result

Query parameters
codestringRequired

Authorization code from OAuth provider

statestringRequired

State parameter containing redirect URL and security nonce

errorstringOptional

Error code from OAuth provider

error_descriptionstringOptional

Error description from OAuth provider

Responses
get
/api/v1/auth/oauth/callback
302

Redirect to client application with user session token or error information. Success: Redirects to UI with token in query parameter. Error: Redirects to UI with error and error_description in query parameters.

No content

User signup

post

Create a new user account with email, password, and personal details

Query parameters
invite_tokenstringOptional

Optional invitation token for joining an organization

Example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
referral_codestringOptional

Optional referral code for refer-and-earn attribution

Example: AB12CD34EF
Body

Request payload for creating or updating a user

emailstring · emailRequired

Valid email address for the user account

Example: [email protected]
phone_numberstringOptional

Valid phone number for the user account

Example: +14155552671Pattern: ^\+[1-9][0-9]{7,14}$
passwordstring · password · min: 8 · max: 50Write-onlyRequired

Secure password for the user account. Must be at least 8 characters long, and contain at least one uppercase letter, one lowercase letter, one digit, and one special character.

Example: SecurePass@123
first_namestring · min: 1 · max: 50Required

User's first name

Example: JohnPattern: ^[A-Za-z\-']+$
middle_namestring · min: 1 · max: 50Optional

User's middle name (optional)

Example: MichaelPattern: ^[A-Za-z\-']+$
last_namestring · min: 1 · max: 50Required

User's last name

Example: DoePattern: ^[A-Za-z\-']+$
Responses
post
/api/v1/auth/signup

Verify email address

post

Verify email address using OTP code

Body

Request payload for email verification

emailstring · emailRequired

Email address of the user to verify

Example: [email protected]
verification_codestringRequired

OTP verification code sent to email

Example: 123456Pattern: ^[0-9]{6}$
Responses
200

Email verified successfully

application/json
post
/api/v1/auth/verify-email

Verify phone number

post

Verify phone number using OTP code

Body

Request payload for phone verification

emailstring · emailRequired

Email address of the user to verify phone for

Example: [email protected]
verification_codestringRequired

OTP verification code sent to phone

Example: 654321Pattern: ^[0-9]{6}$
Responses
200

Phone number verified successfully

application/json
post
/api/v1/auth/verify-phone

Resend verification code

post

Resend verification code for email or phone

Body

Request payload for resending verification code

emailstring · emailRequired

Email address of the user

Example: [email protected]
verification_typestring · enumRequired

Type of verification to resend

Example: emailPossible values:
Responses
200

Verification code sent successfully

application/json
post
/api/v1/auth/resend-verification

Last updated