---
title: "Invite"
method: POST
path: "/v1/magic_links/email/invite"
tags: ["Magic Links"]
---

# Invite

`POST /v1/magic_links/email/invite`

## Request

- Base URL: `https://api.stytch.com`
- URL: `https://api.stytch.com/v1/magic_links/email/invite`
- Auth: HTTP basic

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](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.

## Request body

- ApiMagicV1MagicLinksEmailInviteRequest: Request type
  - `email` string, required: The email address of the User to send the invite Magic Link to.
  - `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](https://stytch.com/dashboard/templates) using our built-in customization options or custom HTML templates with type “Magic links - Invite”.
  - `attributes` ApiAttributeV1Attributes
    - `ip_address` string: The IP address of the user.
    - `user_agent` string: The user agent of the User.
  - `name` ApiUserV1Name
    - `first_name` string: The first name of the user.
    - `middle_name` string: The middle name(s) of the user.
    - `last_name` string: The last name of the user.
  - `invite_magic_link_url` 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_expiration_minutes` 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).
  - `locale` 'en' | 'es' | 'pt-br' | 'fr'
  - `trusted_metadata` object: The `trusted_metadata` field contains an arbitrary JSON object of application-specific data. See the [Metadata](https://stytch.com/docs/api/metadata) reference for complete field behavior details.
  - `untrusted_metadata` object: The `untrusted_metadata` field contains an arbitrary JSON object of application-specific data. Untrusted metadata can be edited by end users directly via the SDK, and **cannot be used to store critical information.** See the [Metadata](https://stytch.com/docs/api/metadata) reference for complete field behavior details.

## Response `200`

Successful response

- ApiMagicV1MagicLinksEmailInviteResponse
  - `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.
  - `user_id` string, required: The unique ID of the affected User.
  - `email_id` string, required: The unique ID of a specific email address.
  - `status_code` integer, required: 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.

## Other responses

- `400`: Bad request
- `401`: Unauthorized
- `429`: Too Many Requests
- `500`: Internal server error

## Changes

- **2026-03-07** `110f26a94e5b`: 1 info
  - endpoint added
- **2026-03-06** `9cab20b8eca7`: 1 breaking
  - api path removed without deprecation
- **2026-01-09** `7dfcc14e566c`: 2 breaking
  - the `trusted_metadata` request property type changed from `string` to `object`
  - the `untrusted_metadata` request property type changed from `string` to `object`
- **2025-10-23** `4a2e3c0c0c05`: 5 breaking, 5 warning, 7 info
  - added the new required request property `email`
  - the `name` request property type changed from `string` to `object`
  - removed the required property `member` from the response with the `200` status
  - removed the required property `member_id` from the response with the `200` status
  - …13 more
- **2025-09-17** `8270cf3a3d4c`: 3 info
  - added the media type `application/json` for the response with the status `401`
  - added the media type `application/json` for the response with the status `500`
  - added the non-success response with the status `429`

[Operation history](https://skmtc.dev/stytch/apis/stytch-api/changes/v1/magic_links/email/invite/post.md)

---

[API](https://skmtc.dev/stytch/apis/stytch-api.md) - [All operations](https://skmtc.dev/stytch/apis/stytch-api/llms.txt) - [OpenAPI document](https://skmtc.dev/stytch/apis/stytch-api/revisions/6d1ff7474803?raw)
