B2B Saas Authentication

/

API reference

/

Discovery

/

List Organizations

List Discovered Organizations

POSThttps://test.stytch.com/v1/b2b/discovery/organizations

List all possible organization relationships connected to a Member Session or Intermediate Session.

When a Member Session is passed in, relationships with a type of active_member, pending_member, or invited_member will be returned, and any membership can be assumed by calling the Exchange Session endpoint.

When an Intermediate Session is passed in, all relationship types - active_member, pending_member, invited_member, and eligible_to_join_by_email_domain - will be returned, and any membership can be assumed by calling the Exchange Intermediate Session endpoint.

This endpoint requires either an intermediate_session_token, session_jwt or session_token be included in the request. It will return an error if multiple are present.

This operation does not consume the Intermediate Session or Session Token passed in.


Body parameters


intermediate_session_tokenstring

session_tokenstring

session_jwtstring

Response fields


request_idstring

status_codeint

email_addressstring

discovered_organizationsarray

organization_id_hintstring
curl --request POST \
  --url https://test.stytch.com/v1/b2b/discovery/organizations \
  -u 'PROJECT_ID:SECRET' \
  -H 'Content-Type: application/json' \
  -d '{
    "intermediate_session_token": "SeiGwdj5lKkrEVgcEY3QNJXt6srxS3IK2Nwkar6mXD4="
  }'

RESPONSE

200
{
	"request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
	"status_code": 200,
	"email_address": "sandbox@stytch.com",
	"discovered_organizations": [{...}, {...}],
	"organization_id_hint": "organization-test-07971b06-ac8b-4cdb-9c15-63b17e653931"
}

Common Error Types