Skip to content

[Bug] users.update endpoint overwrites existing customFields instead of merging #37993

@T4nya13

Description

@T4nya13

Description

When updating a user's profile via the users.update API endpoint, providing a customFields object causes a complete overwrite of the user's existing custom fields. This results in unintended data loss for any fields not explicitly included in the payload.

The expected behavior is a merge (patch) operation, where only the specified keys are updated, and existing keys remain untouched.

Steps to reproduce

  1. Enable Custom Fields in Administration -> Accounts -> Registration.
  2. Create two custom fields (e.g., role and team).
  3. Set initial values for a user: { "role": "Developer", "team": "Red" }.
  4. Send a POST request to api/v1/users.update with the following payload (updating only one field):
    {
      "userId": "TARGET_USER_ID",
      "data": { "customFields": { "team": "Blue" } }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions