---
title: "Request and send a verification code"
method: POST
path: "/api/verification-codes"
tags: ["Verification codes"]
---

# Request and send a verification code

`POST /api/verification-codes`

Request a verification code for the provided identifier (email/phone).
if you're using email as the identifier, you need to setup your email connector first.
if you're using phone as the identifier, you need to setup your SMS connector first.

## Request body

- union
  - object
    - `email` string, regex, required
  - object
    - `phone` string, regex, required

## Response `204`

Verification code requested and sent successfully.

## Other responses

- `400` — Bad request. The payload may be invalid.
- `401` — Unauthorized
- `403` — Forbidden
- `429` — Too Many Requests
- `501` — Not Implemented

---

[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)
