Skip to main content

Login API

The login endpoints allow users to authenticate with the ProductFlo API and obtain access tokens for subsequent API calls.

Email Login

POST /auth/login

Authenticate a user with email and password
Authenticates a user with their email and password, returning a session with access and refresh tokens.

Request

Request Body

string
required
The user’s email address
string
required
The user’s password

Response

object
User information
object
Session information

Phone Login

POST /auth/phone-login

Authenticate a user with phone number and password
Authenticates a user with their phone number and password, returning a session with access and refresh tokens.

Request

Request Body

string
required
The user’s phone number in international format (e.g., +12345678901)
string
required
The user’s password

Response

Same structure as the email login response.

POST /auth/magic-link

Send a magic link to the user’s email for passwordless login
Sends a magic link to the user’s email address for passwordless authentication.

Request

Request Body

string
required
The user’s email address

Response

string
Confirmation message

OTP Authentication

POST /auth/phone-otp

Send a one-time password to the user’s phone
Sends a one-time password (OTP) to the user’s phone number for authentication.

Request

Request Body

string
required
The user’s phone number in international format

Response

string
Confirmation message

Verify OTP

POST /auth/verify-phone-otp

Verify a one-time password sent to the user’s phone
Verifies the one-time password (OTP) sent to the user’s phone number.

Request

Request Body

string
required
The user’s phone number in international format
string
required
The OTP code received by the user

Response

Same structure as the login response, containing user and session information.