B2B Saas Authentication

/

API reference

/

Email one-time passcodes (OTP)

/

Discovery

/

Authenticate discovery OTP

Authenticate Discovery One-Time Passcode (OTP)

POSThttps://test.stytch.com/v1/b2b/otps/email/discovery/authenticate

Authenticates the OTP and returns an intermediate session token. Intermediate session tokens can be used for various Discovery login flows and are valid for 10 minutes.


Body parameters


email_address*string

code*string

Response fields


request_idstring

status_codeint

intermediate_session_tokenstring

email_addressstring

discovered_organizationsarray
curl --request POST \
  --url https://test.stytch.com/v1/b2b/otps/email/discovery/authenticate \
  -u 'PROJECT_ID:SECRET' \
  -H 'Content-Type: application/json' \
  -d '{
    "email_address": "sandbox@stytch.com",
    "code": "123456"
  }'

RESPONSE

200
{
	"request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
	"status_code": 200,
	"intermediate_session_token": "SeiGwdj5lKkrEVgcEY3QNJXt6srxS3IK2Nwkar6mXD4=",
	"email_address": "sandbox@stytch.com",
	"discovered_organizations": [{...}, {...}]
}

Common Error Types