---
title: "Create and send verification code"
method: POST
path: "/api/experience/verification/verification-code"
tags: ["Experience"]
---

# Create and send verification code

`POST /api/experience/verification/verification-code`

Create a new `CodeVerification` record and sends the code to the specified identifier. The code verification can be used to verify the given identifier.

## Request body

- object
  - `identifier` union, required — The identifier (email address or phone number) to send the verification code to.
    - object
      - `type` string, "email", required
      - `value` string, regex, required
    - object
      - `type` string, "phone", required
      - `value` string, regex, required
  - `interactionEvent` 'SignIn' | 'Register' | 'ForgotPassword', required — The interaction event for which the verification code will be used. Supported values are `SignIn`, `Register`, and `ForgotPassword`. This determines the template for the verification code.

## Response `200`

The verification code has been successfully sent.

- object
  - `verificationId` string, required — The unique ID of the verification record. Required to verify the code.

## Other responses

- `400` — An invalid identifier was provided.
- `404` — Not Found
- `422` — Unprocessable Content
- `429` — Too Many Requests
- `501` — The connector for sending the verification code is not configured.

---

[API](https://skmtc.net/logto/apis/logto-api-references.md) · [All operations](https://skmtc.net/logto/apis/logto-api-references/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/logto/logto-api-references/revisions/a163dc77d842/schema)
