class Stytch::MagicLinks::Email

def invite(

The type of this field is +Integer+.
The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.
status_code::
The type of this field is +String+.
The unique ID of a specific email address.
email_id::
The type of this field is +String+.
The unique ID of the affected User.
user_id::
The type of this field is +String+.
Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue.
request_id::
An object with the following fields:
== Returns:

The type of this field is nilable +InviteRequestLocale+ (string enum).

Request support for additional languages [here](https://docs.google.com/forms/d/e/1FAIpQLScZSpAu_m2AmLXRT3F3kap-s_mcV6UTBitYn6CdyWP0-o7YjQ/viewform?usp=sf_link")!

Currently supported languages are English (`"en"`), Spanish (`"es"`), and Brazilian Portuguese (`"pt-br"`); if no value is provided, the copy defaults to English.

Used to determine which language to use when sending the user this delivery method. Parameter is a [IETF BCP 47 language tag](https://www.w3.org/International/articles/language-tags/), e.g. `"en"`.
locale::
The type of this field is nilable +Integer+.
Set the expiration for the 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).
invite_expiration_minutes::
The type of this field is nilable +String+.
The URL the end user clicks from the Email Magic Link. This should be a URL that your app receives and parses and subsequently sends an API request to authenticate the Magic Link and log in the User. If this value is not passed, the default invite 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.
invite_magic_link_url::
The type of this field is nilable +Name+ (+object+).
The name of the user. Each field in the name object is optional.
name::
The type of this field is nilable +Attributes+ (+object+).
Provided attributes help with fraud detection.
attributes::
The type of this field is nilable +String+.
Use a custom template for invite emails. By default, it will use your default email template. The template must be a template using our built-in customizations or a custom HTML email for Magic links - Invite.
invite_template_id::
The type of this field is +String+.
The email address of the User to send the invite Magic Link to.
email::
== Parameters:

The User is emailed a Magic Link which redirects them to the provided [redirect URL](https://stytch.com/docs/guides/magic-links/email-magic-links/redirect-routing). Collect the `token` from the URL query parameters and call [Authenticate Magic Link](https://stytch.com/docs/api/authenticate-magic-link) to complete authentication.
### Next steps

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.
def invite(
  email:,
  invite_template_id: nil,
  attributes: nil,
  name: nil,
  invite_magic_link_url: nil,
  invite_expiration_minutes: nil,
  locale: nil
)
  headers = {}
  request = {
    email: email
  }
  request[:invite_template_id] = invite_template_id unless invite_template_id.nil?
  request[:attributes] = attributes unless attributes.nil?
  request[:name] = name unless name.nil?
  request[:invite_magic_link_url] = invite_magic_link_url unless invite_magic_link_url.nil?
  request[:invite_expiration_minutes] = invite_expiration_minutes unless invite_expiration_minutes.nil?
  request[:locale] = locale unless locale.nil?
  post_request('/v1/magic_links/email/invite', request, headers)
end