---
title: "Send a Failover Message"
method: POST
path: "/failover"
---

# Send a Failover Message

`POST /failover`

## Headers

- `Content-Type` string, required
- `Authorization` string, required

## Request body

- object
  - `flow` object — SMS, Viber or Voice
    - `type` string — The type of the flow channel. Supported values: *Sms* , *Viber* or *Voice*
    - `from` string, required — [For SMS and Voice] The name of the sender id, it can be a telephone number or an alphanumeric string. NOTICE FOR VOICE: Alphanumeric sender is not supported by all networks (e.g. Greek networks). Check restrictions and features here: https://go.routee.net/#/management/restrictions-and-features.
    - `to` object
      - `phone` string — The recipient phone [must exist (NotBlank) if viber and sip are both null]
      - `sip` string — A valid sip address. (ex 1111@test.com:55080) [must exist (NotBlank) if phone and viber are both null]
      - `viber` string — A valid phone number. The recipient should have the Viber application installed to be able to receive a Viber call. [must exist (NotBlank) if phone and sip are both null]
    - `ttl` integer — [For SMS and Viber] Time range until message expires in minutes (min 0.5 minute, max 1440 minutes). Default values 10 minutes for Viber messages and 1200 minutes for SMS.
    - `message` object
      - `body` string, required — [For SMS only] The message you want to send. Use "\n" to create a new line in your message.
      - `flash` boolean — [For SMS only] Indicates if the SMS is a flash SMS. A flash SMS is a type of SMS that appears directly on the main screen without user interaction and is not automatically stored in the inbox. It can be useful in emergencies, such as a fire alarm or cases of confidentiality, as in delivering one-time passwords. Default value false.
      - `label` string — [For SMS only] A generic label which can be used for tagging the failover message. The maximum length is 350 characters.
      - `transcode` boolean — [For SMS only] If “transcode” is set to true/false, then the message body will be/not be transcoded. If the “transcode” parameter is not set, then the application level setting will be used
      - `text` string — [For Viber only] The text of Viber message. The maximum number of characters supported in a Viber message is 1000 characters. Use [~{labelName}] in order to send personalized messages, by using the labels of your contacts. [Text only messages are billed as Transactional. All the other message types are charged as Promotional]
      - `imageUrl` string — [For Viber only] The URL of the image. (recommended image size: 400KB for optimal delivery; image url length: max 1000 characters; only valid and secure URL starting with https:/)
      - `action` object
        - `caption` string — [For Viber only] The displayed text on the button (1-30 characters).
        - `targetUrl` string — [For Viber only] The target URL of the Viber action.
      - `viberFile` object
        - `fileName` string — The name of the file. Max size 25 chars
        - `fileType` string — Type of viber message file. The supported file types are following: For document: doc, .docx, .rtf, .dot, .dotx, .odt ,odf, .fodt, .txt, .info For PDF: pdf, .xps, .pdax, .eps For Spreadsheet: .xls, .xlsx, .ods, .fods, .csv, .xlsm, .xltx
        - `fileUrl` string — The url of the document. (recommended file size: 600KB for optimal delivery) (document url length: up to 1000; only valid and secure URL starting with https:/)
      - `viberVideo` object
        - `videoUrl` string, required — The Url where the video is hosted (1000 max chars, only https).
        - `videoThumbnail` string, required — The Url of a thumbnail for the video (1000 max chars, only https).
        - `fileSize` integer, required — The file size in MB (positive number, 200 max).
        - `duration` integer, required — The video’s duration in seconds (positive number, 600 max).
    - `order` integer — Defines the priority order.
    - `failoverOnStatuses` string — Defines the status which will trigger the next channel. Values for SMS channel can be: **Undelivered**, **Failed** Values for Viber channel can be: **Expired**, **Failed**, **Undelivered** Values for Voice channel can be **Completed**, **Busy**, **NoAnswer**, **Failed**, **Unsent**, **Terminated**. Values must be comma separated. The statuses are not case-sensitive Default values for SMS: **Undelivered**, **Failed** Default values for Viber: **Expired**, **Failed**, **Undelivered** Default values for Voice:**Busy**, **NoAnswer** *The statuses are not case-sensitive*
    - `senderInfoTrackingId` string, required — [For Viber only] The unique sender id. You can find it at: [Routee Platform-applications page](https://dev.routee.net/#/management/applications).
    - `inboundUrl` string — [For Viber only] Defines the callback URL that will receive the inbound messages. Check [here](/docs/viber-inbound-messages) for details.
    - `expireOnDelivery` boolean — If it's set to true then the service will set the status of the **Delivered** messages to **Expired** if the TTL value has passed and no **Seen** status has arrived. (Default value is false)
    - `urlShortener` object
      - `urlValidity` integer — [Optional]. Possible values: 3600 up to 2592000. Indicates the time in seconds that the shorten url will be valid (min: 3600 [one hour] - max: 2592000 [30 days]). Default value 2592000
    - `dialplan` object — A combination of action verbs to be executed. Can not be empty. Check [here](/docs/dialplan-verbs) for possible "SAY" and "PLAY" avalues.
      - `verbs` object[] — An array of SAY and PLAY verbs.
        - string
    - `machineDetection` object — [For Voice only] It is used to detect if the call is answered by human or machine and define the desired actions (in case of machine).
      - `strategy` string — The strategy to follow when a machine has been detected. Possible values: "Hangup" (terminate the call) or "Continue" (give another dialplan to execute)
      - `eventUrl` string — The URL that Routee will POST to when a machine is detected (only for "Continue" strategy). A valid dialplan is expected as response.
  - `callback` object — Details about the callback, more information at [Callbacks (Webhook)](https://docs.routee.net/docs/failover-callbacks)
    - `strategy` string — When the URL will be called. Two possible values: on every status change (OnStep) or when a final status arrives (OnCompletion).
    - `url` string — Defines the URL in which a payload with the information about the request will be posted
  - `restrictions` object — [For SMS] Provide the registered Content Template ID and Principal Entity ID to ensure the message is not rejected by TRAI regulations.
    - `india` object — [OPTIONAL] If present, template and entity ID must be a number between 12 and 19 digits
      - `templateId` integer — [OPTIONAL], If present, template ID must be a number between 12 and 19 digits
      - `entityId` integer — [OPTIONAL], If present, entity ID must be a number between 12 and 19 digits

## Response `200`

200

## Other responses

- `400` — 400

---

[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/versions/5cef04e8f7d8/schema)
