Search for Users within your Stytch Project. Submit an empty query in the request to return all Users.
Search Users
POSThttps://test.stytch.com/v1/users/search
Body parameters
limit int
cursor string
query object
Response fields
request_id string
status_code int
results array[objects]
results_metadata object
Search
Node
curl --request POST \
--url https://test.stytch.com/v1/users/search \
-u 'PROJECT_ID:SECRET' \
-H 'Content-Type: application/json' \
-d '{
"limit": 200,
"cursor": "",
"query": {
"operator": "AND",
"operands": [
{
"filter_name": "phone_number",
"filter_value": ["+12025550162"]
},
]
}
}'
RESPONSE
200
{
"request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
"results": [
{
"created_at": "2021-12-17T04:02:28Z",
"crypto_wallets": [],
"emails": [
{
"email": "ghopper@stytch.com",
"email_id": "email-test-81bf03a8-86e1-4d95-bd44-bb3495224953",
"verified": false
}
],
"name": {
"first_name": "Grace",
"last_name": "Hopper",
"middle_name": ""
},
"phone_numbers": [
{
"phone_id": "phone-number-test-d5a3b680-e8a3-40c0-b815-ab79986666d0",
"phone_number": "+12025550162",
"verified": true
}
],
"providers": [],
"status": "active",
"user_id": "user-test-16d9ba61-97a1-4ba4-9720-b03761dc50c6",
"webauthn_registrations": []
},
{ ...more users... }
],
"results_metadata": {
"next_cursor": "eyJ2IjoxLCJsIjo0NjkzfQ==",
"total": 433
},
"status_code": 200
}
Common Error Types
- invalid_email
- invalid_phone_number
- user_search_expected_array_of_string
- user_search_expected_bool
- user_search_expected_string
- user_search_expected_timestamp
- user_search_filter_name_not_recognized
- user_search_invalid_cursor
- user_search_invalid_limit
- user_search_invalid_oauth_provider_filter
- user_search_invalid_operator
- user_search_invalid_status_filter
- user_search_maximum_filter_value_count_exceeded
- user_search_missing_filter_name
- user_search_missing_filter_value
- user_search_missing_greater_than
- user_search_missing_less_than