Updated on: October 9, 2025
Purpose: Start an outbound phone call handled by a selected AI agent through a connected Salpre Box.
Endpoint
POST https://ai.salpre.com/api/gateway/v1/call/make-call
Authentication: send your Account Secret Key in the header.
account-secret-key: YOUR_API_KEY
Content type: multipart/form-data
Keep your Account Secret Key private. Use server-side calls whenever possible.
Parameters
All parameters are sent in the multipart form body.
Name | Type | Required | Description |
---|---|---|---|
from | string | Yes | Call origin. Use salprebox:SERIAL_NO . Example: salprebox:SALPRE_123456 . |
to | string | Yes | Destination phone number in E.164 format. Example: +125XXXXXXX . |
agent_id | string or integer | Yes | The AI agent that will handle the call. Example: 5 . |
Where to find your Salpre Box serial number: Salpre Dashboard → Salpre Box menu → each connected device shows its serial. Use it after salprebox:
.
Code samples
cURL (Bash)
curl --location --request POST 'https://ai.salpre.com/api/gateway/v1/call/make-call' \
--header 'account-secret-key: YOUR_API_KEY' \
--form 'from="salprebox:EXAMPLE_SERIAL_NO"' \
--form 'to="+905xxxxxxxxx"' \
--form 'agent_id="5"'
JavaScript (Fetch)
const myHeaders = new Headers();
myHeaders.append("account-secret-key", "YOUR_API_KEY");
const formdata = new FormData();
formdata.append("from", "salprebox:EXAMPLE_SERIAL_NO");
formdata.append("to", "+905xxxxxxxxx");
formdata.append("agent_id", "5");
const requestOptions = {
method: "POST",
headers: myHeaders,
body: formdata,
redirect: "follow"
};
fetch("https://ai.salpre.com/api/gateway/v1/call/make-call", requestOptions)
.then(response => response.json())
.then(result => console.log(result))
.catch(error => console.log("error", error));
Responses
Success
{
"status": "success",
"data": {
"call_id": "c123456",
"status": "initiated",
"agent_id": 5,
"from": "salprebox:EXAMPLE_SERIAL_NO",
"to": "+905xxxxxxxxx"
}
}
Errors
Missing or invalid authentication key
{
"status": "error",
"message": "Unauthorized. Missing or invalid account-secret-key"
}
Invalid Salpre Box
{
"status": "error",
"message": "Invalid Salpre Box serial. Check your Salpre Box menu"
}
Invalid phone number
{
"status": "error",
"message": "Invalid phone number format. Use E.164 like +905XXXXXXXXX"
}
Notes and best practices
- Always format
from
assalprebox:SERIAL_NO
. - Always format
to
in E.164. - Verify the target
agent_id
exists and is active before initiating calls. - Use server-side requests to protect your Account Secret Key.
- Handle the returned
call_id
for status tracking in your system.