Authenticate a User given a Magic Link. This endpoint verifies that the Magic Link token is valid, hasn't expired or been previously used, and any optional security settings such as IP match or user agent match are satisfied.
Authenticate Magic Link
POSThttps://test.stytch.com/v1/magic_links/authenticate
Body parameters
token* string
options object
attributes object
session_duration_minutes int
session_custom_claims map<string, any>
session_jwt string
session_token string
code_verifier string
Response fields
status_code int
request_id string
method_id string
reset_sessions boolean
session object
session_jwt string
session_token string
user object
user_id string
curl --request POST \
--url https://test.stytch.com/v1/magic_links/authenticate \
-u 'PROJECT_ID:SECRET' \
-H 'Content-Type: application/json' \
-d '{
"token": "SeiGwdj5lKkrEVgcEY3QNJXt6srxS3IK2Nwkar6mXD4="
}'
RESPONSE
200
{
"method_id": "email-test-81bf03a8-86e1-4d95-bd44-bb3495224953",
"request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
"reset_sessions": false,
"session": null,
"session_jwt": "",
"session_token": "",
"status_code": 200,
"user": {...},
"user_id": "user-test-16d9ba61-97a1-4ba4-9720-b03761dc50c6"
}