Registration Mutation
Phone Registration Flow
In order to initiate user registration flow, you have to use the same mutation as for login:
mutation Login($input: UsersPermissionsLoginInput!) {
login(input: $input) {
jwt
status
}
}
with following payload:
{
"input": {
"identifier": "<user_phone>",
}
}
Depending on result, you can receive following statuses:
OK
- success, jwt should contain tokenOTP_REQUIRED
- SMS/Email was send to the user, jwt is nullBLOCKED
- user is blocked and is not allowed to loginMFA_NOT_SUPPORTED
- mfa is not enabled and user should use email flow
Response:
{
"data": {
"login": {
"jwt": "<access_token>",
"status": "<status>"
}
}
}
In case of OTP_REQUIRED
you have to send second request for same mutation but different input that will contain OTP code (6 digits):
If using phone
{
"input": {
"identifier": "<user_phone>",
"otp": <otp_code>
}
}
Email registration flow
If you want to register user using email, you have to use registration mutation:
mutation Register($input: UsersPermissionsRegisterInput!) {
register(input: $input) {
jwt
}
}
with following payload:
{
"input": {
"email": "<user_email>",
"password": "<user_password>",
"username": "<user_email>"
}
}
and the response will return JWT token for access:
{
"data": {
"register": {
"jwt": "<access_token>"
}
}
}