Sign Up API
The signup endpoints allow new users to create accounts on the ProductFlo platform. Multiple registration methods are supported, including email, phone number, and OAuth providers.
Email Signup
POST /auth/signup Create a new user account with email and password
Creates a new user account with email and password authentication.
Request
curl -X POST https://api.productflo.io/auth/signup \
-H "Content-Type: application/json" \
-d '{
"first_name": "John",
"last_name": "Doe",
"username": "johndoe",
"email": "john.doe@example.com",
"password": "secure-password",
"confirm_password": "secure-password"
}'
curl -X POST https://api.productflo.io/auth/signup \
-H "Content-Type: application/json" \
-d '{
"first_name": "John",
"last_name": "Doe",
"username": "johndoe",
"email": "john.doe@example.com",
"password": "secure-password",
"confirm_password": "secure-password"
}'
const response = await fetch ( 'https://api.productflo.io/auth/signup' , {
method: 'POST' ,
headers: {
'Content-Type' : 'application/json' ,
},
body: JSON . stringify ({
first_name: 'John' ,
last_name: 'Doe' ,
username: 'johndoe' ,
email: 'john.doe@example.com' ,
password: 'secure-password' ,
confirm_password: 'secure-password'
}),
credentials: 'include'
});
const data = await response . json ();
import requests
response = requests.post(
'https://api.productflo.io/auth/signup' ,
json = {
'first_name' : 'John' ,
'last_name' : 'Doe' ,
'username' : 'johndoe' ,
'email' : 'john.doe@example.com' ,
'password' : 'secure-password' ,
'confirm_password' : 'secure-password'
}
)
data = response.json()
Request Body
The user’s full name (alternative to providing first_name and last_name separately)
Confirmation of the password (must match password)
Response
User information
The user’s unique identifier
The audience the token is intended for
The user’s role (usually “authenticated”)
Timestamp when the email was confirmed (or null if not confirmed)
User-specific metadata including profile information
Show User metadata properties
Session information if auto-login is enabled
{
"first_name" : "John" ,
"last_name" : "Doe" ,
"username" : "johndoe" ,
"email" : "john.doe@example.com" ,
"password" : "secure-password" ,
"confirm_password" : "secure-password"
}
{
"user" : {
"id" : "550e8400-e29b-41d4-a716-446655440000" ,
"aud" : "authenticated" ,
"role" : "authenticated" ,
"email" : "john.doe@example.com" ,
"email_confirmed_at" : null ,
"phone" : "" ,
"confirmed_at" : null ,
"last_sign_in_at" : "2023-05-01T12:34:56.789Z" ,
"app_metadata" : {
"provider" : "email" ,
"providers" : [ "email" ]
},
"user_metadata" : {
"first_name" : "John" ,
"last_name" : "Doe"
},
"identities" : [],
"created_at" : "2023-05-01T12:34:56.789Z" ,
"updated_at" : "2023-05-01T12:34:56.789Z"
}
}
Phone Signup
POST /auth/phone-signup Create a new user account with phone number and password
Creates a new user account with phone number and password authentication.
Request
curl -X POST https://api.productflo.io/auth/phone-signup \
-H "Content-Type: application/json" \
-d '{
"username": "johndoe",
"phone_number": "+12345678901",
"password": "secure-password",
"confirm_password": "secure-password"
}'
curl -X POST https://api.productflo.io/auth/phone-signup \
-H "Content-Type: application/json" \
-d '{
"username": "johndoe",
"phone_number": "+12345678901",
"password": "secure-password",
"confirm_password": "secure-password"
}'
const response = await fetch ( 'https://api.productflo.io/auth/phone-signup' , {
method: 'POST' ,
headers: {
'Content-Type' : 'application/json' ,
},
body: JSON . stringify ({
username: 'johndoe' ,
phone_number: '+12345678901' ,
password: 'secure-password' ,
confirm_password: 'secure-password'
}),
credentials: 'include'
});
const data = await response . json ();
Request Body
The user’s phone number in international format (e.g., +12345678901)
Confirmation of the password (must match password)
Response
Similar to email signup response, with phone number instead of email.
OAuth Provider Signup
POST /auth/provider Create or login with an OAuth provider
Initiates the OAuth flow with an external provider like Google, GitHub, etc.
Request
curl -X POST https://api.productflo.io/auth/provider \
-H "Content-Type: application/json" \
-d '{
"provider": "google"
}'
curl -X POST https://api.productflo.io/auth/provider \
-H "Content-Type: application/json" \
-d '{
"provider": "google"
}'
const response = await fetch ( 'https://api.productflo.io/auth/provider' , {
method: 'POST' ,
headers: {
'Content-Type' : 'application/json' ,
},
body: JSON . stringify ({
provider: 'google'
})
});
const data = await response . json ();
// Redirect user to the provider URL
window . location . href = data . url ;
Request Body
The OAuth provider to use (e.g., google, github, apple)
Response
URL to redirect the user to for OAuth authentication
{
"url" : "https://accounts.google.com/o/oauth2/v2/auth?client_id=..."
}
OAuth Callback
GET /auth/callback Handle OAuth provider callback
This endpoint is called by the OAuth provider after the user authenticates. It completes the OAuth flow and creates or logs in the user.
Request
This endpoint is not typically called directly. The OAuth provider redirects to this URL with an authorization code.
GET /auth/callback?code=AUTHORIZATION_CODE&state=STATE
Response
After successful authentication, the user is redirected to the application with an authenticated session.