Get Users with Filters
Search the traders in your community by profile, join date, balance, role or custom field, and get back only the fields you ask for, 200 at a time.
- Method
- POST
- Path
https://api.returning.ai / v1/ users/ filter - Permission
- getUserData
- Retries
- Read-only; exact retries are safe
When to use this
- Check whether a trader with a broker customer ID already exists before you call Create User.
- Sync or reconcile your trader list, for example everyone who joined this month.
- Build a segment, such as traders with a role or with more than a set number of coins.
Authentication#
- Header
Authorization: Bearer <API_KEY>- Permission
- getUserDataShown in the dashboard as “Get User Data”
Every search needs getUserData and only ever returns traders in the API key's community. Keep the key on your server.
Request#
Headers#
Body#
Send both fields and filter. filter: {} returns every trader in your community.
Supported filter keys, all of which must match:
email,first_name,last_name,username,country,phone: exact value, not case-sensitive.- Any custom field key, such as
customerid: exact value, or an operator object on number and date fields. You can also group custom fields undercustomFields, for exact values only. join_date,xp,coins: an operator object withgt,gte,lt,lteoreq, for example{"xp": {"gte": 1000}}.roles,tags,badges:{"inc": [...]}for traders who have every listed name,{"exc": [...]}for traders who have none of them. Names are not case-sensitive.language:{"eq": "en"}.
There is no page parameter. To walk the results, send each response's nextCursor back as cursor.
id, _id, email, username, first_name, last_name, country, phone, join_date. Activity: xp, coins, language, roles, tags, badges. You can also name any custom field key.RuleAt least one
Eg["id", "email", "username", "join_date", "customerid"]
{} to list everyone.RuleObject; {} allowed
Eg{"customerid": "<brokerCustomerId>"}
gt, gte, lt, lte or eq on number and date fields.Eg"<brokerCustomerId>"
Eg"trader@example.com"
last_name, username, country and phone work the same way.Eg"Sample"
gt, gte, lt, lte or eq; combine two for a range.Eg{"gte": "2026-09-01", "lte": "2026-09-30"}
YYYY-MM-DD) compares whole days.Eg"2026-09-01"
Eg"2026-09-30"
nextCursor from the previous page. Omit it for the first page.RuleSend exactly as received
curl --request POST \
--url https://api.returning.ai/v1/users/filter \
--header 'Authorization: Bearer <API_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"fields": [
"id",
"email",
"username",
"join_date",
"customerid"
],
"filter": {
"customerid": "<brokerCustomerId>"
}
}'
Response#
A 200 returns up to 200 traders in data.data. No match is still a 200, with an empty list and total: 0. Branch on the HTTP status, never on message.
Rulesuccess
Eg{ ... }
Eg[ ... ]
Eg"trader@example.com"
null if unknown.Eg"2026-09-26T08:30:00.000Z"
null, when the trader has no value.Eg{ ... }
Eg1
Eg1
Rule200 traders per page
Eg1
true when another page follows. Send nextCursor to get it.Egfalse
true on every page after the first.Egfalse
cursor to get the next page.{
"status": "success",
"data": {
"pagination": {
"total": 1,
"currentPage": 1,
"totalPages": 1,
"hasNextPage": false,
"hasPrevPage": false
},
"data": [
{
"id": "3247779",
"email": "trader@example.com",
"username": "sample_trader",
"join_date": "2026-09-26T08:30:00.000Z",
"customerid": "<brokerCustomerId>"
}
]
}
}
Errors#
Errors from the API key check, such as 401 and 403, carry the code in meta.code. A 400 has no code; its detail names each invalid field. A 500 has no code.
Fix the request03
fields or filter is missing, fields is empty, or a filter uses an unsupported operator. detail names the field. Send both keys; filter may be {}.AUTHENTICATION_REQUIREDFix the requestAuthorization: Bearer <API_KEY> with a current key.API_KEY_PERMISSION_DENIEDFix the requestgetUserData. Add the permission in Settings > Integration > API Keys.Fix the data01
COMMUNITY_NOT_FOUNDFix the dataRetry with backoff02
cursor that was not returned to you. Send nextCursor exactly as received, then retry with backoff.AUTHENTICATION_FAILEDRetry with backoff{
"meta": {
"status": "error",
"statusCode": 400
},
"message": "Get users by filter endpoint validation error.",
"detail": {
"fields": "Fields are required"
},
"solution": "Check your body in request and try again"
}