v4

latestOpenAPI 3.1.02026-08-0255174167.5 KB
messages

Send a message

Sends a message from one of your Dial numbers.

The channel is determined by the number, not the request. A standard number sends SMS/MMS. An iMessage number sends iMessage, automatically falling back to RCS/SMS when the recipient can't receive iMessage — you don't (and can't) pick the channel per message. For standard numbers, status tracks delivery (sentdelivered/undelivered/failed, with a statusError reason on failure); iMessage sends report status: "unknown".

Media. Attach media as public URLs (mediaUrls, JSON or multipart) or as uploaded media file parts (multipart only):

  • Standard numbers: up to 10 items combined, 5 MB each.
  • iMessage numbers: at most one attachment (URL or file).

body is optional when media is attached — a media-only message sends just the attachment (its body is recorded as an empty string). A request with neither a non-empty body nor media is rejected with 400.

Voice messages (iMessage numbers). When the attachment is a single audio file, it is delivered as a native voice message. If a body is also present, the recipient receives two messages — the text, then the voice message — but the API still returns (and records) a single Message. If the recipient can't receive voice messages (no iMessage/RCS), the audio is delivered as a link over SMS instead. Set forceAudioFile: true to always send audio as a regular file attachment in one message. forceAudioFile has no effect on standard numbers, non-audio media, or multi-attachment sends — audio attached to a standard number's message is always MMS media.

Supported types: images (jpeg, png, gif, webp, bmp), audio (mp3, m4a, ogg, wav, amr), video (mp4, 3gpp), pdf, vCard, and iCalendar; any other type is rejected with 400 (HEIC and SVG are not supported). Dial mirrors every attachment into its own storage and serves it from a stable public URL (see Get public media); the message's media array carries those URLs. For standard numbers, true MMS delivery is supported only for US and Canada — to other destinations the carrier delivers an SMS with a link to the media.

Destination limits (standard numbers): accounts on a subscription can send only to US numbers — any other destination is rejected with 400. Pay-as-you-go accounts can send to any supported destination (a destination with no SMS price tier is rejected with 400).

Choosing the from-number. Provide exactly one of fromNumber (a flexible reference: phone-number ID, one of your numbers in E.164 format, or a nickname) or the legacy fromNumberId (ID only). Sending both — or neither — is rejected with 400.

Not idempotent — there is no idempotency key, so retrying a failed request can send a duplicate message. On an ambiguous failure, confirm via List messages before re-sending.

post/api/v1/messages

Headers

Authorizationstring required

Your Dial API key, sent as Authorization: Bearer sk_live_...

Request body

tostring required

Recipient phone number in E.164 format.

fromNumberstring

The Dial number to send from, referenced flexibly: a phone-number ID, one of your numbers in E.164 format, or a number's nickname. A nickname shared by more than one of your numbers is rejected with 400. Provide exactly one of fromNumber or fromNumberId.

fromNumberIdstring

ID of the Dial number to send from (see List phone numbers). Legacy alternative to fromNumber — provide exactly one of the two.

bodystring

Message text. Optional when media is attached; a request with neither a non-empty body nor media is rejected with 400.

forceAudioFileboolean

Send an audio attachment as a regular file attachment instead of an iMessage voice message. No effect on standard numbers or non-audio media.

mediaUrlsstring[]

Publicly reachable http(s) URLs of media to attach. Dial downloads each one server-side and re-hosts it; the source URL is preserved on the media item as originalUrl. iMessage numbers accept at most one item.

Response

Message queued.