# Send email link

Send a magic link by email to a user. Upon clicking the email link, the User Agent will be redirected to the requested redirect URI with a code (passed in the `code` query parameter). This code can be used to complete the authentication in the subsequent request.

Endpoint: POST /v1/auth/link/email/send
Security: ClientAccessToken

## Request fields (application/json):

  - `device_id` (string)
    Identifier of the device from which the authentication request originates

  - `redirect_uri` (string, required)
    URI that receives a code when the user clicks the email link. This is your server GET endpoint used to complete the authentication, and should accept 'code' as a query parameter. This URI must be configured as an allowed redirect URI for your Transmit client.
    Example: https://www.example.com/verify

  - `email_content` (object)
    Texts, logo and color to render email template with

  - `email_content.subject` (string, required)
    The subject of the email

  - `email_content.primaryColor` (string)
    Primary color of the email, specified as a Hex color
    Example: #6981FF

  - `email_content.base64logo` (string)
    Base64 encoded image for email logo. Must be raw base64 of a PNG, JPEG, GIF or WebP image, without a data URI prefix, such as 'data:image/png;base64,'. The string length must be less than or equal to 60000 characters.

  - `email_content.headerText` (string)
    The header of the email

  - `email_content.bodyText` (string)
    The body of the email

  - `email_content.linkText` (string)
    The text of the link button in the email

  - `email_content.infoText` (string)
    Any extra information in the email

  - `email_content.footerText` (string)
    The footer of the email
    Example: If you didn't request this email, you can safely ignore it.

  - `email_content.senderName` (string)
    Name of the sender of the email

  - `state` (string)
    An opaque string that is used to maintain state between the request and the callback. It will be added to the redirect URI as a query parameter, which should be validated by your server to protect against cross-site request forgery (CSRF) attacks

  - `email_expiration` (number)
    invitation link expiration in minutes

  - `channel` (string)
    Channel to use to send the magic link
    Enum: "email", "direct"

  - `client_attributes` (object)
    Client attributes

  - `client_attributes.user_agent` (string)

  - `client_attributes.ip_address` (string)

  - `generate_request_id` (boolean)
    The request ID can serve as an additional security identifier for authentication requests. When set to 'false' (by default), the request ID isn't returned. When set to 'true',  Mosaic generates a unique request ID that must be included in the subsequent Authenticate OTP request along with other required parameters.

  - `identifier` (string, required)
    Identifier value (email, phone number, user ID, or custom identifier)
    Example: name@example.com

  - `identifier_type` (string, required)
    Type of identifier (email, phone_number, user_id, username, or custom identifier type)
    Example: email

  - `email` (string, required)
    Email of the user (deprecated, use identifier and identifier_type instead)
    Example: name@example.com

## Response 200 fields (application/json):

  - `message` (string, required)
    Example: Email sent successfully

