ナレッジベース
公開されました Mar. 26, 2026

Getting Bad Request When Using API Filter Parameter on User Object Field

written-by

Gábor Bányai

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Issue

When extending a system object, such as the User object, with a custom object field (e.g., customID), attempting to filter user accounts by this custom field using the headless API results in an error. The API call looks like this:

/o/headless-admin-user/v1.0/user-accounts?filter=customID eq 'xxxxx'
This returns a BAD_REQUEST response, even if the custom field is indexed as a keyword and a full re-index has been performed:

{ "status": "BAD_REQUEST", "title": "A property used in the filter criteria is not supported: customID eq 'xxxxx'", "type": "InvalidFilterException" }

Environment

  • Liferay DXP (all versions)

Resolution

This behavior is expected due to a current product limitation. The Headless API does not support filtering on custom fields that have been added to system User objects.

As a workaround, use Custom Fields (Expandos) instead of object fields. The headless API supports filtering on Expandos via the customFields path.

To filter by a User Custom Field, structure the API call as follows:

GET /o/headless-admin-user/v1.0/user-accounts?filter=customFields/yourCustomFieldName eq 'yourValue'

 

For example, if you create a User Custom Field with the name customID, the request would be:

GET /o/headless-admin-user/v1.0/user-accounts?filter=customFields/customID eq 'xxxxx'
This will return a 200 OK response with the correctly filtered user accounts.
did-this-article-resolve-your-issue

ナレッジベース