Verify a User's Email API

On this page

This API is used to mark a User's email as verified. This is usually called after the User receives the verification email after they register and they click the link in the email. To verify a User's phone number identity, see the Identity Verify API.

Request#

Verify a User's email using the verification Id sent to them by email, or mark them verified administratively using an API key.

With a Verification Id#

No Authentication Required
Verifies the User's email address using the verificationId.
POST/api/user/verify-email
OpenAPI Spec
No Authentication Required
Verifies the User's email address using the verificationId.
POST/api/user/verify-email/{verificationId}

Path Parameters#

verificationId
  • Type: String
  • Required
  • Deprecated

The verification Id generated by FusionAuth used to verify the User's registration is valid by ensuring they have access to the provided email address.

Deprecated since 1.28.0

This value can still be provided on the URL segment as shown in the above example, but it is recommended you send this value in the request body instead using the verificationId field. If the value is provided in the URL segment and in the request body, the value provided in the request body will be preferred.

Request Body#

eventInfo
  • Type: Object
  • Optional

Information about the request. FusionAuth adds the information to the events the request triggers, as event.info. For more information, see Pass Context From API Requests to Webhooks.

eventInfo.data
  • Type: Object
  • Optional

An object that holds any JSON you choose, such as a trace Id. FusionAuth copies the object to event.info.data without changes.

eventInfo.deviceDescription
  • Type: String
  • Optional

A description of the end user's device.

eventInfo.deviceName
  • Type: String
  • Optional

The name of the end user's device.

eventInfo.deviceType
  • Type: String
  • Optional

The type of the end user's device.

eventInfo.ipAddress
  • Type: String
  • Optional

The IP address of the end user. When your server calls FusionAuth for the end user, set this value to the end user's IP address. When this value is omitted, FusionAuth uses the IP address of the client that sent the request.

eventInfo.os
  • Type: String
  • Optional

The operating system of the end user's device.

eventInfo.userAgent
  • Type: String
  • Optional

The user agent of the end user's browser.

oneTimeCode
  • Type: String
  • Optional
  • Available since 1.27.0

The short code used to verify the User's account is valid by ensuring they have access to the provided email address. This field is required when the email verification strategy on the Tenant is set to Form field.

verificationId
  • Type: String
  • Required
  • Available since 1.27.0

The verification Id generated by FusionAuth used to verify the User's account is valid by ensuring they have access to the provided email address.

When using the Form field strategy for Email verification, this value is used along with the oneTimeCode as a pair to verify the email address.

If the verificationId is provided in the URL segment and in the request body, the value provided in the request body will be preferred.

Request Headers#

X-FusionAuth-TenantId
  • Type: String
  • Optional

The unique Id of the tenant used to scope this API request.

The tenant Id is not required on this request even when more than one tenant has been configured because the tenant can be identified based upon other values in the request or it is otherwise not required.

Specify a tenant Id on this request when you want to ensure the request is scoped to a specific tenant. The tenant Id may be provided through this header or by using a tenant locked API key to achieve the same result.

See Making an API request using a Tenant Id for additional information.

Available since 1.37.0

This API can be used to mark a user as verified without requiring the user to actually complete a verification process.

As an Administrator#

API Key Authentication
Administratively verify the User's email address.
POST/api/user/verify-email
OpenAPI Spec

Request Body#

eventInfo
  • Type: Object
  • Optional

Information about the request. FusionAuth adds the information to the events the request triggers, as event.info. For more information, see Pass Context From API Requests to Webhooks.

eventInfo.data
  • Type: Object
  • Optional

An object that holds any JSON you choose, such as a trace Id. FusionAuth copies the object to event.info.data without changes.

eventInfo.deviceDescription
  • Type: String
  • Optional

A description of the end user's device.

eventInfo.deviceName
  • Type: String
  • Optional

The name of the end user's device.

eventInfo.deviceType
  • Type: String
  • Optional

The type of the end user's device.

eventInfo.ipAddress
  • Type: String
  • Optional

The IP address of the end user. When your server calls FusionAuth for the end user, set this value to the end user's IP address. When this value is omitted, FusionAuth uses the IP address of the client that sent the request.

eventInfo.os
  • Type: String
  • Optional

The operating system of the end user's device.

eventInfo.userAgent
  • Type: String
  • Optional

The user agent of the end user's browser.

userId
  • Type: String
  • Required

The unique Id of the user to mark verified.

Response#

The response does not contain a body. It only contains one of the status codes below.

Response Codes
CodeDescription
200The request succeeded. The response contains a JSON body.
400The request was invalid or malformed. The response contains an Errors JSON object with the specific errors. FusionAuth also returns a 400 when the request needs a paid FusionAuth license and no license is present.
401FusionAuth didn't authorize the request. The Authorization header is missing, the API key isn't valid, or the API key doesn't have permission for this endpoint and method. The response is empty. For more information, see Unauthorized Responses.
403The verify email functionality has been disabled. See Tenants -> Email -> Email verification settings in the FusionAuth Admin UI.
404The object you're updating doesn't exist. The response is empty.
500FusionAuth had an internal error and logged a stack trace in the FusionAuth log files. The response usually contains an Errors JSON object with the [Exception] general error code. On MySQL, a data field larger than the database column also returns 500. For more information, see Data Field Sizes.
503The search index is unavailable or returned an error, so FusionAuth can't complete the request. The response contains a JSON body.