Skip to main content
POST
/
v1
/
irisgpt
/
ask
Generates AI answer with relevant links to any support query
curl --request POST \
  --url https://api1.irisagent.com/v1/irisgpt/ask \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "query": "<string>",
  "productId": "<string>",
  "author": "agent"
}
'
{
  "mdText": "<string>",
  "htmltext": "<string>",
  "source": "<string>",
  "plaintext": "<string>",
  "id": "<string>",
  "responseType": "no-answer",
  "intentTag": "<string>",
  "linksTitle": "<string>",
  "links": [
    {
      "text": "<string>",
      "url": "<string>"
    }
  ],
  "urls": [
    "<string>"
  ]
}

Authorizations

Authorization
string
header
required

The Authorization header is required to authenticate API requests. It should contain a bearer token obtained through the IrisAgent portal.

Headers

X-Language-Iso-Code
string<iso-639-1>

This optional header allows you to specify the desired language. If not provided, automatic language detection will be used.

Chat-Identifier
string<uuid>

The Chat-Identifier is an optional header used to track the conversation session. If not provided, a new chat session will automatically be created.
While not required for single request/response interactions, it is necessary for maintaining continuity in ongoing conversations.

Body

application/json

The requestBody contains the information sent to IrisGPT for processing. The main component is the query, representing the user's input or question. This body must be sent in JSON format.

query
string
required

The user's query or question to be processed by IrisGPT. It is the core input for generating a response.

productId
string

If you have multiple products and knowledge base segmented by products, you can provide the product ID here.

author
enum<string>

The author of the query, which can be used for personalization or tracking purposes.

Available options:
agent,
customer

Response

The AskResponse represents the structure of the response returned by IrisGPT. It is formatted in JSON and contains the AI-generated answer to the user's query.

The AskResponseItem schema defines the structure of IrisGPT's response, including both the formatted and plain text versions of the answer, along with relevant links and URLs.

mdText
string
required

The Markdown-formatted response from IrisGPT, including links and titles sourced from relevant articles.

htmltext
string
required

The HTML-formatted response from IrisGPT, including links and titles sourced from relevant articles.

source
string
required

The source of the response content, indicating where the information was obtained from.

plaintext
string
required

A plain text version of IrisGPT's response, excluding any links.

id
string
required

Unique identifier for the response, which can be used for tracking or reference.

responseType
enum<string>
default:no-answer

Indicates the type of response and how it was generated.

Available options:
ai-answer-from-tickets,
ai-answer-with-kb-links,
generic,
intent-flow,
intent-tags,
no-answer
intentTag
string | null

The intent tag associated with the response, if applicable.

The title of the source articles, which can vary based on the request language.

A list of objects containing URLs and their corresponding titles, representing articles referenced in the response.

urls
string[] | null

A list of URLs corresponding to the source articles from which the response is derived.