Generating Email Verification Links without Emailing the User

Last Updated: Sep 13, 2024

Overview

This article is for the situation where there is a need to generate an email verification link without sending the user an email. This article also applies when is desired for the following scenarios to be achieved:

  1. Customize the email-sending process.
  2. Delay sending the verification email.
  3. Provide the verification link through an alternative channel.

Applies To

  • Email verification
  • Management API

Solution

Use the Create an email verification ticket endpoint to generate a verification link without triggering an email.

Refer to the steps below for how to implement this.

  1. Retrieve a management API token with the create:user_tickets scope. See Get Management API Access Tokens for Production for details on how to do this.
  2. Call the API using the token. Here’s an example using cURL:
    $ curl --request POST \
      --url 'https://<domain>/api/v2/tickets/email-verification'; \
      --header 'content-type: application/json' \
      --header 'authorization: Bearer <token>' \
      --data '{
        "user_id": "<user ID>",
        "result_url": "<result URL>"
      }'
    
  3. The API will return a JSON object containing the verification URL:
    {
      "ticket": "https://<domain>/verify_email?ticket=<ticket id>"
    }
    
1 Like