Authentication
Registration, sign-in, OAuth, password recovery, customer details.
Register an account
PublicCreates a new customer account (createCustomerV2 mutation).
Base URL: https://saas-api.mona.academy (NEXT_PUBLIC_API)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| String! | Yes | - | |
| firstname | String! | Yes | - |
| lastname | String! | Yes | - |
| password | String! | Yes | - |
| redirect_url | String | No | Redirect URL after verification |
| referral_code | String | No | Referral code (optional) |
| referral_source | String | No | - |
Example request
mutation {
createCustomerV2(input: {
email: "user@example.com"
firstname: "Nguyen"
lastname: "Van A"
password: "********"
redirect_url: "https://your-site.com/verify"
}) {
customer { email }
}
}Example response
{
"data": {
"createCustomerV2": { "customer": { "email": "user@example.com" } }
}
}Sign in (email/password)
PublicSigns in and returns a JWT token (generateCustomerToken mutation).
Base URL: https://saas-api.mona.academy (NEXT_PUBLIC_API)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| String! | Yes | - | |
| password | String! | Yes | - |
Example request
mutation {
generateCustomerToken(email: "user@example.com", password: "********") {
token
}
}Example response
{
"data": { "generateCustomerToken": { "token": "eyJ0eXAiOiJKV1Q..." } }
}Sign in with Google (OAuth)
PublicSigns in through the Google OAuth callback (generateCustomerTokenSocialLogin) and returns a JWT token.
Base URL: https://saas-api.mona.academy (NEXT_PUBLIC_API)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| state | String | Yes | - |
| code | String | Yes | - |
| scope | String | No | - |
| referral_code | String | No | - |
Forgotten password
PublicSends a password reset email containing an OTP (forgotPassword mutation).
Base URL: https://saas-api.mona.academy (NEXT_PUBLIC_API)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| String! | Yes | - |
Verify OTP
PublicVerifies the OTP code sent by email (verifyOtp mutation).
Base URL: https://saas-api.mona.academy (NEXT_PUBLIC_API)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| String! | Yes | - | |
| otp | String! | Yes | - |
Change password (via OTP)
PublicSets a new password once the OTP has been verified (changePassword mutation).
Base URL: https://saas-api.mona.academy (NEXT_PUBLIC_API)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| String! | Yes | - | |
| password | String! | Yes | - |
| otp | String! | Yes | - |
Customer details
🔒 Token requiredReturns the profile of the signed-in customer (getCustomerInfor query).
Base URL: https://saas-api.mona.academy (NEXT_PUBLIC_API)
Example response
{
"data": {
"customer": {
"email": "user@example.com",
"firstname": "Nguyen",
"lastname": "Van A",
"avatar": "https://...",
"is_pro": true
}
}
}Sign out
🔒 Token requiredRevokes the token and ends the session (revokeCustomerToken mutation).
Base URL: https://saas-api.mona.academy (NEXT_PUBLIC_API)
Get social sign-in URLs
PublicReturns the list of OAuth providers (Google, Facebook…) with their login_url.
Base URL: https://saas-api.mona.academy (NEXT_PUBLIC_API)
Example response