Make a voice call

In this Programmable Voice Calling Quickstart, you'll learn how to make an outbound voice call from your web application using the Voice Calling API.

Step 1: Sign up for free

Before we get started, log in to the MessageBird Connectivity Platform and collect your live API key from the Developer Dashboard.

Step 2: Make your first voice call

Now, enter your credentials in the code snippet below, including YOUR-API-KEY with your API key, and enter your mobile number as both the source and destination.

curl https://voice.messagebird.com/calls \
-H "Authorization: AccessKey YOUR-API-KEY" \
-d $'{
"source" : "31XXXXXXXXX",
"destination" : "31XXXXXXXXX",
"callFlow" : {
"steps" : [
{
"action" : "say",
"options" : {
"payload" : "Hey, this is your first voice call",
"language" : "en-GB",
"voice" : "female"
}
}
]
}
}'

Next, simply copy the above snippet to your terminal and hit enter.

Good job! You've just made your first outbound voice call with Programmable Voice Calling!

Step 3: View the response

Now, let’s view MessageBird’s HTTP response to your API call. If the set up was correct, you'll receive a response similar to this:

{
"data": [
{
"id": "33dcf70e-0c06-44b3-9c12-98b38e0ea243",
"status": "queued",
"source": "31XXXXXXXXX",
"destination": "31XXXXXXXXX",
"createdAt": "2019-02-19T10:07:42Z",
"updatedAt": "2019-02-19T10:07:42Z",
"endedAt": null
}
],
"_links": {
"self": "/calls/33dcf70e-0c06-44b3-9c12-98b38e0ea243"
},
"pagination": {
"totalCount": 0,
"pageCount": 0,
"currentPage": 0,
"perPage": 0
}
}

If something went wrong, you’ll receive an error response from the Voice Calling API. Don't worry, simply head over to Programmable Voice Calling Troubleshooting to understand the error.

Congrats! You can now programmatically make outbound Voice Calls with the MessageBird Voice Calling API using cURL.

Questions?

We’re always happy to help with code or other doubts you might have! Check out our Quickstarts, API Reference, Tutorials, SDKs, or contact our Support team.

Cookie Settings