Calls
Start an outbound call
POST/calls
The call is placed straight away and returned with its id. Its summary, outcome and analysis arrive when it ends: fetch it again, or use the call.completed webhook. Needs a plan with minutes left.
#Request body
assistant_idintegerrequiredtostringrequired- The number to call, E.164 (+13125550142)
phone_number_idinteger- Your BluePenguin number to call from; default: your first one
variablesobject- Values for {{variables}} in the prompt and first message
#Example request
curl -X POST https://app.bluepenguin.io/api/v1/calls \
-H "Authorization: Bearer $BLUEPENGUIN_KEY" \
-H "Content-Type: application/json" \
-d '{
"assistant_id": 12,
"to": "+15555550142",
"phone_number_id": 3,
"variables": {
"first_name": "Maya"
}
}'const r = await fetch('https://app.bluepenguin.io/api/v1/calls', {
method: 'POST',
headers: {
authorization: `Bearer ${process.env.BLUEPENGUIN_KEY}`,
'content-type': 'application/json',
},
body: JSON.stringify({
"assistant_id": 12,
"to": "+15555550142",
"phone_number_id": 3,
"variables": {
"first_name": "Maya"
}
}),
})
const data = await r.json()import os, requests
r = requests.post(
"https://app.bluepenguin.io/api/v1/calls",
headers={"Authorization": f"Bearer {os.environ['BLUEPENGUIN_KEY']}"},
json={
"assistant_id": 12,
"to": "+15555550142",
"phone_number_id": 3,
"variables": {
"first_name": "Maya"
}
},
)
data = r.json()#Example response
200 OK
{
"id": 8812,
"assistant_id": 12,
"channel": "phone",
"direction": "outbound",
"from_number": "+15555550100",
"to_number": "+15555550142",
"started_at": null,
"ended_at": null,
"duration_s": 0,
"status": "queued",
"outcome": null,
"ended_reason": null,
"summary": "",
"intent": "",
"caller_name": null,
"score": null,
"analysis": {}
}#Errors
| Status | When |
|---|---|
401 | Missing or invalid API key. |
422 | A parameter or field is invalid; the reply lists which. |
429 | More than 240 requests a minute on this key. |