> ## 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.

# Organizations overview

> Manage multi-tenant organizations using the Stytch API.

An Organization represents a tenant in your application - typically each of your business customers. Organizations contain members, authentication settings, and RBAC policies that are isolated from other organizations.

## Organization management

<Steps>
  <Step title="Create an organization">
    Create a new organization using the [Create Organization](/docs/api-reference/b2b/api/organizations/create-organization) endpoint:

    ```bash theme={null}
    curl --request POST \
      --url https://test.stytch.com/v1/b2b/organizations \
      --header 'Content-Type: application/json' \
      --user 'PROJECT_ID:SECRET' \
      --data '{
        "organization_name": "Acme Corporation",
        "organization_slug": "acme-corp",
        "email_allowed_domains": ["acme.com"]
      }'
    ```

    **Response:**

    ```json theme={null}
    {
      "status_code": 201,
      "organization": {
        "organization_id": "organization-test-07971b06-ac8b-4cdb-9c15-63b17e653931",
        "organization_name": "Acme Corporation",
        "organization_slug": "acme-corp",
        "email_allowed_domains": ["acme.com"],
        "email_jit_provisioning": "NOT_ALLOWED",
        "email_invites": "ALL_ALLOWED",
        "auth_methods": "ALL_ALLOWED",
        "allowed_auth_methods": [],
        "mfa_policy": "OPTIONAL"
      }
    }
    ```
  </Step>

  <Step title="Update organization settings">
    Configure authentication methods, MFA policies, and other settings using the [Update Organization](/docs/api-reference/b2b/api/organizations/update-organization) endpoint:

    ```bash theme={null}
    curl --request PUT \
      --url https://test.stytch.com/v1/b2b/organizations/organization-test-07971b06-ac8b-4cdb-9c15-63b17e653931 \
      --header 'Content-Type: application/json' \
      --user 'PROJECT_ID:SECRET' \
      --data '{
        "mfa_policy": "REQUIRED_FOR_ALL",
        "allowed_auth_methods": ["sso", "magic_link"],
        "email_jit_provisioning": "RESTRICTED",
        "email_allowed_domains": ["acme.com", "acmecorp.com"]
      }'
    ```

    **Key settings:**

    * `mfa_policy` - Controls MFA requirements (`OPTIONAL`, `REQUIRED_FOR_ALL`)
    * `auth_methods` / `allowed_auth_methods` - Restrict which authentication methods members can use
    * `email_jit_provisioning` / `email_allowed_domains` - Configure automatic member provisioning by email domain
    * `sso_jit_provisioning` - Enable JIT provisioning for SSO connections
  </Step>

  <Step title="Search organizations">
    Find organizations by name, domain, or other criteria using the [Search Organizations](/docs/api-reference/b2b/api/organizations/search-organizations) endpoint:

    ```bash theme={null}
    curl --request POST \
      --url https://test.stytch.com/v1/b2b/organizations/search \
      --header 'Content-Type: application/json' \
      --user 'PROJECT_ID:SECRET' \
      --data '{
        "query": {
          "operator": "AND",
          "operands": [
            {
              "filter_name": "organization_name",
              "filter_value": ["Acme"]
            }
          ]
        }
      }'
    ```
  </Step>
</Steps>

## Trusted metadata

Organizations support `trusted_metadata` for storing application-specific data:

```bash theme={null}
curl --request PUT \
  --url https://test.stytch.com/v1/b2b/organizations/organization-test-07971b06-ac8b-4cdb-9c15-63b17e653931 \
  --header 'Content-Type: application/json' \
  --user 'PROJECT_ID:SECRET' \
  --data '{
    "trusted_metadata": {
      "subscription_tier": "enterprise",
      "billing_id": "cus_123456",
      "feature_flags": {
        "advanced_analytics": true
      }
    }
  }'
```

**Metadata constraints:**

* Maximum 20 top-level keys
* Cannot exceed 4KB in size
* Backend integrations can read and write
* Frontend integrations can only read

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

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

## Learn more

<CardGroup cols={2}>
  <Card title="Organization object" icon="braces" href="/docs/api-reference/b2b/api/organizations/organization-object">
    Complete organization object reference
  </Card>

  <Card title="Configure auth methods" icon="settings" href="/docs/multi-tenant-auth/enterprise-ready/org-management/configure-auth-methods">
    Set up organization authentication policies
  </Card>

  <Card title="JIT provisioning" icon="user-plus" href="/docs/multi-tenant-auth/enterprise-ready/org-management/jit-provision-members">
    Automatic member provisioning guide
  </Card>

  <Card title="Organization management" icon="building" href="/docs/multi-tenant-auth/enterprise-ready/org-management/overview">
    Comprehensive organization management guide
  </Card>
</CardGroup>
