Query API

Use the Query API to create an integratation with your AI agent.

With our API you can build your own internal tools or workflows and harness the power of your AI agent wherever you want, however you want.

The API is powerful, but very simple. You input a question and get an answer back, along with the references/content used in the answer.

See full details of the API below. Alternatively, you can use our pre-built integrations with Slack, Microsoft Teams or Zapier.

Ask a question to AskAI

post
Body
idstringRequired

AskAI ID

api_keystringRequired

AskAI API Key

querystringRequired

Question to AskAI

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

{
  "id": "text",
  "api_key": "text",
  "query": "text"
}
200

Successful response

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

If your AskAI doesn't know the answer, the API will return a field to confirm an answer wasn't found:"unknown_answer": "yes"

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."}

If human handover guidance is triggered the API response will include: "human_handover": true

Last updated

Was this helpful?