Error Creating a User With the Phone Number Attribute Via the Management API

Overview

This article explains an error that occurs when attempting to create a user via the Management API. For example, the POST request in the example below to create a user that includes the phone_number attribute in the request body results in the following error:

phone_number is not allowed…

{

"email": "email_of_new_user",

"connection": "connection_name",

"password": "password_for_new_user"

}

Applies To

  • Management API
  • Attributes for Flexible Identifiers

Cause

The phone_number attribute is an identifier that must be explicitly enabled on the database connection before it can be used during user creation. This configuration is not enabled by default.

Solution

To resolve the issue, enable the phone_number attribute as an identifier within the database connection’s settings.

  1. Navigate to Authentication > Database.
  2. Select the relevant database connection.
  3. Select the Attributes tab.
  4. Enable the new attributes configuration.
  5. Add phone_number as an identifier.

NOTE: If a phone_number for the user is not available, the phone_number property must be omitted from the POST request.

For additional information, review the documentation on Attributes for Flexible Identifiers.