class StytchB2B::Discovery::Organizations
def list(
If the intermediate session token is associated with a specific Organization, that Organization ID will be returned here. The Organization ID will be null if the intermediate session token was generated by a email magic link discovery or OAuth discovery flow. If a session token or session JWT is provided, the Organization ID hint will be null.
organization_id_hint::
The type of this field is +Integer+.
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.
status_code::
The type of this field is list of +DiscoveredOrganization+ (+object+).
c) The Organization has at least one other Member with a verified email address with the same domain as the end user (to prevent phishing attacks).
b) The Organizations' allowed domains list contains the Member's email domain.
a) The Organization allows JIT provisioning.
3. The end user can join the Organization because:
2. The end user is invited to the Organization.
1. The end user is already a Member of the Organization.
Note that Organizations will only appear here under any of the following conditions:
An array of `discovered_organization` objects tied to the `intermediate_session_token`, `session_token`, or `session_jwt`. See the [Discovered Organization Object](https://stytch.com/docs/b2b/api/discovered-organization-object) for complete details.
discovered_organizations::
The type of this field is +String+.
The email address.
email_address::
The type of this field is +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.
request_id::
An object with the following fields:
== Returns:
The type of this field is nilable +String+.
The JSON Web Token (JWT) for a given Stytch Session.
session_jwt::
The type of this field is nilable +String+.
A secret token for a given Stytch Session.
session_token::
The type of this field is nilable +String+.
The Intermediate Session Token. This token does not necessarily belong to a specific instance of a Member, but represents a bag of factors that may be converted to a member session. The token can be used with the [OTP SMS Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-otp-sms), [TOTP Authenticate endpoint](https://stytch.com/docs/b2b/api/authenticate-totp), or [Recovery Codes Recover endpoint](https://stytch.com/docs/b2b/api/recovery-codes-recover) to complete an MFA flow and log in to the Organization. It can also be used with the [Exchange Intermediate Session endpoint](https://stytch.com/docs/b2b/api/exchange-intermediate-session) to join a specific Organization that allows the factors represented by the intermediate session token; or the [Create Organization via Discovery endpoint](https://stytch.com/docs/b2b/api/create-organization-via-discovery) to create a new Organization and Member.
intermediate_session_token::
== Parameters:
This operation does not consume the Intermediate Session or Session Token passed in.
It will return an error if multiple are present.
This endpoint requires either an `intermediate_session_token`, `session_jwt` or `session_token` be included in the request.
and any membership can be assumed by calling the [Exchange Intermediate Session](https://stytch.com/docs/b2b/api/exchange-intermediate-session) endpoint.
`eligible_to_join_by_email_domain`, and `eligible_to_join_by_oauth_tenant` - will be returned,
When an Intermediate Session is passed in, all relationship types - `active_member`, `pending_member`, `invited_member`,
will be returned, and any membership can be assumed by calling the [Exchange Session](https://stytch.com/docs/b2b/api/exchange-session) endpoint.
When a Member Session is passed in, relationships with a type of `active_member`, `pending_member`, or `invited_member`
List all possible organization relationships connected to a [Member Session](https://stytch.com/docs/b2b/api/session-object) or Intermediate Session.
def list( intermediate_session_token: nil, session_token: nil, session_jwt: nil ) headers = {} request = {} request[:intermediate_session_token] = intermediate_session_token unless intermediate_session_token.nil? request[:session_token] = session_token unless session_token.nil? request[:session_jwt] = session_jwt unless session_jwt.nil? post_request('/v1/b2b/discovery/organizations', request, headers) end