Make an outbound call
Send aPOST 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.
Required parameters
Your account SID. Found in the mycpaas dashboard. Included in the URL path.
The destination phone number to dial, in E.164 format (e.g.
+491234567890).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.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
A URL that mycpaas sends a webhook
POST request to when call status changes. Use this to track call progress in your application.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.Example request
Control the call with LaML XML
TheUrl 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.
Play an audio file with <Play>
Use <Play> to stream an audio file (MP3 or WAV) to the caller instead of synthesized speech.
Response fields
A successfulPOST returns HTTP 201 with a JSON object representing the created call.
The unique identifier for this call (e.g.
CAxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx). Use this SID to look up or update the call later.The destination phone number that was dialed.
The caller ID phone number used for this call.
The current status of the call. See the table below for all possible values.
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
Call status values
| Status | Description |
|---|---|
queued | The call is waiting to be dialed. |
initiated | mycpaas has started dialing the destination number. |
ringing | The destination phone is ringing. |
in-progress | The call has been answered and is active. |
completed | The call ended normally. |
failed | The call could not be completed due to an error. |
busy | The destination number was busy. |
no-answer | The call was not answered before the timeout elapsed. |
List and filter calls
UseGET 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.
Query parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
Page | integer | 0 | Page number to retrieve (zero-indexed). |
PageSize | integer | 50 | Number of records per page. |
To | string | — | Filter calls by destination phone number (E.164 format). |
From | string | — | Filter calls by originating phone number (E.164 format). |
Status | string | — | Filter calls by status. See call status values above. |

