# Query API

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](https://support.myaskai.com/features/channels).

{% openapi src="<https://3477336559-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fhu0WRsaCQQRKP3KeuIOQ%2Fuploads%2FtqCpGMU8gCq8pgWJDP8i%2Fquery.yaml?alt=media&token=c57b5d66-a76f-43c1-ae85-d875dc710457>" path="/ask-ai-query" method="post" %}
[query.yaml](https://3477336559-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fhu0WRsaCQQRKP3KeuIOQ%2Fuploads%2FtqCpGMU8gCq8pgWJDP8i%2Fquery.yaml?alt=media\&token=c57b5d66-a76f-43c1-ae85-d875dc710457)
{% endopenapi %}

{% hint style="info" %}
If your AskAI doesn't know the answer, the API will return a field to confirm an answer wasn't found:`"unknown_answer": "yes"`
{% endhint %}

{% hint style="info" %}
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."}`
{% endhint %}

{% hint style="info" %}
If human handover [guidance](https://support.myaskai.com/features/improve/guidance) is triggered the API response will include: `"human_handover": true`
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://support.myaskai.com/api-documentation/query-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
