---
title: "Request and Send Code"
method: POST
path: "/otp/code/request"
---

# Request and Send Code

`POST /otp/code/request`

The Request and Send OTP Code endpoint enables you to generate a One-Time Password (OTP) with customizable validation settings to ensure uniqueness. You can easily toggle these validation features on or off, depending on your needs. Once generated, the OTP is automatically sent to the specified phone number, providing a secure and flexible way to authenticate users.

## Request body

- object
  - `contact_id` string, required — The contact id
  - `length` integer, required — Length OTP Code.
  - `useLetter` boolean, required — Using letter for Otp Code.
  - `useNumber` boolean, required — Using number for Otp Code.
  - `allCapital` boolean, required — Using uppercase for Otp Code.
  - `name` string, required — Application Name ( Identifier )
  - `expires` integer, required — Expire time in second ( e.g 30 Minute )

## Response `200`

200

- object
  - `success` boolean
  - `message` string
  - `data` object
    - `id` string
    - `code` string
    - `chat_id` string
    - `message` string
    - `expired_at` string
    - `timestamp` string

## Other responses

- `400` — 400
- `422` — 422

---

[API](https://skmtc.net/crunchz/apis/live-2.md) · [All operations](https://skmtc.net/crunchz/apis/live-2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/crunchz/live-2/versions/14e6b45e8808/schema)
