Consumer Authentication

/

API reference

/

Magic links

/

Via email

/

Invite

Invite by email

POSThttps://test.stytch.com/v1/magic_links/email/invite

Create a User and send an invite Magic Link to the provided email. The User will be created with a pending status until they click the Magic Link in the invite email.

Next steps

The User is emailed a Magic Link which redirects them to the provided redirect URL. Collect the token from the URL query parameters and call Authenticate Magic Link to complete authentication.


Body parameters


email*string

invite_magic_link_urlstring

invite_expiration_minutesint

invite_template_idstring

nameobject

localestring

attributesobject

Response fields


status_codeint

request_idstring

user_idstring

email_idstring
curl --request POST \
  --url https://test.stytch.com/v1/magic_links/email/invite \
  -u 'PROJECT_ID:SECRET' \
  -H 'Content-Type: application/json' \
  -d '{
    "email": "sandbox@stytch.com"
  }'

RESPONSE

200
{
  "status_code": 200,
  "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
  "user_id": "user-test-16d9ba61-97a1-4ba4-9720-b03761dc50c6",
  "email_id": "email-test-81bf03a8-86e1-4d95-bd44-bb3495224953"
}

Common Error Types