Message

Send multiple messages

Sends up to 100 different messages in a single API request. This method is significantly faster than sending a separate API request for each message.

If Message Review is enabled for the project and the batch requires approval (because it exceeds the project's review threshold, or because the project requires approval for messages sent via AI tools), the messages will not be sent immediately; instead, each message will be submitted for review as a scheduled message, and will be sent when a reviewer approves it. In this case, the response will contain status=pending_review, broadcast_id, count, and url (a link to the approval page in the web app) properties instead of the messages array. The project's message_review property (returned by getProjectById) shows in advance whether sends will require approval.

post/v1/projects/{project_id}/send_multi

Request

  • Base URL: https://api.telerivet.com
  • URL: https://api.telerivet.com/v1/projects/{project_id}/send_multi
  • Auth: one of:
    • HTTP basic
    • OAuth 2 (authorization code, authorization URL https://telerivet.com/oauth/authorize, token URL https://api.telerivet.com/oauth/token)

Path parameters

project_idstring required

ID of the Project

Request body

message_typestring

Type of message to send. If text, will use the default text message type for the selected route.

route_idstring

ID of the phone or route to send the messages from

broadcast_idstring

ID of an existing broadcast to associate the messages with

broadcast_titlestring

Title of broadcast to create (when broadcast_id is not provided). When sending more than 100 messages over multiple API requests, you can associate all messages with the same broadcast by providing a broadcast_title parameter in the first API request, then retrieving the broadcast_id property from the API response, and passing it as the broadcast_id parameter in subsequent API requests.

status_urlstring

Webhook callback URL to be notified when message status changes

status_secretstring

POST parameter 'secret' passed to status_url

label_idsstring

Array of IDs of labels to add to each message (maximum 5)

replace_variablesboolean

Set to true to evaluate variables like [[contact.name]] in message content. (See available variables)

track_clicksboolean

If true, URLs in the message content will automatically be replaced with unique short URLs.

short_link_paramsobject

If track_clicks is true, short_link_params may be used to specify custom parameters for each short link in the message. The following parameters are supported:

domain (string): A custom short domain name to use for the short links. The domain name must already be registered for your project or organization.

expiration_sec (integer): The number of seconds after the message is created (queued to send) when the short links will stop forwarding to the destination URL. If null, the short links will not expire.

route_paramsobject

Route-specific parameters to apply to all messages.

When sending messages via chat apps such as WhatsApp, the route_params parameter can be used to send messages with app-specific features such as quick replies and link buttons.

For more details, see Route-Specific Parameters.

varsobject

Custom variables to store with the message

priority1 | 2

Priority of the message. Telerivet will attempt to send messages with higher priority numbers first (for example, so you can prioritize an auto-reply ahead of a bulk message to a large group).

simulatedboolean

Set to true to test the Telerivet API without actually sending a message from the route

Example request

{
  "broadcast_title": "API Broadcast",
  "status_url": "https://example.com/sms_status.php",
  "status_secret": "t0psecr3t",
  "replace_variables": true
}

Response

Successful response

broadcast_idstring

ID of broadcast that these messages are associated with, if broadcast_id or broadcast_title parameter is provided in the API request.

Changes

No recorded changes to this operation across all 1 revision of this API.