User Signup API
POST /signup
Description
This API endpoint allows new users to create an account by providing their email address, a password, and an optional referral code. Upon successful signup, the user receives a confirmation message and status indicating the success of the operation.
Request Body
The request utilizes GraphQL to perform the signup
mutation.
Mutation:
mutation signup ($email: String!, $password: String!, $referral: String) {
signup (email: $email, password: $password, referral: $referral) {
message
success
}
}
Variables:
{
"email": "<User_Email_Address>",
"password": "<User_Chosen_Password>",
"referral": "<Referral_Code_Optional>"
}
- email (String): The email address of the user to register.
- password (String): The password chosen by the user for account security.
- referral (String, Optional): A referral code, if the user was referred by another user.
Response:
-
Success (200 OK):
{
"data": {
"signup": {
"message": "Account created successfully.",
"success": true
}
}
}message
(String): A message indicating the result of the signup process.success
(Boolean): A boolean indicating whether the signup was successful.
-
Error (4XX/5XX):
- Appropriate error messages and status codes will be returned in cases of invalid email, weak password, or server errors.
Note:
Ensure that the email address is valid and not already registered. The password should meet the security requirements set by the platform (e.g., minimum length, complexity). The referral code, if provided, should be valid.