Send Message
curl --request POST \
--url https://api.agentline.cloud/v1/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agent_id": "<string>",
"to_number": "<string>",
"body": "<string>",
"media_url": "<string>",
"from_number_id": "<string>"
}
'import requests
url = "https://api.agentline.cloud/v1/messages"
payload = {
"agent_id": "<string>",
"to_number": "<string>",
"body": "<string>",
"media_url": "<string>",
"from_number_id": "<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({
agent_id: '<string>',
to_number: '<string>',
body: JSON.stringify('<string>'),
media_url: '<string>',
from_number_id: '<string>'
})
};
fetch('https://api.agentline.cloud/v1/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Messages
Send Message
Send an outbound SMS message from an AI agent’s phone number.
POST
/
v1
/
messages
Send Message
curl --request POST \
--url https://api.agentline.cloud/v1/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agent_id": "<string>",
"to_number": "<string>",
"body": "<string>",
"media_url": "<string>",
"from_number_id": "<string>"
}
'import requests
url = "https://api.agentline.cloud/v1/messages"
payload = {
"agent_id": "<string>",
"to_number": "<string>",
"body": "<string>",
"media_url": "<string>",
"from_number_id": "<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({
agent_id: '<string>',
to_number: '<string>',
body: JSON.stringify('<string>'),
media_url: '<string>',
from_number_id: '<string>'
})
};
fetch('https://api.agentline.cloud/v1/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"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 sk_live_...
Body
application/json
ID of the AI agent sending the SMS (e.g. 'agt_abc123')
Destination phone number in E.164 format (e.g. '+12125551234')
SMS message text content
URL of media to attach (MMS)
Specific phone number ID to send from; defaults to the agent's assigned number
Response
Successful Response