Initiate a single ad-hoc test call from a chosen phone number
curl --request POST \
--url https://api.pineyard.ai/calls/test \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"agentId": "<string>",
"toNumber": "<string>",
"fromPhoneNumberId": "<string>"
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({agentId: '<string>', toNumber: '<string>', fromPhoneNumberId: '<string>'})
};
fetch('https://api.pineyard.ai/calls/test', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pineyard.ai/calls/test"
payload = {
"agentId": "<string>",
"toNumber": "<string>",
"fromPhoneNumberId": "<string>"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"callId": "<string>",
"externalCallId": "<string>"
}Test calls
Initiate a single ad-hoc test call from a chosen phone number
POST
/
calls
/
test
Initiate a single ad-hoc test call from a chosen phone number
curl --request POST \
--url https://api.pineyard.ai/calls/test \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"agentId": "<string>",
"toNumber": "<string>",
"fromPhoneNumberId": "<string>"
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({agentId: '<string>', toNumber: '<string>', fromPhoneNumberId: '<string>'})
};
fetch('https://api.pineyard.ai/calls/test', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pineyard.ai/calls/test"
payload = {
"agentId": "<string>",
"toNumber": "<string>",
"fromPhoneNumberId": "<string>"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"callId": "<string>",
"externalCallId": "<string>"
}Required scope:
calls.test
Idempotency: an Idempotency-Key header is required when calling with an API key. See Idempotency.Authorizations
Your API key, e.g. pk_live_xxxxxxxxxxxxxxxxxxxxxxxx.
Headers
Unique value (e.g. a UUID) per action, up to 200 printable ASCII characters. Reuse it only to retry the same request; the first response is replayed for 24 hours.
Maximum string length:
200Example:
"f1d2c3b4-0000-4000-8000-000000000000"
Body
application/json

