> ## Documentation Index
> Fetch the complete documentation index at: https://support.myaskai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 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](/features/channels).

<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"`
</Info>

<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."}`
</Info>

<Info>
  If human handover [guidance](/features/improve/guidance) is triggered the API response will include: `"human_handover": true`
</Info>


## OpenAPI

````yaml /api-documentation/query-2.yaml POST /ask-ai-query
openapi: 3.0.0
info:
  title: AskAI API
  version: '1.1'
servers:
  - url: https://myaskai.com/api/1.1/wf
security: []
paths:
  /ask-ai-query:
    post:
      summary: Ask a question to AskAI
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: string
                  description: AskAI ID
                api_key:
                  type: string
                  description: AskAI API Key
                query:
                  type: string
                  description: Question to AskAI
              required:
                - id
                - api_key
                - query
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  answer:
                    type: string
                    description: Answer from AskAI
                  references:
                    type: array
                    items:
                      type: object
                      properties:
                        content:
                          type: string
                          description: Content of the reference
                        link:
                          type: string
                          format: uri
                          description: Link to the reference
                        score:
                          type: number
                          format: float
                          description: Score of the reference
                        title:
                          type: string
                          description: Title of the reference
                  suggestedQuestions:
                    type: array
                    items:
                      type: string
                    description: Array of suggested follow-up questions
                  unknown_answer:
                    type: string
                    enum:
                      - 'no'
                      - 'yes'
                    description: Indicates if the answer is known or not

````