---
title: "Creates and sends an OTP to the visitor."
method: POST
path: "/v1/chat/widget/sendOtp"
tags: ["Chat"]
---

# Creates and sends an OTP to the visitor.

`POST /v1/chat/widget/sendOtp`

## Request body

- ChatValidationModel
  - `apiKey` string, nullable
  - `visitorId` string, nullable
  - `email` string, nullable
  - `otpCode` string, nullable
  - `language` string, nullable

## Response `200`

OK

- ChatHistoryResponseQueryResult
  - `totalItems` integer
  - `items` ChatHistoryResponse[], nullable
    - `statusCode` integer, nullable
    - `success` boolean
    - `message` string, nullable
    - `resource` ChatMessageItem
      - `id` string, nullable
      - `departmentId` integer
      - `chatId` integer
      - `roomId` integer
      - `channel` 1 | 2 | 3 | 4 | 5 | 8 | 10 | 11 | 13 | 14 | 15 | 16 — <p>Enum values:</p><ul><li><i>1 = Chat</i></li><li><i>2 = WhatsApp</i></li><li><i>3 = Facebook</i></li><li><i>4 = Twitter</i></li><li><i>5 = Instagram</i></li><li><i>8 = Telegram</i></li><li><i>10 = Email</i></li><li><i>11 = Sms</i></li><li><i>13 = GooglePlay</i></li><li><i>14 = AppStore</i></li><li><i>15 = Trendyol</i></li><li><i>16 = Tescom</i></li></ul>
      - `channelName` string, nullable
      - `channelId` integer, nullable
      - `channelData` string, nullable
      - `externalId` string, nullable
      - `isFromAgent` integer — 0:visitor, 1:agent, 2:chatbot 4:gen-ai (see ChatUserType.GenAi; 3 is skipped, it is ChatClosedActorType.System)
      - `aiSourceType` integer, nullable — Provenance of the message text (`AiSourceType`), or `null` for "never evaluated by the AI pipeline" — every human and RiveScript message. Independent of Infoset.Types.Models.Items.Chat.ChatMessageItem.IsFromAgent: neither substitutes for the other.
      - `fromUser` string, nullable — Message sender
      - `visitor` string, nullable
      - `agent` string, nullable
      - `photo` string, nullable
      - `content` string, nullable
      - `fileUrls` string, nullable
      - `sourceLang` string, nullable
      - `targetLang` string, nullable
      - `logTime` string, date-time
      - `isNote` integer — 1: mention, 0: chat message
      - `isEdited` integer
      - `isDeleted` integer
      - `readAt` string, date-time, nullable
      - `replyToId` string, nullable
      - `reaction` string, nullable — Stored separately so a reaction does not masquerade as an edited or additional message.
      - `failedReason` string, nullable
      - `failedCategory` string, nullable
      - `mentionedUserIds` string, nullable
      - `isTranslated` integer
      - `translatedContent` string, nullable
      - `contactId` integer
      - `companyId` integer, nullable
      - `assignedTo` integer
      - `status` string, nullable
      - `roomStatus` string, nullable

## Other responses

- `400` — Bad Request

---

[API](https://skmtc.dev/infoset/apis/infoset-rest-api.md) · [All operations](https://skmtc.dev/infoset/apis/infoset-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/infoset/infoset-rest-api/revisions/f5bc39a1ac15/schema)
