MMS and Media


Send picture messages by including a mediaUrl in your request. The API downloads the file, validates it, and attaches it to the message automatically.

How it works

  1. You provide a mediaUrl pointing to a publicly accessible file
  2. The API downloads the file and validates its type and size
  3. The file is attached and the message is sent as MMS

You can include both body and mediaUrl to send an MMS with text, or omit body to send media only.

Supported media types

MIME TypeExtension
image/jpeg.jpg, .jpeg
image/png.png
image/gif.gif
video/mp4.mp4
video/mpeg.mpeg
audio/mpeg.mp3
application/pdf.pdf
text/vcard, text/x-vcard.vcf

Size limits

The maximum file size is 1 MB. Files exceeding this limit are rejected with error code 33014.

Example

curl -X POST https://platform.textingline.com/api/v1/messaging/message \
  -u "your_key_id:your_key_secret" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+18005551234",
    "from": "+18005559876",
    "body": "Here is your receipt",
    "mediaUrl": "https://example.com/receipts/order-12345.pdf"
  }'

Media URL requirements

The mediaUrl must:

  • Use http:// or https:// protocol
  • Be publicly accessible (no authentication required)
  • Pass security validation (internal/private IPs are blocked)
  • Resolve to a supported MIME type

Credits

MMS messages consume 1 MMS credits and 1 SMS credits(1 message + 1 carrier lookup if needed).

Common errors

CodeDescription
33014Media file exceeds 1 MB size limit
33015MIME type is not supported
33017Failed to download the file from the URL
33018Media URL failed security validation

See Error Codes for the full reference.