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": {}
}
]
}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.
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
AgentLine API key. Get one via the email OTP flow (POST /v1/auth/otp then POST /v1/auth/verify). Pass as: Authorization: Bearer al_live_... (legacy sk_live_... still works).
Body
Display name for the AI voice agent
Default instructions for the agent's personality and behavior on ALL calls (inbound and outbound). Can be overridden per-call via POST /v1/calls.
Default opening line spoken on ALL calls (inbound and outbound), e.g. 'Hello, how can I help you today?'. Can be overridden per-call via POST /v1/calls.
TTS voice preset name (e.g. 'female-1', 'male-1') or Cartesia voice UUID; defaults to system voice if not set
Ignored unless it is the owner phone. Live transfers always dial owner_phone; a different number is rejected.
Message the AI agent leaves if the call goes to voicemail
Owner's phone number in E.164 format (e.g. '+12125551234'). Calls from this number enter task mode. This is also the only number a live call can be transferred to.
Response
Successful Response
Unique agent identifier (e.g. 'agt_abc123')
Account that owns this agent
Display name of the AI voice agent
When the agent was created
Default system prompt for all calls (can be overridden per-call)
Default greeting for all calls (can be overridden per-call)
TTS voice preset or Cartesia UUID
Always the owner phone. Live calls transfer only here.
Message left on voicemail
Owner's phone number for task mode and the only live-call transfer destination