---
title: "Retrieve AI answer"
method: GET
path: "/ai/answer"
tags: ["ai"]
---

# Retrieve AI answer

`GET /ai/answer`

## Request

- Base URL: `https://public.stonly.com/api/v3`
- URL: `https://public.stonly.com/api/v3/ai/answer`
- Auth: HTTP basic

Polls for the result of a search request. Returns the generated answer and metadata once ready.

## Query parameters

- `teamId` integer
- `questionAnswerId` string, uuid, required

## Response `200`

Answer successfully generated.

- AiAnswersResult
  - `questionAnswerId` string, uuid, required: Unique identifier for the generated AI answer
  - `conversationId` string, uuid, required: Unique identifier for the current conversation
  - `query` string, required: Original query submitted by the user
  - `queryMetadata` QueryMetadata, required: Metadata describing the query context
    - `language` string
    - `aiAgentId` integer
    - `userEmail` string, email: Email address of the user who triggered the AI query
    - `webhookUrl` string, uri: Webhook URL used to deliver the final answer asynchronously
    - `kbBaseUrl` string, uri: Base URL of the knowledge base used by the AI agent
  - `answer` string, required
  - `answerMetadata` union, required: Metadata describing the generated answer; can include fallback, clarification, or guided answer information.
    - AnswerMetadata
      - `links` object[]
        - `url` string, uri
      - `language` string
      - `isFallback` boolean
    - ClarificationAnswerMetadata
      - `clarificationOptions` string[]
      - `clarificationCustomerExplanation` string
      - `queryIsAmbiguous` boolean
      - `originalQuestion` string
      - `phrase` string
      - `gptModel` string
    - GuidedAnswer
      - `intentRecognised` integer, required: Indicates if an intent was successfully recognized (1 = yes, 0 = no)
      - `guideId` string, required: Identifier of the guide to be launched
      - `stepId` string, required: Identifier of the guide step to start from
      - `guideLaunchMode` 'redirected' | 'embedded' | 'customMessage' | 'bpa', required: Determines how the guide should be launched
      - `language` string, required
      - `originalQuestion` string, required
      - `phrase` string, required
      - `detectedIntent` string, required
      - `answerText` string, required
      - `linkText` string, required
  - `status` 'NEW' | 'IN_PROGRESS' | 'COMPLETED' | 'FAILED', required: Current processing status of the answer

## Other responses

- `202`: Answer is still generating. Retry after a short delay.
- `default`: Standard error response.

---

[API](https://skmtc.dev/stonly/apis/stonly-public-api.md) - [All operations](https://skmtc.dev/stonly/apis/stonly-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/stonly/apis/stonly-public-api/revisions/4ba5b03a634a?raw)
