Send a message

Send a text from your Comms line over iMessage, RCS, or SMS. Scope: comms_send.

post/messages

Request

  • Base URL: https://osis.co/api/v1/comms
  • URL: https://osis.co/api/v1/comms/messages
  • Auth: HTTP bearer

Headers

Idempotency-Keystring

Lets you retry without sending twice.

Request body

tostring

Phone number to send to. Required unless you set contact_id or conversation_id. Use E.164, or set default_country for a local number. For RCS, this must be an E.164 number.

bodystring

The message text. Required unless you send attachments.

conversation_idstring

A one-on-one or group conversation to send in. Required unless you set to or contact_id. Group messages stay on iMessage and on the group's original line. Text and attachments both work.

reply_to_message_idstring

The message to reply to in an iMessage thread. Needs conversation_id. Thread replies stay on iMessage. Changing this on a retry with the same idempotency key returns 409.

channel'auto' | 'sms' | 'imessage' | 'rcs' | 'whatsapp'

auto (default) tries iMessage, then RCS, then WhatsApp, then SMS, all from the same number. RCS is only tried for plain text sent to a phone number. WhatsApp is only tried for text or files when the number has WhatsApp turned on and the recipient is on WhatsApp. Comms only moves to the next channel when the last one clearly rejected the message. Timeouts and unclear results never cause a second send. If you pick a channel, only that channel is used. RCS needs a supported dedicated line and doesn't work with contact_id, conversation_id, attachments, polls, or thread replies. channel whatsapp needs a number with WhatsApp turned on, in from or line_e164, and carries text up to 4096 characters, attachments, and thread replies.

line_e164string

The number to send from, in E.164 format. You can also call it from. Agent keys can pick any line attached to the agent. By default, replies use the conversation's line and new messages use the agent's primary line. A workspace key limited to one line can only use that line.

fromstring

Another name for line_e164.

idempotency_keystring

Same as the Idempotency-Key header.

contact_idstring

A contact you already have. Required unless you set to or conversation_id.

default_countrystring

Country code, only needed if the number is local and has no country code.

Example request

{
  "to": "+12125550147",
  "line_e164": "+12025550101",
  "contact_id": "ctc_01HZX",
  "default_country": "US"
}

Response

Already sent with this idempotency key. Returns the first message.

duplicateboolean

Changes

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