Send Invite Email - Stytch Docs
Documentation Index
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
Send an invite email to a new Member to join an Organization.
The Member will be created with a status of invited 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. The magic link invite will be valid and can be authenticated for 1 week, after which the Member will need to be sent a new invite email.
RBAC Enforced API
If a Member Session is passed in the Authorization headers, Stytch will enforce that the Member has permission to take the create Action on the stytch.member Resource prior to honoring the request. To learn more, see the RBAC guide.
Revoke an invite
To revoke an existing invite, use the Delete Member endpoint. This will both delete the invited Member from the target Organization and revoke all existing invite emails.
Authorizations
Authorization
string
header
required
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Headers
X-Stytch-Member-Session
string
A Stytch session that can be used to run the request with the given member's permissions.
X-Stytch-Member-SessionJWT
string
A Stytch Session JSON Web Token (JWT) that can be used to run the request with the given member's permissions.
Body
application/json
organization_id
string
required
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. You may also use the organization_slug or organization_external_id here as a convenience.
email_address
string
required
The email address of the Member.
invite_redirect_url
string
The URL that the Member clicks from the invite Email Magic Link. This URL should be an endpoint in the backend server that verifies the request by querying Stytch's authenticate endpoint and finishes the invite flow. 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 invite_redirect_url, an error is returned.
invited_by_member_id
string
The member_id of the Member who sends the invite.
name
string
The name of the Member.
trusted_metadata
object
An arbitrary JSON object for storing application-specific data or identity-provider-specific data.
untrusted_metadata
object
An arbitrary JSON object of application-specific data. These fields can be edited directly by the frontend SDK, and should not be used to store critical information. See the Metadata resource for complete field behavior details.
invite_template_id
string
Use a custom template for invite emails. By default, it will use your default email template. Templates can be added in the Stytch dashboard using our built-in customization options or custom HTML templates with type “Magic Links - Invite.”
locale
enum
Used to determine which language to use when sending the user this delivery method. Parameter is an IETF BCP 47 language tag, e.g. "en".
roles
string[]
Roles to explicitly assign to this Member. See the RBAC guide for more information about role assignment.
Response
200
application/json
request_id
string
required
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.
member_id
string
required
Globally unique UUID that identifies a specific Member.
member
object
required
The Member object
organization
object
required
The Organization object.
status_code
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.