---
updatedAt: 2026-09-17T12:44:18.000Z
agentTools:
  projectIndex: https://developers.dexatel.com/llms.txt
---

# Send Message With Fallback

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Fallback Messaging APIs",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://api.dexatel.com",
      "description": "Server base url"
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "paths": {
    "/v1/messages": {
      "post": {
        "tags": [
          "Messages"
        ],
        "summary": "Send Message With Fallback",
        "operationId": "create_message_with_fallback",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessagePostRequestWithFallbackWrapperDto"
              },
              "examples": {
                "text_with_template_fallback": {
                  "summary": "Viber text message, SMS fallback from a template",
                  "value": {
                    "data": {
                      "channel": "VIBER",
                      "from": "Dexatel",
                      "to": [
                        "37455123456"
                      ],
                      "type": "text",
                      "text": "Your order #1234 has been shipped.",
                      "ttl": 60,
                      "fallback_channels": {
                        "cancellation_threshold_sec": 120,
                        "priorities": [
                          {
                            "channel": "SMS",
                            "sender": "3e3f5a7c-5f29-4f1a-9f1e-6a2d5f0b7c11",
                            "template": "b6a1f4e2-9c3d-4a58-8f77-2d9c1b4e6a03"
                          }
                        ]
                      }
                    }
                  }
                },
                "text_with_text_fallback": {
                  "summary": "Viber text message, SMS fallback with its own text",
                  "value": {
                    "data": {
                      "channel": "VIBER",
                      "from": "Dexatel",
                      "to": [
                        "37455123456"
                      ],
                      "type": "text",
                      "text": "Your order #1234 has been shipped.",
                      "ttl": 45,
                      "fallback_channels": {
                        "priorities": [
                          {
                            "channel": "SMS",
                            "sender": "3e3f5a7c-5f29-4f1a-9f1e-6a2d5f0b7c11",
                            "text": "Your order #1234 has been shipped."
                          }
                        ]
                      }
                    }
                  }
                },
                "template_with_template_fallback": {
                  "summary": "Viber template message, SMS fallback from a template",
                  "value": {
                    "data": {
                      "channel": "VIBER",
                      "from": "Dexatel",
                      "to": [
                        "37455123456"
                      ],
                      "template": "f0c8d4b1-2a7e-4c16-9b3f-8e5d0a1c9b44",
                      "variables": [
                        "John",
                        "1234"
                      ],
                      "ttl": 60,
                      "fallback_channels": {
                        "priorities": [
                          {
                            "channel": "SMS",
                            "sender": "3e3f5a7c-5f29-4f1a-9f1e-6a2d5f0b7c11",
                            "template": "b6a1f4e2-9c3d-4a58-8f77-2d9c1b4e6a03"
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageWithFallbackResponseListWrapperDto"
                },
                "examples": {
                  "created": {
                    "summary": "Viber message accepted, fallback armed",
                    "value": {
                      "data": [
                        {
                          "id": "7d3a6f18-9b21-4c6e-a0f5-1c4b8e2d7a90",
                          "account_id": "5f2b8c41-3d77-49aa-8c1b-0e6f9a2d5c33",
                          "from": "Dexatel",
                          "to": "37455123456",
                          "channel": "VIBER",
                          "status": "enroute",
                          "text": "Your order #1234 has been shipped.",
                          "segment_count": 1,
                          "create_date": "2026-09-17 10:24:51",
                          "update_date": "2026-09-17 10:24:51"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "<p><strong>Bad Request:</strong></p>\n<table>\n<tr><th>Code</th><th>Message</th><th>Description</th></tr>\n<tr><td>1005</td><td>Invalid JSON body</td><td>The request body is not valid JSON</td></tr>\n<tr><td>1007</td><td>Request data is missing</td><td>The 'data' field is required</td></tr>\n<tr><td>1503</td><td>Message sender is missing</td><td></td></tr>\n<tr><td>1504</td><td>Invalid message sender</td><td></td></tr>\n<tr><td>1505</td><td>Message sender is not found</td><td></td></tr>\n<tr><td>1506</td><td>Message recipients are missing</td><td></td></tr>\n<tr><td>1507</td><td>Message recipients are too many</td><td>Maximum 10 recipients per request</td></tr>\n<tr><td>1508</td><td>'data.text' is required</td><td></td></tr>\n<tr><td>1510</td><td>Message text is too long</td><td>Maximum 1000 characters</td></tr>\n<tr><td>1512</td><td>Invalid template id</td><td>Template ID must be a valid UUID</td></tr>\n<tr><td>1513</td><td>Template is not found</td><td></td></tr>\n<tr><td>1514</td><td>Template variables are missing</td><td></td></tr>\n<tr><td>1515</td><td>Invalid channel</td><td></td></tr>\n<tr><td>1523</td><td>Invalid recipient number(s)</td><td></td></tr>\n<tr><td>1534</td><td>'data.type' is required</td><td>'data.type' must be provided when the Viber message is sent with 'text'</td></tr>\n<tr><td>1638</td><td>The threshold must be within the 120 to 300 seconds range</td><td>'data.fallback_channels.cancellation_threshold_sec' must be between 120 and 300 seconds</td></tr>\n<tr><td>1639</td><td>All fallbacks besides Telegram must have 'sender' provided</td><td>'data.fallback_channels.priorities[].sender' is required and must be a valid sender identifier</td></tr>\n<tr><td>1658</td><td>Transactional fallback priority size must be 1</td><td>Exactly one fallback channel must be provided in 'data.fallback_channels.priorities'</td></tr>\n<tr><td>1659</td><td>Transactional fallback must not be same as main channel</td><td>The fallback channel must be different from 'data.channel'</td></tr>\n<tr><td>1660</td><td>Only SMS and Viber can be set as fallback for transactional messages</td><td></td></tr>\n<tr><td>1661</td><td>TTL is supported for Viber only for transactional fallback</td><td>'ttl' can not be set on an SMS fallback channel</td></tr>\n<tr><td>1663</td><td>Invalid TTL should be a number from 30 to 86400</td><td>'data.ttl' must be a number between 30 and 86400</td></tr>\n</table>"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "PropertyMessageTo": {
        "type": "array",
        "description": "List of recipient phone numbers as digits without spaces or special characters, beginning with the country dialing code",
        "maxItems": 10,
        "minItems": 1,
        "items": {
          "type": "string"
        }
      },
      "PropertyMessageVariables": {
        "type": "array",
        "description": "If Template contains variables(attributes wrapped in {}), variable array should contain values to replace it with",
        "items": {
          "type": "string",
          "maxLength": 70
        }
      },
      "MessagePostRequestWithFallbackWrapperDto": {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/MessageWithFallbackPostRequestDto"
          }
        }
      },
      "MessageWithFallbackPostRequestDto": {
        "title": "Viber Message With SMS Fallback",
        "type": "object",
        "required": [
          "channel",
          "from",
          "to",
          "fallback_channels"
        ],
        "properties": {
          "channel": {
            "type": "string",
            "enum": [
              "VIBER"
            ],
            "description": "Delivery channel of the message should be set to VIBER"
          },
          "from": {
            "type": "string",
            "description": "Identifier of the sender(name)"
          },
          "to": {
            "$ref": "#/components/schemas/PropertyMessageTo"
          },
          "type": {
            "type": "string",
            "enum": [
              "text"
            ],
            "description": "Type of the Viber message content. Required when the message is sent with 'text'. It is not required when the message is sent with 'template', because the type is taken from the template."
          },
          "text": {
            "type": "string",
            "maxLength": 1000,
            "description": "Text of the message. Maximum 1000 characters. Either 'text' or 'template' is required."
          },
          "template": {
            "type": "string",
            "format": "uuid",
            "description": "Unique identifier of the Viber template. Either 'text' or 'template' is required."
          },
          "variables": {
            "$ref": "#/components/schemas/PropertyMessageVariables"
          },
          "ttl": {
            "type": "integer",
            "minimum": 30,
            "maximum": 86400,
            "description": "Time to live of the Viber message, from 30 to 86400 seconds. When the message is not delivered within the time to live, it expires and the fallback message is sent immediately, without waiting for a delivery report."
          },
          "fallback_channels": {
            "$ref": "#/components/schemas/MessageFallbackDto"
          },
          "number_formatting": {
            "type": "boolean",
            "description": "Defaults to true. If provided, leading 0 after the country code and before the network code will be removed."
          },
          "payload": {
            "type": "string",
            "maxLength": 500,
            "description": "The value provided with this parameter will be sent back to the client through the Webhook URL."
          }
        }
      },
      "MessageFallbackDto": {
        "title": "Fallback",
        "type": "object",
        "required": [
          "priorities"
        ],
        "description": "When the Viber message is not delivered, the message is sent once more on the fallback channel.",
        "properties": {
          "priorities": {
            "type": "array",
            "minItems": 1,
            "maxItems": 1,
            "description": "The fallback channel of the message. Exactly one fallback channel must be provided.",
            "items": {
              "$ref": "#/components/schemas/MessageFallbackPriorityDto"
            }
          },
          "cancellation_threshold_sec": {
            "type": "integer",
            "minimum": 120,
            "maximum": 300,
            "default": 120,
            "description": "How long the fallback stays available after the message is accepted, from 120 to 300 seconds. When the Viber message reports neither delivery nor failure within this window, the fallback is cancelled and no fallback message is sent."
          }
        }
      },
      "MessageFallbackPriorityDto": {
        "title": "Fallback Channel",
        "type": "object",
        "required": [
          "channel",
          "sender"
        ],
        "properties": {
          "channel": {
            "type": "string",
            "enum": [
              "SMS"
            ],
            "description": "Channel used to re-send the message. SMS is the only fallback channel available at the moment, Telegram, WhatsApp and more channels are coming soon."
          },
          "sender": {
            "type": "string",
            "format": "uuid",
            "description": "Unique identifier of the SMS sender used for the fallback message. Unlike 'data.from', this is the identifier of the sender, not its name."
          },
          "text": {
            "type": "string",
            "maxLength": 1000,
            "description": "Text of the fallback message. Either 'text' or 'template' is required."
          },
          "template": {
            "type": "string",
            "format": "uuid",
            "description": "Unique identifier of the SMS template that provides the text of the fallback message. Its {first_name}, {last_name}, {custom1} and {custom2} placeholders are replaced with the values of 'data.variables'. Either 'text' or 'template' is required."
          }
        }
      },
      "MessageWithFallbackResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Unique identifier of the Viber message. The fallback message is created with its own identifier when it is sent"
          },
          "account_id": {
            "type": "string",
            "format": "uuid",
            "description": "Unique identifier of the account"
          },
          "from": {
            "type": "string",
            "description": "Identifier of the sender(name)"
          },
          "to": {
            "type": "string",
            "description": "Recipients phone number"
          },
          "channel": {
            "type": "string",
            "enum": [
              "VIBER"
            ],
            "description": "Delivery channel of the message"
          },
          "status": {
            "type": "string",
            "description": "Message status. The message is accepted with the 'enroute' status"
          },
          "text": {
            "type": "string",
            "description": "Text of the message"
          },
          "segment_count": {
            "type": "integer",
            "format": "int32",
            "description": "Viber messages are always in 1 segment. An SMS fallback message is segmented on its own and can count as more than one segment"
          },
          "encoding": {
            "type": "string",
            "description": "Encoding of the message. Enumeration Values [GSM-7, UCS-2]"
          },
          "create_date": {
            "type": "string",
            "format": "date-time",
            "description": "Creation date of the message in UTC, formatted as yyyy-mm-dd hh:mm:ss"
          },
          "update_date": {
            "type": "string",
            "format": "date-time",
            "description": "Update date of the message in UTC, formatted as yyyy-mm-dd hh:mm:ss"
          }
        }
      },
      "MessageWithFallbackResponseListWrapperDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "description": "One Viber message per recipient. The fallback message is not part of this response, it is reported separately once it is sent",
            "items": {
              "$ref": "#/components/schemas/MessageWithFallbackResponseDto"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Dexatel-Key"
      }
    }
  }
}
```