> ## Documentation Index
> Fetch the complete documentation index at: https://stytch.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Members overview

> Manage organization members using the Stytch API

A Member represents an individual user within an organization. Members are uniquely identified by their email address within each organization and can have different roles, authentication factors, and metadata.

## Member management

<Steps>
  <Step title="Create a member">
    Create a new member using the [Create Member](/api-reference/b2b/api/members/create-member) endpoint:

    ```bash theme={null}
    curl --request POST \
      --url https://test.stytch.com/v1/b2b/organizations/organization-test-07971b06-ac8b-4cdb-9c15-63b17e653931/members \
      --header 'Content-Type: application/json' \
      --user 'PROJECT_ID:SECRET' \
      --data '{
        "email_address": "user@acme.com",
        "name": "Jane Doe",
        "create_member_as_pending": false
      }'
    ```

    **Response:**

    ```json theme={null}
    {
      "status_code": 201,
      "member": {
        "member_id": "member-test-32fc5024-9c09-4da3-bd2e-c9ce4da9375f",
        "organization_id": "organization-test-07971b06-ac8b-4cdb-9c15-63b17e653931",
        "email_address": "user@acme.com",
        "name": "Jane Doe",
        "status": "active",
        "trusted_metadata": {},
        "untrusted_metadata": {}
      }
    }
    ```
  </Step>

  <Step title="Update member details">
    Update member information using the [Update Member](/api-reference/b2b/api/members/update-member) endpoint:

    ```bash theme={null}
    curl --request PUT \
      --url https://test.stytch.com/v1/b2b/organizations/organization-test-07971b06-ac8b-4cdb-9c15-63b17e653931/members/member-test-32fc5024-9c09-4da3-bd2e-c9ce4da9375f \
      --header 'Content-Type: application/json' \
      --user 'PROJECT_ID:SECRET' \
      --data '{
        "name": "Jane Smith",
        "trusted_metadata": {
          "role": "admin",
          "department": "Engineering"
        }
      }'
    ```
  </Step>

  <Step title="Search members">
    Find members by email, name, or status using the [Search Members](/api-reference/b2b/api/members/search-members) endpoint:

    ```bash theme={null}
    curl --request POST \
      --url https://test.stytch.com/v1/b2b/organizations/members/search \
      --header 'Content-Type: application/json' \
      --user 'PROJECT_ID:SECRET' \
      --data '{
        "organization_ids": ["organization-test-07971b06-ac8b-4cdb-9c15-63b17e653931"],
        "query": {
          "operator": "AND",
          "operands": [
            {
              "filter_name": "status",
              "filter_value": ["active"]
            }
          ]
        }
      }'
    ```
  </Step>
</Steps>

## Member status

A member's `status` determines how they interact with your application:

<Tabs>
  <Tab title="Active" icon="user-round-check">
    Members become `active` after successfully authenticating at least once. Active members can log in and access the application.

    When using email authentication, active members receive login emails that route to `login_redirect_url`.
  </Tab>

  <Tab title="Pending" icon="clock">
    Members are `pending` when created via:

    * [Create Member](/api-reference/b2b/api/members/create-member) with `create_member_as_pending: true`
    * Email authentication endpoints that create new members

    Pending members become `active` after their first successful authentication. If sent an invite email, their status changes to `invited`.
  </Tab>

  <Tab title="Invited" icon="mail">
    Members are `invited` when created by sending an invite email. They receive the invite email template.

    Invited members become `active` after successfully authenticating through the invite link or signup flow.
  </Tab>

  <Tab title="Deleted" icon="trash">
    Members are marked `deleted` when:

    * [Delete Member](/api-reference/b2b/api/members/delete-member) is called
    * Their organization is deleted

    All emails and authentication factors are removed when a member is deleted.
  </Tab>
</Tabs>

## Member metadata

Members support two types of metadata for storing application-specific data:

<Tabs>
  <Tab title="Trusted Metadata" icon="shield-check">
    Secure metadata that can only be modified by backend integrations:

    ```bash theme={null}
    curl --request PUT \
      --url https://test.stytch.com/v1/b2b/organizations/organization-test-.../members/member-test-... \
      --header 'Content-Type: application/json' \
      --user 'PROJECT_ID:SECRET' \
      --data '{
        "trusted_metadata": {
          "role": "admin",
          "billing_status": "paid",
          "stripe_customer_id": "cus_123456"
        }
      }'
    ```

    **Access:**

    * Backend: Read and write
    * Frontend: Read only

    Store sensitive fields like roles, permissions, or billing information in trusted metadata.
  </Tab>

  <Tab title="Untrusted Metadata" icon="pencil">
    User-modifiable metadata that can be updated from frontend applications:

    ```bash theme={null}
    curl --request PUT \
      --url https://test.stytch.com/v1/b2b/organizations/organization-test-.../members/member-test-... \
      --header 'Content-Type: application/json' \
      --user 'PROJECT_ID:SECRET' \
      --data '{
        "untrusted_metadata": {
          "display_theme": "dark",
          "preferred_locale": "en-US",
          "notification_settings": {
            "email": true,
            "sms": false
          }
        }
      }'
    ```

    **Access:**

    * Backend: Read and write
    * Frontend: Read and write

    Store user preferences and non-sensitive settings in untrusted metadata.
  </Tab>
</Tabs>

**Metadata constraints:**

* Maximum 20 top-level keys per metadata object
* Cannot exceed 4KB in size per metadata object

<Warning>
  Do not store sensitive information (passport numbers, credit card details, etc.) in metadata.
</Warning>

See [Metadata Update Behavior](/api-reference/b2b/api/resources/object-update-behavior) for how updates are merged.

## Learn more

<CardGroup cols={2}>
  <Card title="Member object" icon="braces" href="/api-reference/b2b/api/members/member-object">
    Complete member object reference
  </Card>

  <Card title="RBAC" icon="shield" href="/api-reference/b2b/api/rbac/overview">
    Assign roles and permissions to members
  </Card>
</CardGroup>
