B2B Saas Authentication

/

API reference

/

Impersonation

/

Authenticate Token

Authenticate Impersonation Token

POSThttps://test.stytch.com/v1/b2b/impersonation/authenticate

Authenticate an impersonation token to impersonate a Member. This endpoint requires an impersonation token that is not expired or previously used. A Stytch session will be created for the impersonated member with a 60 minute duration. Impersonated sessions cannot be extended.


Body parameters


impersonation_token*string

Response fields


request_idstring

status_codeint

member_idstring

member_sessionobject

member_session_idstring

session_tokenstring

session_jwtstring

intermediate_session_tokenstring

member_authenticatedboolean

mfa_requiredobject

organization_idstring

memberobject

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

RESPONSE

200
{
  "status_code": 200,
  "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
  "member_id": "member-test-32fc5024-9c09-4da3-bd2e-c9ce4da9375f",
  "organization_id": "organization-test-07971b06-ac8b-4cdb-9c15-63b17e653931",
  "session_jwt": "example_jwt",
  "session_token": "mZAYn5aLEqKUlZ_Ad9U_fWr38GaAQ1oFAhT8ds245v7Q",
  "intermediate_session_token": "",
  "member_authenticated": true,
  "mfa_required": null,
  "primary_required": null,
  "member_session": {...},
  "member": {...},
  "organization": {...}
}