Create Agent
curl --request POST \
--url https://api.agentline.cloud/v1/agents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"system_prompt": "<string>",
"initial_greeting": "<string>",
"voice_id": "<string>",
"transfer_number": "<string>",
"voicemail_message": "<string>",
"owner_phone": "<string>"
}
'import requests
url = "https://api.agentline.cloud/v1/agents"
payload = {
"name": "<string>",
"system_prompt": "<string>",
"initial_greeting": "<string>",
"voice_id": "<string>",
"transfer_number": "<string>",
"voicemail_message": "<string>",
"owner_phone": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
system_prompt: '<string>',
initial_greeting: '<string>',
voice_id: '<string>',
transfer_number: '<string>',
voicemail_message: '<string>',
owner_phone: '<string>'
})
};
fetch('https://api.agentline.cloud/v1/agents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"account_id": "<string>",
"name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"system_prompt": "<string>",
"initial_greeting": "<string>",
"voice_id": "<string>",
"transfer_number": "<string>",
"voicemail_message": "<string>",
"owner_phone": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Agents
Create Agent
Create a new AI voice agent for telephony.
Sets up a new AI phone agent with a custom system prompt, voice, and greeting. Once created, buy a phone number and attach it to this agent so it can make and receive calls autonomously.
Fields:
- name: Display name for the agent
- system_prompt: Instructions that define the agent’s personality and behavior on calls
- initial_greeting: What the AI agent says when the call connects
- voice_id: TTS voice preset (e.g. “female-1”) or Cartesia UUID
- transfer_number: Must be the owner phone. Live calls transfer only to owner_phone.
- voicemail_message: Message the agent leaves if the call goes to voicemail
- owner_phone: Owner’s E.164 number. Task mode, and the only transfer destination.
POST
/
v1
/
agents
Create Agent
curl --request POST \
--url https://api.agentline.cloud/v1/agents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"system_prompt": "<string>",
"initial_greeting": "<string>",
"voice_id": "<string>",
"transfer_number": "<string>",
"voicemail_message": "<string>",
"owner_phone": "<string>"
}
'import requests
url = "https://api.agentline.cloud/v1/agents"
payload = {
"name": "<string>",
"system_prompt": "<string>",
"initial_greeting": "<string>",
"voice_id": "<string>",
"transfer_number": "<string>",
"voicemail_message": "<string>",
"owner_phone": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
system_prompt: '<string>',
initial_greeting: '<string>',
voice_id: '<string>',
transfer_number: '<string>',
voicemail_message: '<string>',
owner_phone: '<string>'
})
};
fetch('https://api.agentline.cloud/v1/agents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"account_id": "<string>",
"name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"system_prompt": "<string>",
"initial_greeting": "<string>",
"voice_id": "<string>",
"transfer_number": "<string>",
"voicemail_message": "<string>",
"owner_phone": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Body
application/json
Response
Successful Response