Skip to main content
The mycpaas Voice API lets you initiate outbound phone calls programmatically and control exactly what happens during each call using LaML XML documents. You can speak text, play audio, collect input, and receive real-time status updates via webhooks—all from a single API endpoint.

Make an outbound call

Send a POST request to the Calls resource to initiate an outbound call. mycpaas dials the destination number, then fetches the LaML XML document at the URL you provide to determine how the call is handled.
POST /api/laml/2010-04-01/Accounts/{AccountSid}/Calls.json

Required parameters

AccountSid
string
required
Your account SID. Found in the mycpaas dashboard. Included in the URL path.
To
string
required
The destination phone number to dial, in E.164 format (e.g. +491234567890).
From
string
required
Your mycpaas phone number to use as the caller ID, in E.164 format (e.g. +491098765432). The number must be active in your account.
Url
string
required
A publicly accessible URL that returns a LaML XML document. mycpaas fetches this URL once the call connects and follows the instructions in the document to control the call.

Optional parameters

StatusCallback
string
A URL that mycpaas sends a webhook POST request to when call status changes. Use this to track call progress in your application.
StatusCallbackEvent
string
A space-separated list of call events that trigger a webhook to StatusCallback. Defaults to completed if omitted. See the tip below for all available values.
StatusCallbackEvent accepts any combination of these values: initiated, ringing, answered, completed. For example, to receive a webhook at every stage of the call lifecycle, set StatusCallbackEvent to "initiated ringing answered completed".

Example request

curl -X POST https://developer.mycpaas.io/api/laml/2010-04-01/Accounts/ACxxx/Calls.json \
  -u ACxxx:AUTH_TOKEN \
  -d "To=+491234567890" \
  -d "From=+491098765432" \
  -d "Url=https://example.com/voice.xml" \
  -d "StatusCallback=https://example.com/call-status" \
  -d "StatusCallbackEvent=initiated ringing answered completed"

Control the call with LaML XML

The Url parameter points to a LaML XML document that mycpaas fetches when the call connects. The document tells mycpaas what to do during the call—speak text, play audio, collect digits, and more. Your server must respond with a Content-Type of application/xml or text/xml.

Speak text with <Say>

Use <Say> to convert text to speech and play it to the caller.
<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Say voice="alice" language="en-US">Hello! Thanks for calling mycpaas. Please hold while we connect you.</Say>
</Response>

Play an audio file with <Play>

Use <Play> to stream an audio file (MP3 or WAV) to the caller instead of synthesized speech.
<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Play>https://example.com/audio/welcome.mp3</Play>
</Response>

Response fields

A successful POST returns HTTP 201 with a JSON object representing the created call.
sid
string
The unique identifier for this call (e.g. CAxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx). Use this SID to look up or update the call later.
to
string
The destination phone number that was dialed.
from
string
The caller ID phone number used for this call.
status
string
The current status of the call. See the table below for all possible values.
direction
string
Indicates how the call was initiated. outbound-api for calls you create via the API; inbound for calls made to your mycpaas number.

Example response

{
  "sid": "CA1234567890abcdef1234567890abcdef",
  "to": "+491234567890",
  "from": "+491098765432",
  "status": "queued",
  "direction": "outbound-api",
  "date_created": "2026-04-19T10:00:00Z",
  "uri": "/api/laml/2010-04-01/Accounts/ACxxx/Calls/CA1234567890abcdef1234567890abcdef.json"
}

Call status values

StatusDescription
queuedThe call is waiting to be dialed.
initiatedmycpaas has started dialing the destination number.
ringingThe destination phone is ringing.
in-progressThe call has been answered and is active.
completedThe call ended normally.
failedThe call could not be completed due to an error.
busyThe destination number was busy.
no-answerThe call was not answered before the timeout elapsed.

List and filter calls

Use GET on the Calls resource to retrieve a list of calls associated with your account. You can filter by status, direction, phone number, and paginate through large result sets.
GET /api/laml/2010-04-01/Accounts/{AccountSid}/Calls.json

Query parameters

ParameterTypeDefaultDescription
Pageinteger0Page number to retrieve (zero-indexed).
PageSizeinteger50Number of records per page.
TostringFilter calls by destination phone number (E.164 format).
FromstringFilter calls by originating phone number (E.164 format).
StatusstringFilter calls by status. See call status values above.

Example: list recent calls

curl -X GET "https://developer.mycpaas.io/api/laml/2010-04-01/Accounts/ACxxx/Calls.json?PageSize=10&Status=completed" \
  -u ACxxx:AUTH_TOKEN

Example: filter calls to a specific number

curl -X GET "https://developer.mycpaas.io/api/laml/2010-04-01/Accounts/ACxxx/Calls.json?To=%2B491234567890&Page=0&PageSize=25" \
  -u ACxxx:AUTH_TOKEN

Example response

{
  "page": 0,
  "page_size": 10,
  "calls": [
    {
      "sid": "CA1234567890abcdef1234567890abcdef",
      "to": "+491234567890",
      "from": "+491098765432",
      "status": "completed",
      "direction": "outbound-api",
      "date_created": "2026-04-19T10:00:00Z",
      "uri": "/api/laml/2010-04-01/Accounts/ACxxx/Calls/CA1234567890abcdef1234567890abcdef.json"
    }
  ]
}