Consumer Authentication

/

API reference

/

Users

/

Search users

Search Users

POSThttps://test.stytch.com/v1/users/search

Search for Users within your Stytch Project.

Use the query object to filter by different fields. See the query.operands.filter_value documentation below for a list of available filters.

Export all User data

Submit an empty query in your Search Users request to return all of your Stytch Project's Users.

This Github repository contains a utility that leverages the Search Users endpoint to export all of your User data to a CSV or JSON file.


Body parameters


limitint

cursorstring

queryobject

Response fields


request_idstring

status_codeint

resultsarray[objects]

results_metadataobject
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