/
Contact usSee pricingStart building
    Overview
    iOS SDK reference
    Android SDK reference

    React Native SDK reference

    Installation
    Changelog
    Organizations
      Get Organization
      Get Organization by Slug
      Update Organization
      Delete Organization
    Members
      Get Member
      Create Member
      Update Member
      Search Members
      Delete Member
      Reactivate Member
      Delete Member Password
      Delete Member MFA Phone Number
      Delete Member MFA TOTP
      Unlink Retired Member Email
      Start Member Email Update
      Update Self
      Delete Self Password
      Delete Self MFA Phone Number
      Delete Self MFA TOTP
      Unlink Retired Self Email
      Start Self Email Update
      Update Member (Deprecated)
      Delete Member MFA Phone Number (Deprecated)
    RBAC
      Is Authorized
      Permissions
    Email Magic Links
      Login or Signup
      Invite
      Authenticate
      Send Discovery Email
      Authenticate Discovery Magic Link
    Session Management
      Get Session
      Authenticate Session
      Revoke Session
      Exchange Session
      Get Tokens
      Revoke Sessions for Member
    SSO
      Start SSO Flow
      Authenticate
      Get SSO Connections
      Delete SSO Connection
      Create SAML Connection
      Update SAML Connection
      Update SAML Connection by Metadata URL
      Delete Verification Certificate
      Create OIDC Connection
      Update OIDC Connection
      Create External Connection
      Update External Connection
    Discovery
      List Discovered Organizations
      Create Organization via Discovery
      Exchange Intermediate Session
    Passwords
      Authenticate
      Reset by Email Start
      Reset by Email
      Reset by Existing Password
      Reset by Session
      Strength Check
    SCIM
      Create SCIM Connection
      Update SCIM Connection
      Delete SCIM Connection
      Get SCIM Connection
      Rotate SCIM Token Start
      Rotate SCIM Token Complete
      Rotate SCIM Token Cancel
    Multi-factor Authentication
    • One-Time Passcodes

      • SMS Send
        SMS Authenticate
    • Time-Based One-Time Passcodes

      • TOTP Create
        TOTP Authenticate
    • Recovery Codes

      • Recovery Codes Recover
        Rotate Recovery Codes
        Get Recovery Codes
    Pre-built UI
      UI Configuration
    Device Fingerprinting
      Get telemetry ID
    More Resources
      SWR & caching
      Deep linking
      Android KeyStore considerations
Get support on SlackVisit our developer forum

Contact us

B2B SaaS Authentication

/

Mobile SDKs

/

React Native SDK reference

/

Members

/

Search Members

Search Members

The Search Members method wraps the Search Members API endpoint. It can be used to search for Members within the logged-in Member's Organization.

Submitting an empty query returns all non-deleted Members within the logged-in Member's Organization.

*All fuzzy search filters require a minimum of three characters.

Authenticated Method

This method requires valid Session for a Member with permission to perform the search Action on the stytch.member Resource.

Before using this method, enable Member actions & organization modifications in the Frontend SDK page. To learn more, see our RBAC guide.


Method parameters


cursor string

The cursor field allows you to paginate through your results. Each result array is limited to 1000 results. If your query returns more than 1000 results, you will need to paginate the responses using the cursor. If you receive a response that includes a non-null next_cursor in the results_metadata object, repeat the search call with the next_cursor value set to the cursor field to retrieve the next page of results. Continue to make search calls until the next_cursor in the response is null.


limit int

The number of search results to return per page. The default limit is 100. A maximum of 1000 results can be returned by a single search request. If the total size of your result set is greater than one page size, you must paginate the response. See the cursor field.


query object

The optional query object contains the operator, i.e. AND or OR, and the operands that will filter your results. Only an operator is required. If you include no operands, no filtering will be applied. If you include no query object, it will return all Members with no filtering applied.

operator string

The action to perform on the operands. The accepted values are:

AND – all the operand values provided must match.

OR – [DEPRECATED] the operator will return any matches to at least one of the operand values you supply. This parameter is retained for legacy use cases only and is no longer supported. We strongly recommend breaking down complex queries into multiple search queries instead.

operands array[objects]

An array of operand objects that contains all of the filters and values to apply to your search query.

filter_name string

The type of search filter to apply. The accepted values are: member_ids, member_emails, member_email_fuzzy, member_mfa_phone_numbers, member_mfa_phone_number_fuzzy, member_password_exists, statuses, member_roles

filter_value string or array

The values to search for based on which filter_name is applied.

member_ids array[strings]

An array of member_ids to search for by exact match, when filter_name = "member_ids".

member_emails array[strings]

An array of Member email_addresss to search for by exact match, when filter_name = "member_emails".

member_email_fuzzy string

The Member's email_address to search for by fuzzy match, when filter_name = "member_email_fuzzy".

member_mfa_phone_numbers array[strings]

An array of member_mfa_phone_numbers to search for by exact match, when filter_name = "member_mfa_phone_numbers".

member_mfa_phone_number_fuzzy string

The Member's mfa_phone_number to search for by fuzzy match, when filter_name = "member_mfa_phone_number_fuzzy".

member_password_exists boolean

The Member's member_password_exists filter allows you to filter your members based on whether they have a password or not

statuses array[strings]

An array of Member's statuses to search for by exact match, when filter_name = "statuses". The accepted values are: active, invited, pending, and deleted. Note that the deleted filter only works on its own (to get all deleted Members in an Organization) or in conjunction with the member_ids filter (to search for deleted Members by member_id). For example, searching by deleted status and a member email will not return results for deleted members with the given email address.

member_roles array[strings]

An array of Member's Roles to search for by exact match, when filter_name = member_roles. This will search across both explicit and implicit assigned Roles.


Response fields


request_id string

Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue.


status_code int

The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.


results_metadata object

The search results_metadata object contains metadata relevant to your specific query like total and next_cursor.

next_cursor string

The next_cursor string is returned when your search result contains more than one page of results. This value is passed into your next search call in the cursor field.

total int

The total number of results returned by your search query. If totals have been disabled for your Stytch Workspace to improve search performance, the value will always be -1.


members array[objects]

An array of Member objects.


organizations array[objects]

An array of Organization objects.

import { Text, TouchableOpacity, View } from 'react-native';
import { useStytchB2BClient } from '@stytch/react-native/b2b';

export const SearchMembers = () => {
  const stytch = useStytchB2BClient();

  const searchMembers = () => {
    stytch.organization.members.search({
      query: { operands: [{ filter_name: 'member_password_exists', filter_value: true }], operator: 'AND' },
    });
  };

  return (
    <View>
      <TouchableOpacity onPress={searchMembers}>
        <Text>Search Members</Text>
      </TouchableOpacity>
    </View>
  );
};
RESPONSE 200
200
​
{
  "status_code": 200,
  "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
  "results_metadata": {
		"next_cursor": null,
		"total": 5
	},
  "members": [
    ...
  ],
  "organizations": {
    ...
  }
}
RESPONSE 401
200
​
{
  "status_code": 401,
  "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
  "error_type": "unauthorized_credentials",
  "error_message": "Unauthorized credentials.",
  "error_url": "https://stytch.com/docs/api/errors/401"
}
RESPONSE 403
200
​
{
  "status_code": 403,
  "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
  "error_type": "session_authorization_error",
  "error_message": "The Member is not authorized to perform the requested action on that resource.",
  "error_url": "https://stytch.com/docs/api/errors/403"
}
RESPONSE 429
200
​
{
  "status_code": 429,
  "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
  "error_type": "too_many_requests",
  "error_message": "Too many requests have been made.",
  "error_url": "https://stytch.com/docs/api/errors/429"
}
RESPONSE 500
200
​
{
  "status_code": 500,
  "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
  "error_type": "internal_server_error",
  "error_message": "Oops, something seems to have gone wrong, please reach out to support@stytch.com to let us know what went wrong.",
  "error_url": "https://stytch.com/docs/api/errors/500"
}