/token

✅ Email as user_id

These are the possible response codes when you make an API call to the /token endpoint using an email address as user_id.

⚠️

Warning

If the /token endpoint receives five (5) attempts (either successful or failed) within a minute, it will return a 429 Too Many Requests error response. This will block the user account for 5 minutes and will automatically be unblocked when the time has passed.

Response codeErrorMessageScenarioResolution
-getaddrinfo ENOTFOUND"Could not send request"Invalid environment nameUse the correct environment name.
200 OK-"bearer" value
"access_token" value
"refresh_token" value
Get access_token successfully
200 OK-"bearer" value
"access_token" value
"refresh_token" value
legal_acceptances is set to false
200 OK-"bearer" value
"access_token" value
"refresh_token" value
Removed legal_acceptances parameter
400 Bad Requesthttp_exception"Invalid json format"Empty payloadAdd the payload.
400 Bad Requestinvalid_parameters"Invalid json format"Invalid JSON format used in the payload.Use correct JSON format for the payload.
400 Bad Requestinvalid_domain"Invalid API usage"Invalid environment IDUse a valid environment ID.
403 Forbiddenhttp_exception"Forbidden"Invalid client_id valueUse a valid client_id value.
403 Forbiddenhttp_exception"Forbidden"Invalid code valueUse a valid code value
422 Unprocessable Entityinvalid_parameters"client_id": {
"missing": "required"
}

no error description
Missing client_id valueEnter the client_id value
422 Unprocessable Entityinvalid_parameters"client_id": "field required"Removed client_id paramaterAdd the client_id parameter and value.
422 Unprocessable Entityinvalid_parameters"grant_type": "unsupported"

no error description
Invalid grant_typeUse a valid grant_type value.
422 Unprocessable Entityinvalid_parameters"grant_type": "unsupported"

no error description
Missing grant_type valueEnter the correct grant_type value.
422 Unprocessable Entityinvalid_parameters"grant_type": "field required"Removed grant_type parameterAdd the grant_type parameter and value.
422 Unprocessable Entityinvalid_parameters"auth_type": {
"invalid": "unsupported auth_type value"
}
no error description
Invalid auth_typeUse a valid auth_type value.
422 Unprocessable Entityinvalid_parameters"auth_type": {
"invalid": "unsupported auth_type value"
}

no error description
Missing auth_type valueEnter the correct auth_type value.
422 Unprocessable Entityinvalid_parameters"auth_type": "field required"Removed auth_type parameterAdd the auth_type parameter and value.
422 Unprocessable Entityinvalid_parameters"redirect_uri": {
"invalid": "invalid value"
}

no error description
Invalid redirect_uri valueEnter a valid redirect_uri value.
422 Unprocessable Entityinvalid_request"redirect_uri_mismatch expected value: xxxxxxxxxxxx received value: "

"redirect_uri does not match expected value"
Missing redirect_uri valueAdd a valid redirect_uri value.
422 Unprocessable Entityinvalid_parameters"redirect_uri": "field required"Remove redirect_uri parameterAdd a valid redirect_uri parameter and value.
422 Unprocessable Entityinvalid_parameters"authorization_code expired"Expired code (authorization_code)Use a fresh code value
422 Unprocessable Entityinvalid_parameters"code": "missing"

no error description
Missing code value or null (authorization_code)Enter the correct code value.
422 Unprocessable Entityinvalid_parameters"code": "missing"

no error description
Removed code parameterAdd the code parameter and value.
422 Unprocessable Entityinvalid_user"user_id": {
"invalid": "invalid user_id"
}

no error description
Invalid user_id valueEnter a valid user_id value.
422 Unprocessable Entityinvalid_parameters"user_id": {
"invalid": "invalid format"
}
Missing user_id valueAdd valid user_id value.
422 Unprocessable Entityinvalid_parameters"user_id": "field required"Removed user_id parameterAdd the user_id parameter and value.
422 Unprocessable Entityinvalid_parameters"305": "Expecting '.' delimiter: line x column xx (char 305)"Invalid legal_acceptances valueEnter a valid user_id value.
422 Unprocessable Entityinvalid_parameters"302": "Expecting value: line xx column xx (char 302)Missing legal_acceptances valueEnter a valid legal_acceptances value.
429 Too Many Requestsuser_attempts_limits"Too many requests"Attempts rate limit exceeded ( 5 attempts in one minute)Limit calls to the endpoint within the rate limit.
503 Service Temporarily Unavailable-"Backend action does not exist"Invalid version codeEnter the correct version code

✅ Mobile phone number as user_id

These are the possible response codes when you make an API call to the /token endpoint using a mobile phone number as user_id.

Responses codeErrorMessageScenarioResolution
-getaddrinfo ENOTFOUND"Could not send request"Invalid environment nameEnter the right environment name
200 OK-"bearer" value
"access_token" value
"refresh_token" value
Get access_token successfully
200 OK-"bearer" value
"access_token" value
"refresh_token" value
Legal_acceptances to false
200 OK-"bearer" value
"access_token" value
"refresh_token" value
Removed Legal_acceptances parameter
400 Bad Requestinvalid_domain"Invalid API usage"Invalid environment IDEnter the correct environment ID.
403 Forbiddenhttp_exception"Forbidden"Invalid client_id valueEnter a valid client_id value.
403 Forbiddenhttp_exception"Forbidden"Invalid code (authorization_code)Enter a valid code value.
422 Unprocessable Entityinvalid_parameters"client_id": {
"missing": "required"
}

no error description
Missing client_id value/"null"Enter a valid client_id value.
422 Unprocessable Entityinvalid_parameters"client_id": "field required"Removed client_id parameterAdd the client_id parameter and value.
422 Unprocessable Entityinvalid_parameters"grant_type": "unsupported"

no error description
Invalid grant_type valueEnter a valid grant_type value.
422 Unprocessable Entityinvalid_parameters"grant_type": "field required"Missing grant_type valueEnter a valid grant_type value
422 Unprocessable Entityinvalid_parameters"auth_type": {
"invalid": "unsupported auth_type value"
}

no error description
Invalid auth_type valueEnter a valid auth_type value.
422 Unprocessable Entityinvalid_parameters"auth_type": {
"invalid": "unsupported auth_type value"
}

no error description
Missing auth_type valueEnter a valid auth_type value.
422 Unprocessable Entityinvalid_parameters"redirect_uri": {
"invalid": "invalid value"
}

no error description
Invalid redirect_uri valueEnter a valid redirect_uri value.
422 Unprocessable Entity"invalid_request""error_details": "redirect_uri_mismatch expected value: xxxxxxxxxxxx received value: ",
"error_description": "redirect_uri does not match expected value"
Missing redirect_uri valueEnter a valid redirect_uri value.
422 Unprocessable Entityinvalid_parameters"redirect_uri":"field required"Removed redirect_uri parameterAdd the redirect_uri parameter and value.
422 Unprocessable Entityinvalid_request"error_description":"authorization_code expired"Expired code (authorization_code)Use a fresh code value.
422 Unprocessable Entityinvalid_parameters"code": "missing"

no error description
Missing code value or null (authorization_code)Add the correct code value.
422 Unprocessable Entityinvalid_parameters"code": "missing"

no error description
Removed code parameterAdd the code parameter and value.
422 Unprocessable Entityinvalid_parameters"user_id": {
"invalid": "invalid format"
}

no error description
Invalid user_id valueEnter a valid user_id value.
422 Unprocessable Entityinvalid_parameters"user_id": "field required"Removed user_id parameterAdd the user_id parameter and value.
422 Unprocessable Entityinvalid_parametersExample:

"error_details": {
"291": "Expecting ',' delimiter: line x column xx (char 291)"
Invalid legal_acceptancesEnter a valid legal_acceptances value.
422 Unprocessable Entityinvalid_parametersExample:

"error_details": {
"288": "Expecting ',' delimiter: line x column xx (char 288)"
Missing legal_acceptances valueEnter a valid legal_acceptances value.
503 Service Temporarily Unavailable-"Backend action does not exist"Invalid version codeEnter a valid version value.