Payload Validation Error when Filtering User Export with Query Parameter
Last Updated:
Overview
This article explains why the following error occurs when attempting to export a list of users filtered by a specific value using the query parameter in the /api/v2/jobs/users-exports endpoint.
Payload validation error
Applies To
- Management API
- User Export
/api/v2/jobs/users-exports
Cause
The /api/v2/jobs/users-exports endpoint does not support server-side filtering via the query parameter. This parameter is invalid for this specific operation, resulting in a payload validation error.
Solution
Server-side filtering is not available for user exports. Follow these steps to achieve the desired result by filtering locally:
-
Remove the query parameter from the API request.
-
Include the target custom field (for example, app_metadata.test) in the fields array within the request body.
-
Execute the request to export all users.
-
Filter the resulting export file locally to isolate the users with the specific value.