LogoLogo
Create free AI agent
  • Welcome
    • 👋Welcome to My AskAI
  • START HERE
    • 🤷‍♂️What is an AI Customer Support Agent?
      • 💪What are the benefits of using My AskAI?
      • 🤔Who is this for?
    • 🏗️Create your AI support agent
    • ➕Add your AI agent to your website
      • ➕WordPress
      • 🛍️Shopify
      • 💬Zendesk
    • 📼Full product demo
    • ⏲️How long does it take to set-up?
    • 📺Video tutorials
    • ⭐Reviews
    • 🆘Support
  • Features
    • ❓AI answers on your content
    • 🤝Human handover
    • 🔌Channels
      • Slack
      • Microsoft Teams
      • Zapier
      • Zendesk
        • Zendesk (Messaging)
        • Zendesk (Tickets)
        • Zendesk (Tagging + Sentiment)
      • Intercom
        • Human Handover Workflows
      • Freshchat
      • Freshdesk
      • Gorgias
      • HubSpot
      • Chrome Extension
      • Zoho (SalesIQ)
      • Live Chat Channels Feature Comparison
    • ☁️Connections
      • 🔑Authorizations
    • 🛍️Shopify
    • 👤User data API and API actions
      • 👤User details API specification
    • ✏️Improve + Custom answers
    • 🔓Private (Internal) mode
    • 📂File uploads
    • 🔁SiteSync — Adding & syncing your website content
    • 💡Insights
      • 🔔Conversation insight notifications
    • 👯Team access
    • 📨Email assistant
    • 📩Lead (Email) Capture
    • 🎨Customization
    • 🔍Site search
    • 👍Conversation ratings (CSAT)
    • 🌍Languages and Localization
    • ⚡Starter actions
    • ◻️Remove branding
  • SECURITY + PRIVACY
    • 🔐Security
      • On-Premise
      • OpenAI API keys
      • SOC-2
    • 👣Privacy
      • Your content
      • Your data
      • OpenAI
      • Regulations
        • GDPR compliance
        • HIPAA
  • ACCOUNT MANAGEMENT
    • 💲Pricing + plans
    • 🧱Limits
      • Exceeding limits
      • Conversations
    • 🦸‍♀️Your profile
      • Changing your email
      • Close your account
    • 💳Billing
      • Change plan
      • Update payment card
      • Download an invoice
      • Discounts
      • Refunds
      • Tax
      • Cancel subscription
    • 🧑‍🤝‍🧑User access
      • Setting a Password for Your Account
      • Reset login password
    • 🤑Affiliate program
    • 💼Reselling + Whitelabelling
  • TROUBLESHOOTING
    • 🐢Slow responses
    • 💬Chat bubble not visible
    • 🤷‍♀️Why can't it answer?
    • 🗝️Login
    • 😕Website not added
    • 🗣️Issue connecting your live chat widget
    • 🤦‍♂️Oops there has been an error
  • FAQ
    • 🪖General
      • 📱Can I use the AI agent within a mobile app?
      • 🥫Can I add macros, canned or stock responses to my AI agent?
      • 👯Can I have multiple AI agents, multiple brands or multiple knowledge bases?
      • Can I route tickets to different agents?
      • 🤪Can I give my agent a personality, adjust the tone or customize the prompt?
      • 🤓Does it get smarter the more conversations it has?
      • 🤔Which messages will my AI agent respond to?
      • 🐦What are your social accounts?
      • ⚖️What is the difference between My AskAI and My AskAI Classic?
      • 🙅Will it answer questions about competitors' products?
      • ♻️My website has dynamic content, can I use My AskAI?
      • 🤷‍♂️What if it can't answer?
      • 👃Will it make things up?
      • 💡Feature suggestions
      • 🎏Answer streaming
      • 🌡️Temperature
      • 💇‍♂️My AskAI vs Fine-tuning
      • 🤖My AskAI vs ChatGPT
      • ✅How can I test the accuracy of my AI agent's answers?
      • 📚(Large Language Models) LLMs
      • 👨‍🔬Algorithm change log
      • ✏️Can I use my own OpenAI assistant or Custom GPT?
      • 🤔How does it work?
  • API Documentation
    • API Docs Introduction
    • Query API
    • Chat API
    • User Data API
Powered by GitBook
On this page

Was this helpful?

  1. API Documentation

Chat API

PreviousQuery APINextUser Data API

Last updated 1 month ago

Was this helpful?

Our Chat API allows a user to have a conversation with your AI agent via a simple API call.

The messages array should contain the conversation between the user and the AI agent. You can send the entire conversation within the API request.

Each message object has a role (user or assistant) and content.

In the example below you can see a short conversation between a user and an AI agent.

The message from the user has the role: user and all replies from the AskAI have the role: assistant.

If your AI agent doesn't know the answer, the API will also return an additional field to confirm an answer wasn't found as well as 3 suggested questions the user can retry (these have a very high likelihood of being answered correctly):

"unknown_answer": "yes",

"suggestedQuestions": ["Example question", ...]

The query field has a 750 character limit. If this is exceeded, you will see an error: {"error":"This question is too long. Please ensure questions are less than 750 characters."}

Chat with AskAI

post
Body
idstringRequired

AskAI ID

api_keystringRequired

AskAI API Key

Responses
200
Successful response
application/json
post
POST /api/1.1/wf/ask-ai-chat HTTP/1.1
Host: myaskai.com
Content-Type: application/json
Accept: */*
Content-Length: 76

{
  "id": "text",
  "api_key": "text",
  "messages": [
    {
      "role": "text",
      "content": "text"
    }
  ]
}
200

Successful response

{
  "answer": "text",
  "references": [
    {
      "content": "text",
      "link": "https://example.com",
      "score": 1,
      "title": "text"
    }
  ]
}