curl --request POST \
--url https://api.pineyard.ai/v1/agents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"voice": "<string>",
"prompt": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', voice: '<string>', prompt: '<string>'})
};
fetch('https://api.pineyard.ai/v1/agents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pineyard.ai/v1/agents"
payload = {
"name": "<string>",
"voice": "<string>",
"prompt": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"name": "<string>",
"prompt": "<string>",
"greeting": "<string>",
"voice": "<string>",
"status": "<string>",
"preCallVariables": [
"<string>"
],
"variables": [
"<string>"
],
"systemVariables": [
"<string>"
],
"extractionConfig": {
"prompt": "<string>",
"keys": [
{
"name": "<string>",
"type": "string",
"description": "<string>"
}
],
"includeToolLogs": false
},
"agentType": "<string>",
"enableRecording": true,
"endCallEnabled": true,
"endCallMessage": "<string>",
"endCallTriggers": [
"<string>"
],
"maxCallDurationSecs": 123,
"backgroundAudioId": "<string>",
"backgroundAudioVolume": 123,
"voicemailDetectionEnabled": true,
"voicemailMessage": "<string>",
"screenerHandlingEnabled": true,
"transferEnabled": true,
"transferNumber": "<string>",
"transferMessage": "<string>",
"transferTriggers": [
"<string>"
],
"transferMode": "STATIC",
"transferWebhookUrl": "<string>",
"transferWebhookTimeoutMs": 123,
"hasTransferWebhookSecret": true,
"language": "<string>",
"studioConfig": {
"agentName": "<string>",
"companyName": "<string>",
"languages": [
"<string>"
],
"primaryLanguage": "<string>",
"gender": "female",
"tone": "warm_professional",
"goal": "<string>",
"flowSteps": [
{
"id": "<string>",
"title": "<string>",
"detail": "<string>"
}
],
"faqs": [
{
"question": "<string>",
"answer": "<string>"
}
],
"industry": "<string>",
"designation": "<string>",
"companyDescription": "<string>",
"briefText": "<string>",
"welcomeMessage": "<string>",
"guardrails": [],
"flowGraph": {
"nodes": [
{
"id": "<string>",
"type": "step",
"title": "<string>",
"detail": "<string>",
"position": {
"x": 123,
"y": 123
}
}
],
"edges": [
{
"id": "<string>",
"source": "<string>",
"target": "<string>",
"condition": "<string>"
}
]
},
"closingBehavior": "confirm_and_end",
"abilities": {
"transfer": {
"number": "<string>",
"triggers": [
"CALLER_ASKS_HUMAN"
]
},
"booking": {
"types": [
"site_visit"
]
},
"callback": true,
"whatsapp": {
"collectionIds": [
"<string>"
],
"templateIds": [
"<string>"
]
},
"knowledgeDocIds": [
"<string>"
],
"functionIds": [
"<string>"
]
},
"languageSwitching": "fast",
"keyTerms": [
"<string>"
],
"sampleDialogue": "<string>",
"promptSpec": 1,
"overrides": {
"namesPolicy": "use_name",
"identityConfirm": "by_name",
"silenceHandling": "ask",
"endCallEtiquette": "close_only",
"mixRatio": "balanced"
}
},
"abilities": {
"transfer": {
"number": "<string>",
"triggers": [
"CALLER_ASKS_HUMAN"
]
},
"booking": {
"types": [
"site_visit"
]
},
"callback": true,
"whatsapp": {
"collectionIds": [
"<string>"
],
"templateIds": [
"<string>"
]
},
"knowledgeDocIds": [
"<string>"
],
"functionIds": [
"<string>"
]
},
"promptEditedManually": true,
"createdAt": "<string>",
"updatedAt": "<string>",
"warnings": [
{
"code": "<string>",
"message": "<string>"
}
]
}Create an agent (v1)
Creates and provisions an agent with the same rules as the dashboard. Send a prompt, or a studioConfig for Pineyard to assemble the prompt from. Use a voice id from GET /v1/voices. prompt and studioConfig are returned, and can be changed, only when prompt visibility is enabled for your workspace. Otherwise prompt is an empty string and studioConfig is null. Non-fatal setup problems are listed in warnings. Names are unique per workspace, archived agents included, so an archived agent keeps its name reserved: after a timeout, check GET /v1/agents before retrying.
curl --request POST \
--url https://api.pineyard.ai/v1/agents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"voice": "<string>",
"prompt": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', voice: '<string>', prompt: '<string>'})
};
fetch('https://api.pineyard.ai/v1/agents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pineyard.ai/v1/agents"
payload = {
"name": "<string>",
"voice": "<string>",
"prompt": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"name": "<string>",
"prompt": "<string>",
"greeting": "<string>",
"voice": "<string>",
"status": "<string>",
"preCallVariables": [
"<string>"
],
"variables": [
"<string>"
],
"systemVariables": [
"<string>"
],
"extractionConfig": {
"prompt": "<string>",
"keys": [
{
"name": "<string>",
"type": "string",
"description": "<string>"
}
],
"includeToolLogs": false
},
"agentType": "<string>",
"enableRecording": true,
"endCallEnabled": true,
"endCallMessage": "<string>",
"endCallTriggers": [
"<string>"
],
"maxCallDurationSecs": 123,
"backgroundAudioId": "<string>",
"backgroundAudioVolume": 123,
"voicemailDetectionEnabled": true,
"voicemailMessage": "<string>",
"screenerHandlingEnabled": true,
"transferEnabled": true,
"transferNumber": "<string>",
"transferMessage": "<string>",
"transferTriggers": [
"<string>"
],
"transferMode": "STATIC",
"transferWebhookUrl": "<string>",
"transferWebhookTimeoutMs": 123,
"hasTransferWebhookSecret": true,
"language": "<string>",
"studioConfig": {
"agentName": "<string>",
"companyName": "<string>",
"languages": [
"<string>"
],
"primaryLanguage": "<string>",
"gender": "female",
"tone": "warm_professional",
"goal": "<string>",
"flowSteps": [
{
"id": "<string>",
"title": "<string>",
"detail": "<string>"
}
],
"faqs": [
{
"question": "<string>",
"answer": "<string>"
}
],
"industry": "<string>",
"designation": "<string>",
"companyDescription": "<string>",
"briefText": "<string>",
"welcomeMessage": "<string>",
"guardrails": [],
"flowGraph": {
"nodes": [
{
"id": "<string>",
"type": "step",
"title": "<string>",
"detail": "<string>",
"position": {
"x": 123,
"y": 123
}
}
],
"edges": [
{
"id": "<string>",
"source": "<string>",
"target": "<string>",
"condition": "<string>"
}
]
},
"closingBehavior": "confirm_and_end",
"abilities": {
"transfer": {
"number": "<string>",
"triggers": [
"CALLER_ASKS_HUMAN"
]
},
"booking": {
"types": [
"site_visit"
]
},
"callback": true,
"whatsapp": {
"collectionIds": [
"<string>"
],
"templateIds": [
"<string>"
]
},
"knowledgeDocIds": [
"<string>"
],
"functionIds": [
"<string>"
]
},
"languageSwitching": "fast",
"keyTerms": [
"<string>"
],
"sampleDialogue": "<string>",
"promptSpec": 1,
"overrides": {
"namesPolicy": "use_name",
"identityConfirm": "by_name",
"silenceHandling": "ask",
"endCallEtiquette": "close_only",
"mixRatio": "balanced"
}
},
"abilities": {
"transfer": {
"number": "<string>",
"triggers": [
"CALLER_ASKS_HUMAN"
]
},
"booking": {
"types": [
"site_visit"
]
},
"callback": true,
"whatsapp": {
"collectionIds": [
"<string>"
],
"templateIds": [
"<string>"
]
},
"knowledgeDocIds": [
"<string>"
],
"functionIds": [
"<string>"
]
},
"promptEditedManually": true,
"createdAt": "<string>",
"updatedAt": "<string>",
"warnings": [
{
"code": "<string>",
"message": "<string>"
}
]
}agents.edit
/v1 endpoint.Authorizations
Your API key, e.g. pk_live_xxxxxxxxxxxxxxxxxxxxxxxx.
Body
1 - 10011280002000100^[a-zA-Z_][a-zA-Z0-9_]*$Show child attributes
Show child attributes
OUTBOUND, INBOUND 5004CALLER_GOODBYE, GOAL_COMPLETED, IDLE, REMOVE_FROM_LIST 60 <= x <= 36000 <= x <= 150032^\+\d{8,15}$500CALLER_ASKS_HUMAN, FRUSTRATED, ASKS_MANAGER, UNKNOWN_QUESTION, BILLING STATIC transfers to transferNumber. WEBHOOK asks transferWebhookUrl for a number at call time; transferNumber is then the fallback.
STATIC, WEBHOOK HTTPS URL that answers {"to_number":"+E.164"} when a caller asks for a human. Cannot be set with an API key.
2048Write-only signing secret for requests to transferWebhookUrl. A string sets it, null or "" removes it, omit to keep. Never returned. Cannot be set with an API key.
1024How long transferWebhookUrl has to answer, in milliseconds (default 3000).
500 <= x <= 4000Show child attributes
Show child attributes
Show child attributes
Show child attributes
Response
Created
Show child attributes
Show child attributes
STATIC, WEBHOOK Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes

