Node SDK
The Node package is not on npm yet.npm i agentline returns 404. Call the
REST API with fetch until a package is published. Python is
pip install agentline-ai (from agentline_ai import AgentLine).
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
The Node SDK is not on npm yet. Call the REST API with fetch.
npm i agentline returns 404. Call the
REST API with fetch until a package is published. Python is
pip install agentline-ai (from agentline_ai import AgentLine).
client.agents // create, list, get, update, delete
client.numbers // buy, list, get, attach, reassign, release (destructive)
client.calls // create, list, get, getTranscript, hangup, pushContext
client.messages // list, listConversations
client.events // poll, peek
client.webhooks // list, set, delete, test
client.billing // getBalance, getExpenditure, getSummary, ...
client.voice // list, get, set, reset
const headers = {
Authorization: "Bearer al_live_...",
"Content-Type": "application/json",
};
const agent = await fetch("https://api.agentline.cloud/v1/agents", {
method: "POST",
headers,
body: JSON.stringify({
name: "Support Bot",
system_prompt: "You are a helpful assistant.",
initial_greeting: "Hello! How can I help you today?",
}),
}).then((res) => res.json());
await fetch("https://api.agentline.cloud/v1/numbers", {
method: "POST",
headers,
body: JSON.stringify({
agent_id: agent.id,
country: "US",
area_code: "415",
}),
});
const call = await fetch("https://api.agentline.cloud/v1/calls", {
method: "POST",
headers,
body: JSON.stringify({
agent_id: agent.id,
to_number: "+12125557890",
}),
}).then((res) => res.json());
await fetch(`https://api.agentline.cloud/v1/calls/${call.id}/hangup`, {
method: "POST",
headers,
});
const transcript = await fetch(
`https://api.agentline.cloud/v1/calls/${call.id}/transcript`,
{ headers },
).then((res) => res.json());
console.log(transcript);