Stytch · Schema

api_magic_v1_magic_links_email_LoginOrCreateRequest

Request type

AuthenticationIdentityPasswordlessSecurityB2BConnected AppsMCPAI AgentsDeveloper Tools

Properties

Name Type Description
email string The email address of the end user.
login_magic_link_url string The URL the end user clicks from the login Email Magic Link. This should be a URL that your app receives and parses and subsequently send an API request to authenticate the Magic Link and log in the U
signup_magic_link_url string The URL the end user clicks from the sign-up Email Magic Link. This should be a URL that your app receives and parses and subsequently send an API request to authenticate the Magic Link and sign-up th
login_expiration_minutes integer Set the expiration for the login email magic link, in minutes. By default, it expires in 1 hour. The minimum expiration is 5 minutes and the maximum is 7 days (10080 mins).
signup_expiration_minutes integer Set the expiration for the sign-up email magic link, in minutes. By default, it expires in 1 week. The minimum expiration is 5 minutes and the maximum is 7 days (10080 mins).
login_template_id string Use a custom template for login emails. By default, it will use your default email template. Templates can be added in the [Stytch dashboard](https://stytch.com/dashboard/templates) using our built-in
signup_template_id string Use a custom template for sign-up emails. By default, it will use your default email template. Templates can be added in the [Stytch dashboard](https://stytch.com/dashboard/templates) using our built-
attributes object Provided attributes to help with fraud detection. These values are pulled and passed into Stytch endpoints by your application.
create_user_as_pending boolean Flag for whether or not to save a user as pending vs active in Stytch. Defaults to false. If true, users will be saved with status pending in Stytch's backend until authenticated. If false, users will
code_challenge string A base64url encoded SHA256 hash of a one time secret used to validate that the request starts and ends on the same device.
locale object Used to determine which language to use when sending the user this delivery method. Parameter is an [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), e.g. `"en"`. C
View JSON Schema on GitHub

JSON Schema

stytch-api-magic-v1-magic-links-email-loginorcreaterequest-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/api_magic_v1_magic_links_email_LoginOrCreateRequest",
  "title": "api_magic_v1_magic_links_email_LoginOrCreateRequest",
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "description": "The email address of the end user."
    },
    "login_magic_link_url": {
      "type": "string",
      "description": "The URL the end user clicks from the login Email Magic Link. This should be a URL that your app receives and parses and subsequently send an API request to authenticate the Magic Link and log in the User. If this value is not passed, the default login redirect URL that you set in your Dashboard is used. If you have not set a default login redirect URL, an error is returned."
    },
    "signup_magic_link_url": {
      "type": "string",
      "description": "The URL the end user clicks from the sign-up Email Magic Link. This should be a URL that your app receives and parses and subsequently send an API request to authenticate the Magic Link and sign-up the User. If this value is not passed, the default sign-up redirect URL that you set in your Dashboard is used. If you have not set a default sign-up redirect URL, an error is returned."
    },
    "login_expiration_minutes": {
      "type": "integer",
      "format": "int32",
      "description": "Set the expiration for the login email magic link, in minutes. By default, it expires in 1 hour. The minimum expiration is 5 minutes and the maximum is 7 days (10080 mins)."
    },
    "signup_expiration_minutes": {
      "type": "integer",
      "format": "int32",
      "description": "Set the expiration for the sign-up email magic link, in minutes. By default, it expires in 1 week. The minimum expiration is 5 minutes and the maximum is 7 days (10080 mins)."
    },
    "login_template_id": {
      "type": "string",
      "description": "Use a custom template for login emails. By default, it will use your default email template. Templates can be added in the [Stytch dashboard](https://stytch.com/dashboard/templates) using our built-in customization options or custom HTML templates with type \u201cMagic links - Login\u201d."
    },
    "signup_template_id": {
      "type": "string",
      "description": "Use a custom template for sign-up emails. By default, it will use your default email template. Templates can be added in the [Stytch dashboard](https://stytch.com/dashboard/templates) using our built-in customization options or custom HTML templates with type \u201cMagic links - Sign-up\u201d."
    },
    "attributes": {
      "$ref": "#/components/schemas/api_attribute_v1_Attributes",
      "description": "Provided attributes to help with fraud detection. These values are pulled and passed into Stytch endpoints by your application."
    },
    "create_user_as_pending": {
      "type": "boolean",
      "description": "Flag for whether or not to save a user as pending vs active in Stytch. Defaults to false.\n        If true, users will be saved with status pending in Stytch's backend until authenticated.\n        If false, users will be created as active. An example usage of\n        a true flag would be to require users to verify their phone by entering the OTP code before creating\n        an account for them."
    },
    "code_challenge": {
      "type": "string",
      "description": "A base64url encoded SHA256 hash of a one time secret used to validate that the request starts and ends on the same device."
    },
    "locale": {
      "$ref": "#/components/schemas/api_magic_v1_LoginOrCreateRequestLocale",
      "description": "Used to determine which language to use when sending the user this delivery method. Parameter is an [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), e.g. `\"en\"`.\n\nCurrently supported languages are English (`\"en\"`), Spanish (`\"es\"`), French (`\"fr\"`) and Brazilian Portuguese (`\"pt-br\"`); if no value is provided, the copy defaults to English.\n\nRequest support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link\")!\n"
    }
  },
  "description": "Request type",
  "required": [
    "email"
  ]
}