Use your AI support agent from Node.js
Call your IntelliDesk AI agent from Node.js: send a user's question, get the answer with sources, and continue the conversation. Your snippet, with your agent filled in, is in the dashboard under Deploy → Install; it also confirms when the chat is live on your site.
Steps
- Call the chat endpoint from your backend (Slack bots, in-app assistants, support tools).
js
const res = await fetch("https://YOUR_APP/api/v1/agents/AGENT_ID/chat", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.INTELLIDESK_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ message, conversationId, user: { id: user.id, email: user.email, name: user.name } }),
});
const { data } = await res.json();
// data.reply, data.conversationId, data.sources, data.handoffReplace AGENT_ID with your agent's id and keep the key in your server's environment.
Next
- Every field, streaming and errors: REST API reference.
- New leads and conversations in your app as they happen: webhooks.
- All guides: Platform guides.