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

# Request and Send Code - OTP Code

`POST /otp/code/global`

GLOBAL means system will randomize the channel to send or receive the message from or to the user. This approach will need the Global Token instead of Channel Token. 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.
  - `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)
