---
title: "Send a Failover OTP message"
method: POST
path: "/otp/send-failover"
tags: ["Failover OTP"]
---

# Send a Failover OTP message

`POST /otp/send-failover`

Send an OTP with a **flow** of steps (e.g.

## Request body

- FailoverSendRequest
  - `flow` FlowStep[], required
    - `type` 'ViberOtp' | 'Sms', required — `ViberOtp` or `Sms`
    - `to` union, required
      - string — E.164 recipient (Sms)
      - string[] — E.164 recipients (ViberOtp)
    - `order` integer, required — Step order in the flow (1, 2, …). Must be unique.
    - `ttl` integer, required — Time to live in **seconds** (message validity and failover timing)
    - `trackingId` string, nullable — Set in response on the step that was sent (message token)
    - `failoverOnDelivered` boolean — ViberOtp only. When true, trigger next channel `ttl` seconds after Viber **Delivered**
    - `label` string — Campaign or tracking label
    - `from` string — Sms sender ID
    - `message` object — Sms step — required with at least `body`
      - `body` string
      - `flash` boolean
      - `transcode` boolean
      - `label` string
    - `senderInfoTrackingId` string — ViberOtp — Routee Viber OTP sender tracking id
    - `templateId` string — ViberOtp — template UUID from GET /otp/templates
    - `templateLang` string
    - `pin` string — ViberOtp — OTP code (4–10 characters)
    - `templateType` string — Required for non-basic templates (e.g. with_business_name, with_validity)
    - `businessName` string
    - `validityTime` string
    - `pinType` string
    - `actionName` string
    - `codeReason` string
  - `callback` FailoverCallback
    - `url` string, uri, required — Webhook URL. The service POSTs tracking JSON on status changes and when failover is sent.

## Response `200`

Send accepted (check `status` for outcome)

- FailoverSendResponse
  - `flowId` string, nullable — Flow UUID for tracking. Null when status is Failed.
  - `status` 'InProgress' | 'Succeeded' | 'Failed'
  - `type` string, nullable — `Viber` or `Sms` — channel that succeeded
  - `error` string, nullable
  - `flow` FlowStep[]
    - `type` 'ViberOtp' | 'Sms', required — `ViberOtp` or `Sms`
    - `to` union, required
      - string — E.164 recipient (Sms)
      - string[] — E.164 recipients (ViberOtp)
    - `order` integer, required — Step order in the flow (1, 2, …). Must be unique.
    - `ttl` integer, required — Time to live in **seconds** (message validity and failover timing)
    - `trackingId` string, nullable — Set in response on the step that was sent (message token)
    - `failoverOnDelivered` boolean — ViberOtp only. When true, trigger next channel `ttl` seconds after Viber **Delivered**
    - `label` string — Campaign or tracking label
    - `from` string — Sms sender ID
    - `message` object — Sms step — required with at least `body`
      - `body` string
      - `flash` boolean
      - `transcode` boolean
      - `label` string
    - `senderInfoTrackingId` string — ViberOtp — Routee Viber OTP sender tracking id
    - `templateId` string — ViberOtp — template UUID from GET /otp/templates
    - `templateLang` string
    - `pin` string — ViberOtp — OTP code (4–10 characters)
    - `templateType` string — Required for non-basic templates (e.g. with_business_name, with_validity)
    - `businessName` string
    - `validityTime` string
    - `pinType` string
    - `actionName` string
    - `codeReason` string
  - `createdAt` string, date-time
  - `statusCode` integer, nullable — When Failed — 0 server, 1 balance, 2 no step, 3 not triggered

## Other responses

- `401` — Invalid or expired Bearer token
- `403` — Missing Bearer credentials
- `422` — Request validation failed

---

[API](https://skmtc.net/routee/apis/auth.md) · [All operations](https://skmtc.net/routee/apis/auth/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/routee/auth/revisions/5cef04e8f7d8/schema)
