Token

/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 code

Error

Message

Scenario

Resolution

getaddrinfo ENOTFOUND

"Could not send request"

Invalid environment name

Use 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 Request

http_exception

"Invalid json format"

Empty payload

Add the payload.

400 Bad Request

invalid_parameters

"Invalid json format"

Invalid JSON format used in the payload.

Use correct JSON format for the payload.

400 Bad Request

invalid_domain

"Invalid API usage"

Invalid environment ID

Use a valid environment ID.

403 Forbidden

http_exception

"Forbidden"

Invalid client_id value

Use a valid client_id value.

403 Forbidden

http_exception

"Forbidden"

Invalid code value

Use a valid code value

422 Unprocessable Entity

invalid_parameters

"client_id": {
"missing": "required"
}

no error description

Missing client_id value

Enter the client_id value

422 Unprocessable Entity

invalid_parameters

"client_id": "field required"

Removed client_id paramater

Add the client_id parameter and value.

422 Unprocessable Entity

invalid_parameters

"grant_type": "unsupported"

no error description

Invalid grant_type

Use a valid grant_type value.

422 Unprocessable Entity

invalid_parameters

"grant_type": "unsupported"

no error description

Missing grant_type value

Enter the correct grant_type value.

422 Unprocessable Entity

invalid_parameters

"grant_type": "field required"

Removed grant_type parameter

Add the grant_type parameter and value.

422 Unprocessable Entity

invalid_parameters

"auth_type": {
"invalid": "unsupported auth_type value"
}
no error description

Invalid auth_type

Use a valid auth_type value.

422 Unprocessable Entity

invalid_parameters

"auth_type": {
"invalid": "unsupported auth_type value"
}

no error description

Missing auth_type value

Enter the correct auth_type value.

422 Unprocessable Entity

invalid_parameters

"auth_type": "field required"

Removed auth_type parameter

Add the auth_type parameter and value.

422 Unprocessable Entity

invalid_parameters

"redirect_uri": {
"invalid": "invalid value"
}

no error description

Invalid redirect_uri value

Enter a valid redirect_uri value.

422 Unprocessable Entity

invalid_request

"redirect_uri_mismatch expected value: xxxxxxxxxxxx received value: "

"redirect_uri does not match expected value"

Missing redirect_uri value

Add a valid redirect_uri value.

422 Unprocessable Entity

invalid_parameters

"redirect_uri": "field required"

Remove redirect_uri parameter

Add a valid redirect_uri parameter and value.

422 Unprocessable Entity

invalid_parameters

"authorization_code expired"

Expired code (authorization_code)

Use a fresh code value

422 Unprocessable Entity

invalid_parameters

"code": "missing"

no error description

Missing code value or null (authorization_code)

Enter the correct code value.

422 Unprocessable Entity

invalid_parameters

"code": "missing"

no error description

Removed code parameter

Add the code parameter and value.

422 Unprocessable Entity

invalid_user

"user_id": {
"invalid": "invalid user_id"
}

no error description

Invalid user_id value

Enter a valid user_id value.

422 Unprocessable Entity

invalid_parameters

"user_id": {
"invalid": "invalid format"
}

Missing user_id value

Add valid user_id value.

422 Unprocessable Entity

invalid_parameters

"user_id": "field required"

Removed user_id parameter

Add the user_id parameter and value.

422 Unprocessable Entity

invalid_parameters

"305": "Expecting '.' delimiter: line x column xx (char 305)"

Invalid legal_acceptances value

Enter a valid user_id value.

422 Unprocessable Entity

invalid_parameters

"302": "Expecting value: line xx column xx (char 302)

Missing legal_acceptances value

Enter a valid legal_acceptances value.

429 Too Many Requests

user_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 code

Enter 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 code

Error

Message

Scenario

Resolution

getaddrinfo ENOTFOUND

"Could not send request"

Invalid environment name

Enter 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 Request

invalid_domain

"Invalid API usage"

Invalid environment ID

Enter the correct environment ID.

403 Forbidden

http_exception

"Forbidden"

Invalid client_id value

Enter a valid client_id value.

403 Forbidden

http_exception

"Forbidden"

Invalid code (authorization_code)

Enter a valid code value.

422 Unprocessable Entity

invalid_parameters

"client_id": {
"missing": "required"
}

no error description

Missing client_id value/"null"

Enter a valid client_id value.

422 Unprocessable Entity

invalid_parameters

"client_id": "field required"

Removed client_id parameter

Add the client_id parameter and value.

422 Unprocessable Entity

invalid_parameters

"grant_type": "unsupported"

no error description

Invalid grant_type value

Enter a valid grant_type value.

422 Unprocessable Entity

invalid_parameters

"grant_type": "field required"

Missing grant_type value

Enter a valid grant_type value

422 Unprocessable Entity

invalid_parameters

"auth_type": {
"invalid": "unsupported auth_type value"
}

no error description

Invalid auth_type value

Enter a valid auth_type value.

422 Unprocessable Entity

invalid_parameters

"auth_type": {
"invalid": "unsupported auth_type value"
}

no error description

Missing auth_type value

Enter a valid auth_type value.

422 Unprocessable Entity

invalid_parameters

"redirect_uri": {
"invalid": "invalid value"
}

no error description

Invalid redirect_uri value

Enter 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 value

Enter a valid redirect_uri value.

422 Unprocessable Entity

invalid_parameters

"redirect_uri":"field required"

Removed redirect_uri parameter

Add the redirect_uri parameter and value.

422 Unprocessable Entity

invalid_request

"error_description":"authorization_code expired"

Expired code (authorization_code)

Use a fresh code value.

422 Unprocessable Entity

invalid_parameters

"code": "missing"

no error description

Missing code value or null (authorization_code)

Add the correct code value.

422 Unprocessable Entity

invalid_parameters

"code": "missing"

no error description

Removed code parameter

Add the code parameter and value.

422 Unprocessable Entity

invalid_parameters

"user_id": {
"invalid": "invalid format"
}

no error description

Invalid user_id value

Enter a valid user_id value.

422 Unprocessable Entity

invalid_parameters

"user_id": "field required"

Removed user_id parameter

Add the user_id parameter and value.

422 Unprocessable Entity

invalid_parameters

Example:

"error_details": {
"291": "Expecting ',' delimiter: line x column xx (char 291)"

Invalid legal_acceptances

Enter a valid legal_acceptances value.

422 Unprocessable Entity

invalid_parameters

Example:

"error_details": {
"288": "Expecting ',' delimiter: line x column xx (char 288)"

Missing legal_acceptances value

Enter a valid legal_acceptances value.

503 Service Temporarily Unavailable

"Backend action does not exist"

Invalid version code

Enter a valid version value.