B2B Saas Authentication

/

API reference

/

Email magic links

/

Discovery

/

Authenticate discovery Magic Link

Authenticate Discovery Magic Link

POSThttps://test.stytch.com/v1/b2b/magic_links/discovery/authenticate

Authenticates the Discovery Magic Link token and exchanges it for an Intermediate Session Token. Intermediate Session Tokens can be used for various Discovery login flows and are valid for 10 minutes.


Body parameters


discovery_magic_links_token*string

pkce_code_verifierstring

Response fields


request_idstring

status_codeint

intermediate_session_tokenstring

email_addressstring

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

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