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:
- Customize the email-sending process.
- Delay sending the verification email.
- 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.
- 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.
- 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>" }'
- The API will return a JSON object containing the verification URL:
{ "ticket": "https://<domain>/verify_email?ticket=<ticket id>" }