# Initiate email verification (/docs/apis/management/users/VerifyEmail)

`POST /users/{user_id}/emails/{identifier_id}/verify/link`

Generates a signed, time-bound verification link for the specified email address and sends it to the user. Once verified, the email becomes eligible for authentication and secure communication.

Base URL: `https://{tenant}.{region}.monocloud.com/api`, where `{tenant}`, `{region}` (one of us, eu, in) come from your tenant. Authentication: send your Management API key in the `X-API-KEY` header.

## Parameters

- `user_id` (path) (string, required) The unique identifier of the user.
- `identifier_id` (path) (string, required, uuid) The unique identifier of the email address.

## Request body

JSON, required. The request payload used to initiate email verification.

- `expiry` (integer, int32) Lifetime of the verification link (in seconds). Defaults to the system configuration when omitted.

## Response body

`200`, JSON. The email verification link was generated successfully

Returns `VerifyEmailResponse`.

- `expires_at` (integer, required, date-time) The expiry time for the verification link (in Epoch).
- `email_sent` (boolean, required) Specifies whether the verification email was sent to the user.

## Errors

- `400` Bad Request
  - `type` (string, required) A URI reference that identifies the error type. When accessed, it may provide human-readable documentation.
  - `title` (string, required) A short, human-readable summary of the error.
  - `status` (integer, required, int32) The HTTP status code associated with this error response.
  - `trace_id` (string, required) A unique identifier for the request, used for tracing and diagnostics.
  - `detail` (string) A human-readable explanation specific to this occurrence of the error.
  - `instance` (string) A URI reference that identifies the specific occurrence of the error.
- `401` Unauthorized
- `403` Forbidden
- `404` Not Found
  Same body as `400`.
- `422` Unprocessable Entity
  - `KeyValidationProblemDetails`
    - `type` (string, required) A URI reference that identifies the error type. When accessed, it may provide human-readable documentation.
    - `title` (string, required) A short, human-readable summary of the error.
    - `status` (integer, required, int32) The HTTP status code associated with this error response.
    - `trace_id` (string, required) A unique identifier for the request, used for tracing and diagnostics.
    - `detail` (string) A human-readable explanation specific to this occurrence of the error.
    - `instance` (string) A URI reference that identifies the specific occurrence of the error.
    - `errors` (Record<string, string[]>, required) A key-value map of validation errors, where each key represents a request field and the value contains one or more messages describing why the request could not be processed.
  - `IdentityValidationProblemDetails`
    - `type` (string, required) A URI reference that identifies the error type. When accessed, it may provide human-readable documentation.
    - `title` (string, required) A short, human-readable summary of the error.
    - `status` (integer, required, int32) The HTTP status code associated with this error response.
    - `trace_id` (string, required) A unique identifier for the request, used for tracing and diagnostics.
    - `detail` (string) A human-readable explanation specific to this occurrence of the error.
    - `instance` (string) A URI reference that identifies the specific occurrence of the error.
    - `errors` (IdentityError[], required) List of identity validation errors describing why the request could not be processed.

## Example (MonoCloud .NET SDK)

```csharp
using MonoCloud.Management;
using MonoCloud.Management.Models;
using MonoCloud.Management.Core.Base;

var apiClient = new MonoCloudManagementClient(new MonoCloudConfig("<your-domain>", "[[API-Key]]"));


var userId = "WUgDGqaqzqkRmsgd3PFAT";

var identifierId = Guid.Parse("4b7a790b-b28b-4877-8a08-ab4e668231d1");

var requestBody = new VerifyEmailRequest
  {
    Expiry = 600,
  };


var result = await apiClient.Users.VerifyEmailAsync(userId, identifierId, requestBody);
```

## Example (MonoCloud Javascript SDK)

```javascript
import { MonoCloudManagementClient } from '@monocloud/management';

const apiClient = MonoCloudManagementClient.init({ domain: '<your-domain>', apiKey: '[[API-Key]]' });

const userId = 'WUgDGqaqzqkRmsgd3PFAT';

const identifierId = '4b7a790b-b28b-4877-8a08-ab4e668231d1';

const requestBody = {
  expiry: 600
};

const result = apiClient.users.verifyEmail(userId, identifierId, requestBody);
```