If an end user does not want to join any already-existing Organization, or has no possible Organizations to join, this endpoint can be used to create a new Organization and Member.
This operation consumes the Intermediate Session.
This endpoint will also create an initial Member Session for the newly created Member.
The Member created by this endpoint will automatically be granted the stytch_admin Role. See the RBAC guide for more details on this Role.
If the new Organization is created with a mfa_policy of REQUIRED_FOR_ALL, the newly created Member will need to complete an MFA step to log in to the Organization. The intermediate_session_token will not be consumed and instead will be returned in the response. The intermediate_session_token can be passed into the OTP SMS Authenticate endpoint to complete the MFA step and acquire a full member session. The intermediate_session_token can also be used with the Exchange Intermediate Session endpoint or the Create Organization via Discovery endpoint to join a different Organization or create a new one. The session_duration_minutes and session_custom_claims parameters will be ignored.