Yash
Yash2mo ago

Can I access the Voiceflow Chatbot using API?

Want to access the chatbot using API so that we can automate the QA process. Is there a way to access the chatbot we created using API.
1 Reply
Tico | Voiceflow Assistant
Absolutely! Every Voiceflow agent you build in Creator can be invoked over HTTP through the Dialog Manager API (DM API). That’s the same endpoint the hosted web-chat uses, so it’s perfect for automated QA or custom interfaces. ———— 🔑 Quick setup 1. In your agent, open Integrations ➜ API Keys and copy the Project API key (looks like VF.DM.…). 2. Pick (or generate) a unique userID – one per test thread. The API keeps an independent dialog state per userID. 3. Call the interact endpoint:
POST https://general-runtime.voiceflow.com/state/user/<USER_ID>/interact
Headers
Authorization: <YOUR_API_KEY>
versionID: development # or "production" after you publish
Content-Type: application/json
Body
{
"request": {
"type": "text", # or "intent", "audio", etc.
"payload": "Hello world!" # tester’s utterance
}
}
POST https://general-runtime.voiceflow.com/state/user/<USER_ID>/interact
Headers
Authorization: <YOUR_API_KEY>
versionID: development # or "production" after you publish
Content-Type: application/json
Body
{
"request": {
"type": "text", # or "intent", "audio", etc.
"payload": "Hello world!" # tester’s utterance
}
}
The JSON response contains an array of traces (text, cards, choices, etc.) that your test script can assert against. Send the next user turn to the same endpoint with the same userID to continue the conversation – the DM API tracks state for you. ———— 📌 Things to remember • Works with “General” projects (i.e., agents not uploaded to Alexa/GA).
• Switch versionID to production when you want to test the published build.
• You can also pass/override diagram variables via state.variables in the body.
• Delete a session any time with DELETE /state/user/<USER_ID> if you want a fresh start. Docs & samples • Getting your API key → https://docs.voiceflow.com/reference/api-guide-start#get-your-api-key
• DM API quick-start guide → https://docs.voiceflow.com/reference/api-guide-dmapi-setup
• Full reference & code samples → https://developer.voiceflow.com/reference/overview
• Example test harnesses → https://github.com/voiceflow/api-examples With those calls you can script end-to-end tests, pipe conversations into your CI, or wire the bot into any custom channel. Happy testing! 🚀

Did you find this page helpful?