---
title: "Generate a link to send in an email message."
method: POST
path: "/admin/generate_link"
tags: ["admin"]
---

# Generate a link to send in an email message.

`POST /admin/generate_link`

## Request body

- object
  - `type` 'magiclink' | 'signup' | 'recovery' | 'email_change_current' | 'email_change_new', required
  - `email` string, email, required
  - `new_email` string, email
  - `password` string
  - `data` object
  - `redirect_to` string, uri

## Response `200`

User profile and generated link information.

- object
  - `action_link` string, uri
  - `email_otp` string
  - `hashed_token` string
  - `verification_type` string
  - `redirect_to` string, uri

## Other responses

- `400` — HTTP Bad Request response. Can occur if the passed in JSON cannot be unmarshalled properly or when CAPTCHA verification was not successful. In certain cases can also occur when features are disabled on the server (e.g. sign ups). It may also mean that the operation failed due to some constraint not being met (such a user already exists for example).
- `401` — HTTP Unauthorized response.
- `403` — HTTP Forbidden response.
- `404` — There is no such user.
- `422` — Has multiple meanings: - User already exists - Provided password does not meet minimum criteria - Secure email change not enabled

---

[API](https://skmtc.net/supabase/apis/supabase-auth-rest-api.md) · [All operations](https://skmtc.net/supabase/apis/supabase-auth-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/supabase/supabase-auth-rest-api/versions/2664b89bee49/schema)
