Error Missing Required Property Username When Updating User via Management API

Overview

When attempting to update a user profile using the Management API PATCH /api/v2/users/{id} endpoint, the following error message is returned:

Missing required property: username

This error occurs when the request payload does not include the username field, even if the update is intended for other attributes such as metadata.

Applies To

  • Management API
  • Database Connections
  • Update User endpoint (PATCH /api/v2/users/{id})

Cause

The Require username setting is enabled on the Database Connection associated with the user. When this setting is active, the Management API enforces strict validation that requires the username field to be present in the request body for update operations. This validation failure specifically impacts users who do not currently have a username stored in their profile.

 

This requirement is also mentioned right under that specific toggle:

Solution

To resolve this error, modify the application logic to ensure the username field is included in the body of the PATCH request.

  1. Identify the current or intended username for the user being updated.
  2. Add the username parameter to the JSON payload of the API request.

Example of a failing request body:

{
  "app_metadata": {
    "last_login": "2025-12-14T03:10:40.388Z"
  }
}

 

Example of a successful request body:

{
  "username": "<username>",
  "app_metadata": {
    "last_login": "2025-12-14T03:10:40.388Z"
  }
}

 

Related References

Recommended content

No recommended content found...