REST API ready. Use
fetch or any HTTP client from Node.js. We will add a packaged SDK after the REST surface is stable.Node.js SDK
Use plain fetch with a Bearer token:
Node - list agentsts
700 font-semibold">const res = 700 font-semibold">await fetch("https:700 font-semibold">class="text-gray-500 italic">//flooai.com/api/v1/agents", {
headers: { Authorization: 700 font-semibold">class="text-emerald-700">`Bearer ${process.env.FLOO_API_KEY}` },
});
700 font-semibold">const { data } = 700 font-semibold">await res.json();
console.log(data);Node - outbound call with dynamic variablests
700 font-semibold">const res = 700 font-semibold">await fetch("https:700 font-semibold">class="text-gray-500 italic">//flooai.com/api/v1/calls/outbound", {
method: "POST",
headers: {
Authorization: 700 font-semibold">class="text-emerald-700">`Bearer ${process.env.FLOO_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
agent_id: "agt_xxx",
to_number: "+15551234567",
from_number_id: "pn_xxx",
variables: { first_name: "Alex", appointment_time: "Tuesday at 3pm" },
}),
});Web SDK (browser)
For browser-based voice calls (mic in / speaker out), see the Web SDK- already published as @flooai/sdk on npm.