Skip to main content
Sending a message with mycpaas takes a single HTTP POST request. You provide the destination number, your mycpaas number, and the message body — mycpaas handles routing and delivery. The same endpoint supports both SMS and MMS; adding a MediaUrl parameter upgrades the message to MMS automatically.

Endpoint

POST /api/laml/2010-04-01/Accounts/{AccountSid}/Messages.json
Authenticate using HTTP Basic Auth with your Account SID as the username and your Auth Token as the password.

Path parameters

AccountSid
string
required
Your Account SID. Found in the Dashboard.

Body parameters

To
string
required
The phone number to send the message to, in E.164 format (e.g. +491234567890).
From
string
required
Your mycpaas phone number to send the message from, in E.164 format (e.g. +491098765432).
Body
string
required
The text content of the message. Maximum 1,600 characters for SMS; long messages are split into segments automatically.
MediaUrl
string
A publicly accessible URL of the media file to attach. Including this parameter sends an MMS instead of an SMS. Supported types include JPEG, PNG, GIF, and MP4.
StatusCallback
string
A URL that mycpaas will send a POST request to whenever the message status changes (e.g. sent, delivered, failed). Use this to track delivery in real time.
Always use E.164 format for phone numbers: a + sign followed by the country code and subscriber number, with no spaces or dashes (e.g. +491234567890). Requests with incorrectly formatted numbers will be rejected.

Send an SMS

curl -X POST https://developer.mycpaas.io/api/laml/2010-04-01/Accounts/ACxxx/Messages.json \
  -u ACxxx:AUTH_TOKEN \
  -d "To=+491234567890" \
  -d "From=+491098765432" \
  -d "Body=Hello from mycpaas!"

Send an MMS

Include a MediaUrl to attach an image or other media file. The URL must be publicly accessible — mycpaas fetches the file at send time.
curl -X POST https://developer.mycpaas.io/api/laml/2010-04-01/Accounts/ACxxx/Messages.json \
  -u ACxxx:AUTH_TOKEN \
  -d "To=+491234567890" \
  -d "From=+491098765432" \
  -d "Body=Here is your receipt." \
  -d "MediaUrl=https://example.com/receipt.png"

Response

A successful request returns HTTP 201 Created with a JSON object representing the message.
{
  "sid": "SMxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "to": "+491234567890",
  "from": "+491098765432",
  "body": "Hello from mycpaas!",
  "status": "queued",
  "date_created": "2026-04-19T10:00:00Z",
  "uri": "/api/laml/2010-04-01/Accounts/ACxxx/Messages/SMxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.json"
}
sid
string
A unique identifier for the message, prefixed with SM.
to
string
The destination phone number in E.164 format.
from
string
The mycpaas number the message was sent from, in E.164 format.
body
string
The text content of the message.
status
string
The current delivery status of the message. See the status table below.
date_created
string
The ISO 8601 timestamp of when the message was created.
uri
string
The relative path to fetch this message resource via the API.

Message status values

StatusMeaning
queuedThe message has been accepted and is waiting to be sent.
sendingmycpaas is in the process of dispatching the message to the carrier.
sentThe message has been handed off to the carrier successfully.
deliveredThe carrier has confirmed delivery to the recipient’s handset.
failedThe message could not be sent. Check the error code in the response for details.

List messages

Use a GET request to retrieve a paginated list of messages for your account. You can filter results by any combination of the query parameters below.
curl -G https://developer.mycpaas.io/api/laml/2010-04-01/Accounts/ACxxx/Messages.json \
  -u ACxxx:AUTH_TOKEN \
  -d "To=+491234567890" \
  -d "Status=delivered" \
  -d "PageSize=20"

Query parameters

ParameterTypeDefaultDescription
TostringFilter to messages sent to this number (E.164).
FromstringFilter to messages sent from this number (E.164).
DateSentstringFilter to messages sent on this date (YYYY-MM-DD).
StatusstringFilter by status: queued, sending, sent, delivered, or failed.
Pageinteger0The page number to retrieve (zero-indexed).
PageSizeinteger50Number of messages per page.

List response

{
  "page": 0,
  "page_size": 20,
  "messages": [
    {
      "sid": "SMxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
      "to": "+491234567890",
      "from": "+491098765432",
      "body": "Here is your receipt.",
      "status": "delivered",
      "date_created": "2026-04-19T10:00:00Z",
      "uri": "/api/laml/2010-04-01/Accounts/ACxxx/Messages/SMxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.json"
    }
  ]
}