class StytchB2B::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 +Organization+ (+object+).
The [Organization object](https://stytch.com/docs/b2b/api/organization-object).
organization::
The type of this field is +Member+ (+object+).
The [Member object](https://stytch.com/docs/b2b/api/member-object)
member::
The type of this field is +String+.
Globally unique UUID that identifies a specific Member.
member_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 +String+.
using our built-in customizations or a custom HTML email for Magic Links - Invite.
Use a custom template for invite emails. By default, it will use your default email template. The template must be a template
invite_template_id::
The type of this field is nilable +object+.
for complete field behavior details.
frontend SDK, and should not be used to store critical information. See the [Metadata resource](https://stytch.com/docs/b2b/api/metadata)
An arbitrary JSON object of application-specific data. These fields can be edited directly by the
untrusted_metadata::
The type of this field is nilable +object+.
An arbitrary JSON object for storing application-specific data or identity-provider-specific data.
trusted_metadata::
The type of this field is nilable +String+.
The name of the Member.
name::
The type of this field is nilable +String+.
The `member_id` of the Member who sends the invite.
invited_by_member_id::
The type of this field is nilable +String+.
that you set in your Dashboard is used. If you have not set a default `invite_redirect_url`, an error is returned.
the request by querying Stytch's authenticate endpoint and finishes the invite flow. If this value is not passed, the default `invite_redirect_url`
The URL that the Member clicks from the invite Email Magic Link. This URL should be an endpoint in the backend server that verifies
invite_redirect_url::
The type of this field is +String+.
The email address of the Member.
email_address::
The type of this field is +String+.
Globally unique UUID that identifies a specific Organization. The `organization_id` is critical to perform operations on an Organization, so be sure to preserve this value.
organization_id::
== Parameters:

Send an invite email to a new Member to join an Organization. The Member will be created with an `invited` status until they successfully authenticate. Sending invites to `pending` Members will update their status to `invited`. Sending invites to already `active` Members will return an error.
def invite(
  organization_id:,
  email_address:,
  invite_redirect_url: nil,
  invited_by_member_id: nil,
  name: nil,
  trusted_metadata: nil,
  untrusted_metadata: nil,
  invite_template_id: nil,
  locale: nil
)
  request = {
    organization_id: organization_id,
    email_address: email_address
  }
  request[:invite_redirect_url] = invite_redirect_url unless invite_redirect_url.nil?
  request[:invited_by_member_id] = invited_by_member_id unless invited_by_member_id.nil?
  request[:name] = name unless name.nil?
  request[:trusted_metadata] = trusted_metadata unless trusted_metadata.nil?
  request[:untrusted_metadata] = untrusted_metadata unless untrusted_metadata.nil?
  request[:invite_template_id] = invite_template_id unless invite_template_id.nil?
  request[:locale] = locale unless locale.nil?
  post_request('/v1/b2b/magic_links/email/invite', request)
end