Assistants

Assistants provide a chat interface for asking questions and getting personalized, relevant answers for Qlik Answers.

Endpoints

List assistants

Retrieves the list of assistants. The result can be filtered, sorted, and paginated.

Facts

Rate limit Tier 1 (1000 requests per minute)

Query Parameters

  • limit integer

    The number of assistants to get.

  • next string

    Optional parameter to request the next page.

  • prev string

    Optional parameter to request the previous page.

  • sort string

    Optional resource field name to sort on, case insensitive, e.g. name. Can be prefixed with - to set descending order; defaults to ascending.

    Can be one of: "NAME""-NAME""DESCRIPTION""-DESCRIPTION""CREATED""-CREATED""UPDATED""-UPDATED"

  • spaceId string

    Optional parameter to filter assistants by space ID.

  • countTotal boolean Deprecated

    Optional parameter to request total count for query.

Responses

200

Successful operation.

  • application/json object
    Show application/json properties
    • data array of objects
      Required
      Show data properties
      • id string
        Required

        Unique identifier of the assistant.

      • name string
        Required

        The name of the assistant.

      • tags array of strings
        Required

        The list of tags associated with the assistant.

      • title string

        The title of the assistant.

      • ownerId string
        Required

        Unique identifier of the assistant owner.

      • spaceId string
        Required

        Unique identifier of the space containing the assistant.

      • tenantId string
        Required

        Unique identifier of the assistant tenant.

      • createdAt string
        Required

        Datetime when the assistant was created.

      • createdBy string
        Required

        Unique identifier of the user who created the assistant.

      • hasAvatar boolean

        Indicates if the assistant has an avatar.

      • updatedAt string
        Required

        Datetime when the assistant was updated.

      • updatedBy string
        Required

        Unique identifier of the user who last updated the assistant.

      • description string
        Required

        The description of the assistant.

      • systemMessage string Deprecated

        System prompt setting up conversation context.

      • knowledgeBases array of strings
        Required

        List of knowledgebases the assistant is using.

      • welcomeMessage string
        Required

        Initial message in the chat conversation.

      • customProperties object
        Required

        freeform JSON to allow custom customization options.

      • defaultPromptType string

        Default prompt type for the assistant.

        Can be one of: "thread""oneshot"

      • orderedStarterIds array of strings

        List of starter IDs in the order they will be sorted.

    • meta object
      Show meta properties
      • countTotal integer
    • links object
      Show links properties
      • next object
        Show next properties
        • href string
      • prev object
        Show prev properties
        • href string
      • self object
        Show self properties
        • href string

400

The request is in incorrect format.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

403

The user does not have privileges to perform the requested action.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string
GET /api/v1/assistants
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.assistants.getAssistants({})
qlik assistant ls
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/assistants" \
-H "Authorization: Bearer <access_token>"

Example Response

{
"data": [
{
"id": "507f191e810c19729de860ea",
"name": "Organization-wide Assistant",
"tags": [
"Red",
"Sales"
],
"title": "Assistant for Sales activities",
"ownerId": "507f191e810c19729de860ea",
"spaceId": "507f191e810c19729de860ea",
"tenantId": "507f191e810c19729de860ea",
"createdAt": "2021-10-02T14:20:50.52Z",
"createdBy": "507f191e810c19729de860ea",
"hasAvatar": true,
"updatedAt": "2021-10-02T14:20:50.52Z",
"updatedBy": "507f191e810c19729de860ea",
"description": "This assistant is used for...",
"systemMessage": "You are helpful Sales assistant. Provide concise and actionable insights.",
"knowledgeBases": [
"507f191e810c19729de860ea"
],
"welcomeMessage": "Welcome to Sales process support Assistant.",
"customProperties": {
"customErrors": {
"outsideScopeError": "Outside of scope error",
"complexQuestionError": "Complex question error",
"promptInjectionError": "Prompt injection error"
}
},
"defaultPromptType": "thread",
"orderedStarterIds": [
"507f191e810c19729de860ea",
"787f191e810c19729de860er"
]
}
],
"meta": {
"countTotal": 42
},
"links": {
"next": {
"href": "string"
},
"prev": {
"href": "string"
},
"self": {
"href": "string"
}
}
}

Create an assistant

Creates a new assistant.

Facts

Rate limit Tier 2 (100 requests per minute)

Request Body

  • application/json object
    Show application/json properties
    • name string
      Required

      The name of the assistant.

    • tags array of strings
      Required

      The list of tags for the assistant.

    • title string
      Required

      The title of the assistant.

    • spaceId string
      Required

      Unique identifier of the space to contain the assistant.

    • description string
      Required

      The description of the assistant.

    • systemMessage string Deprecated

      System prompt setting up conversation context.

    • knowledgeBases array of strings
      Required

      List of knowledgebases the assistant is using.

    • welcomeMessage string
      Required

      Initial message in the chat conversation.

    • customProperties object
      Required

      freeform JSON to allow custom customization options.

    • defaultPromptType string

      Default prompt type for the assistant.

      Can be one of: "thread""oneshot"

    • orderedStarterIds array of strings

      List of starter IDs in the order they will be sorted.

  • multipart/form-data object
    Show multipart/form-data properties
    • name string
      Required

      The name of the assistant.

    • tags array of strings
      Required

      The list of tags for the assistant.

    • title string
      Required

      The title of the assistant.

    • avatar string

      user uploaded avatar, filetype must be png

    • spaceId string
      Required

      Unique identifier of the space to contain the assistant.

    • description string
      Required

      The description of the assistant.

    • systemMessage string Deprecated

      System prompt setting up conversation context.

    • knowledgeBases array of strings
      Required

      List of knowledgebases the assistant is using.

    • welcomeMessage string
      Required

      Initial message in the chat conversation.

    • customProperties object
      Required

      freeform JSON to allow custom customization options.

    • defaultPromptType string

      Default prompt type for the assistant.

      Can be one of: "thread""oneshot"

Responses

201

Successfully created an assistant.

  • application/json object
    Show application/json properties
    • id string
      Required

      Unique identifier of the assistant.

    • name string
      Required

      The name of the assistant.

    • tags array of strings
      Required

      The list of tags associated with the assistant.

    • title string

      The title of the assistant.

    • ownerId string
      Required

      Unique identifier of the assistant owner.

    • spaceId string
      Required

      Unique identifier of the space containing the assistant.

    • tenantId string
      Required

      Unique identifier of the assistant tenant.

    • createdAt string
      Required

      Datetime when the assistant was created.

    • createdBy string
      Required

      Unique identifier of the user who created the assistant.

    • hasAvatar boolean

      Indicates if the assistant has an avatar.

    • updatedAt string
      Required

      Datetime when the assistant was updated.

    • updatedBy string
      Required

      Unique identifier of the user who last updated the assistant.

    • description string
      Required

      The description of the assistant.

    • systemMessage string Deprecated

      System prompt setting up conversation context.

    • knowledgeBases array of strings
      Required

      List of knowledgebases the assistant is using.

    • welcomeMessage string
      Required

      Initial message in the chat conversation.

    • customProperties object
      Required

      freeform JSON to allow custom customization options.

    • defaultPromptType string

      Default prompt type for the assistant.

      Can be one of: "thread""oneshot"

    • orderedStarterIds array of strings

      List of starter IDs in the order they will be sorted.

400

The request is in incorrect format.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

403

The user does not have privileges to perform the requested action.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string
POST /api/v1/assistants
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.assistants.createAssistant({
customProperties: {
customErrors: {
outsideScopeError: 'Outside of scope error',
complexQuestionError:
'Complex question error',
promptInjectionError:
'Prompt injection error',
},
},
defaultPromptType: 'thread',
description: 'This assistant is used for...',
knowledgeBases: ['507f191e810c19729de860ea'],
name: 'Organization-wide assistant',
orderedStarterIds: [
'507f191e810c19729de860ea',
'787f191e810c19729de860er',
],
spaceId: '507f191e810c19729de860ea',
systemMessage:
'You are helpful Sales assistant. Provide concise and actionable insights.',
tags: ['Red', 'Sales'],
title: 'Assistant for Sales activities',
welcomeMessage:
'Welcome to Sales process support Assistant.',
})
qlik assistant create \
--customProperties [object Object] \
--description 'This assistant is used for...' \
--knowledgeBases '507f191e810c19729de860ea' \
--name 'Organization-wide assistant' \
--spaceId '507f191e810c19729de860ea' \
--tags 'Red,Sales' \
--title 'Assistant for Sales activities' \
--welcomeMessage 'Welcome to Sales process support Assistant.'
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/assistants" \
-X POST \
-H "Content-type: application/json" \
-H "Authorization: Bearer <access_token>" \
-d '{"name":"Organization-wide assistant","tags":["Red","Sales"],"title":"Assistant for Sales activities","spaceId":"507f191e810c19729de860ea","description":"This assistant is used for...","systemMessage":"You are helpful Sales assistant. Provide concise and actionable insights.","knowledgeBases":["507f191e810c19729de860ea"],"welcomeMessage":"Welcome to Sales process support Assistant.","customProperties":{"customErrors":{"outsideScopeError":"Outside of scope error","complexQuestionError":"Complex question error","promptInjectionError":"Prompt injection error"}},"defaultPromptType":"thread","orderedStarterIds":["507f191e810c19729de860ea","787f191e810c19729de860er"]}'

Example Response

{
"id": "507f191e810c19729de860ea",
"name": "Organization-wide Assistant",
"tags": [
"Red",
"Sales"
],
"title": "Assistant for Sales activities",
"ownerId": "507f191e810c19729de860ea",
"spaceId": "507f191e810c19729de860ea",
"tenantId": "507f191e810c19729de860ea",
"createdAt": "2021-10-02T14:20:50.52Z",
"createdBy": "507f191e810c19729de860ea",
"hasAvatar": true,
"updatedAt": "2021-10-02T14:20:50.52Z",
"updatedBy": "507f191e810c19729de860ea",
"description": "This assistant is used for...",
"systemMessage": "You are helpful Sales assistant. Provide concise and actionable insights.",
"knowledgeBases": [
"507f191e810c19729de860ea"
],
"welcomeMessage": "Welcome to Sales process support Assistant.",
"customProperties": {
"customErrors": {
"outsideScopeError": "Outside of scope error",
"complexQuestionError": "Complex question error",
"promptInjectionError": "Prompt injection error"
}
},
"defaultPromptType": "thread",
"orderedStarterIds": [
"507f191e810c19729de860ea",
"787f191e810c19729de860er"
]
}

Perform search on an assistant

Perform search with either SIMPLE or FULL mode. SIMPLE does semantic search while FULL does semantic search, reranking and hybrid search. Use topN to control number of chunks in response, max limit is 50. Default to 5.

Facts

Rate limit Tier 2 (100 requests per minute)

Path Parameters

  • assistantId string
    Required

    The ID for the Assistant of interest

Request Body

  • application/json object
    Show application/json properties
    • topN integer

      Number of chunks to return in results.

    • prompt string
      Required

      Query text or question to search.

    • documentId string

      Optional document ID to restrict search results to chunks from a single document.

    • searchMode string

      Search mode to use. Allowed values: SIMPLE and FULL. Default: SIMPLE.

      Can be one of: "SIMPLE""FULL"

Responses

200

Chunks retrieved successfully.

  • application/json object
    Show application/json properties
    • chunks array of objects
      Required

      Retrieved document chunks

      Show chunks properties
      • text string
        Required

        Text content of the chunk

      • chunkMeta object
        Required

        Metadata about the chunk

        Show chunkMeta properties
        • source string
          Required

          source of chunk

        • chunkId string
          Required

          chunkId

        • documentId string
          Required

          documentId of chunk

        • datasourceId string
          Required

          datasourceId of chunk

        • knowledgeBaseId string
          Required

          knowledgeBaseId of chunk

      • tfidfScore number

        Score from keyword search

      • searchSource string

        search method for the chunk, e.g. semantic search, keyword search or semantic and keyword search

      • semanticScore number

        Similarity score from embedding match

400

The request is in incorrect format

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string

        Custom error codes

        • AE-1 - Internal processing error
        • AE-2 - Incorrect request
        • AE-3 - Authentication issue
        • AE-4 - Prompt is rejected
        • AE-5 - Resource is not found
        • AE-6 - API usage rate limit is exceeded
        • AE-7 - Method is not allowed
      • title string
      • detail string
    • traceId string

403

The user does not have privileges to perform the requested action.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string

        Custom error codes

        • AE-1 - Internal processing error
        • AE-2 - Incorrect request
        • AE-3 - Authentication issue
        • AE-4 - Prompt is rejected
        • AE-5 - Resource is not found
        • AE-6 - API usage rate limit is exceeded
        • AE-7 - Method is not allowed
      • title string
      • detail string
    • traceId string

404

Assistant is not found.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string

        Custom error codes

        • AE-1 - Internal processing error
        • AE-2 - Incorrect request
        • AE-3 - Authentication issue
        • AE-4 - Prompt is rejected
        • AE-5 - Resource is not found
        • AE-6 - API usage rate limit is exceeded
        • AE-7 - Method is not allowed
      • title string
      • detail string
    • traceId string

405

Method is not allowed.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string

        Custom error codes

        • AE-1 - Internal processing error
        • AE-2 - Incorrect request
        • AE-3 - Authentication issue
        • AE-4 - Prompt is rejected
        • AE-5 - Resource is not found
        • AE-6 - API usage rate limit is exceeded
        • AE-7 - Method is not allowed
      • title string
      • detail string
    • traceId string

500

Prompt processing error.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string

        Custom error codes

        • AE-1 - Internal processing error
        • AE-2 - Incorrect request
        • AE-3 - Authentication issue
        • AE-4 - Prompt is rejected
        • AE-5 - Resource is not found
        • AE-6 - API usage rate limit is exceeded
        • AE-7 - Method is not allowed
      • title string
      • detail string
    • traceId string
POST /api/v1/assistants/{assistantId}/actions/search
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.assistants.searchAssistant(
'507f191e810c19729de860ea',
{
prompt: 'What is LLM?',
searchMode: 'SIMPLE',
topN: 20,
},
)
qlik assistant search '507f191e810c19729de860ea' \
--prompt 'What is LLM?'
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/assistants/{assistantId}/actions/search" \
-X POST \
-H "Content-type: application/json" \
-H "Authorization: Bearer <access_token>" \
-d '{"topN":20,"prompt":"What is LLM?","documentId":"3fa85f64-5717-4562-b3fc-2c963f66afa6","searchMode":"SIMPLE"}'

Example Response

{
"chunks": [
{
"text": "LLM stands for Large Language Model",
"chunkMeta": {
"source": "string",
"chunkId": "string",
"documentId": "string",
"datasourceId": "string",
"knowledgeBaseId": "string"
},
"tfidfScore": 0.9,
"searchSource": "string",
"semanticScore": 0.63
}
]
}

Get feedback

Retrieves feedback summary for the assistant.

Facts

Rate limit Tier 1 (1000 requests per minute)

Path Parameters

  • assistantId string
    Required

    The ID of the assistant from which to retrieve feedback summary.

Responses

200

Successfully retrieved the feedback summary for the assistant.

  • application/json object
    Show application/json properties
    • likes integer
      Required

      Amount of likes for a thread or an assistant.

    • other integer

      Count of answers which users disliked and gave "other" as reason.

    • reviews integer
      Required

      Amount of reviews for a thread or an assistant.

    • dislikes integer
      Required

      Amount of dislikes for a thread or an assistant.

    • unhelpful integer

      Count of answers which users marked as "unhelpful".

    • inaccurate integer

      Count of answers which users marked as "inaccurate".

    • irrelevant integer

      Count of answers which users marked as "irrelevant".

    • repetitive integer

      Count of answers which users marked as "repetitive".

    • unanswered integer

      Count of questions for which the assistant provided no answer.

    • interactions integer
      Required

      Amount of interactions for a thread or an assistant.

400

The request is in incorrect format.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

403

The operation failed due to insufficient permissions.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

404

The assistant was not found.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string
GET /api/v1/assistants/{assistantId}/feedback
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.assistants.getAssistantFeedback(
'507f191e810c19729de860ea',
)
qlik assistant feedback '507f191e810c19729de860ea'
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/assistants/{assistantId}/feedback" \
-H "Authorization: Bearer <access_token>"

Example Response

{
"likes": 42,
"other": 42,
"reviews": 42,
"dislikes": 42,
"unhelpful": 42,
"inaccurate": 42,
"irrelevant": 42,
"repetitive": 42,
"unanswered": 42,
"interactions": 42
}

Bulk search source chunks

Perform a bulk search for the plaintext of source chunks for the assistant.

Facts

Rate limit Tier 2 (100 requests per minute)

Path Parameters

  • assistantId string
    Required

    The ID of the assistant in which to search for source chunks.

Request Body

  • application/json object
    Show application/json properties
    • chunkIds array of strings
      Required

      Unique identifier of the Chunk.

Responses

202

Successfully retrieved plaintext of the chunks.

  • application/json object
    Show application/json properties
    • textByChunkId object

400

The request is in incorrect format.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

403

The user does not have privileges to perform the requested action.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

404

The resource was not found.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string
POST /api/v1/assistants/{assistantId}/sources/plaintexts
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.assistants.getAssistantSources(
'507f191e810c19729de860ea',
{
chunkIds: [
'c2ef42d9-7164-4fb0-bdbb-6534ae37263e',
'486ada2c-f895-4961-8ba5-7995f1026d26',
],
},
)
qlik assistant sources '507f191e810c19729de860ea' \
--chunkIds 'c2ef42d9-7164-4fb0-bdbb-6534ae37263e,486ada2c-f895-4961-8ba5-7995f1026d26'
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/assistants/{assistantId}/sources/plaintexts" \
-X POST \
-H "Content-type: application/json" \
-H "Authorization: Bearer <access_token>" \
-d '{"chunkIds":["c2ef42d9-7164-4fb0-bdbb-6534ae37263e","486ada2c-f895-4961-8ba5-7995f1026d26"]}'

Example Response

{
"textByChunkId": {
"chunk1_id": "chunk1_text",
"chunk2_id": "chunk2_text"
}
}

List starters

Retrieves the list of starters for the assistant.

Facts

Rate limit Tier 1 (1000 requests per minute)

Query Parameters

  • limit integer

    The number of starters to get.

  • next string

    Optional parameter to request the next page.

  • prev string

    Optional parameter to request the previous page.

  • sort string

    Optional resource field name to sort on, case insensitive, e.g. name. Can be prefixed with - to set descending order; defaults to ascending.

    Can be one of: "QUESTION""-QUESTION""CREATED""-CREATED""UPDATED""-UPDATED"

Path Parameters

  • assistantId string
    Required

    The ID of the assistant from which to retrieve starters.

Responses

200

Successfully retrieved the assistant's starters.

  • application/json object
    Show application/json properties
    • data array of objects
      Required
      Show data properties
      • id string
        Required

        Unique identifier of the starter.

      • question string
        Required

        Starter sample question.

      • createdAt string
        Required

        Datetime when the starter was created.

      • followups array of objects

        List of followups.

        Show followups properties
        • id string
          Required

          Unique identifier of the Followup.

        • question string
          Required

          Starter sample question.

        • additionalContext string
          Required

          Optional context collected from curated meant to be leveraged by LLM-based question recommendation system.

        • recommendedAnswer object
          Required
          Show recommendedAnswer properties
          • content string
            Required

            Starter answer content.

          • contentType string
            Required

            Answer type of content.

      • updatedAt string
        Required

        Datetime when the starter was updated.

      • additionalContext string
        Required

        Optional context collected from curated meant to be leveraged by LLM-based question recommendation system.

      • recommendedAnswer object
        Required
        Show recommendedAnswer properties
        • content string
          Required

          Starter answer content.

        • contentType string
          Required

          Answer type of content.

    • meta object
      Show meta properties
      • countTotal integer
    • links object
      Show links properties
      • next object
        Show next properties
        • href string
      • prev object
        Show prev properties
        • href string
      • self object
        Show self properties
        • href string

400

The request is in incorrect format.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

403

The operation failed due to insufficient permissions.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

404

The assistant was not found.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string
GET /api/v1/assistants/{assistantId}/starters
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.assistants.getAssistantStarters(
'507f191e810c19729de860ea',
{},
)
qlik assistant starter ls \
--assistantId '507f191e810c19729de860ea'
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/assistants/{assistantId}/starters" \
-H "Authorization: Bearer <access_token>"

Example Response

{
"data": [
{
"id": "507f191e810c19729de860ea",
"question": "Where was Genghis Khan buried?",
"createdAt": "2021-10-02T14:20:50.52Z",
"followups": [
{
"id": "507f191e810c19729de860ea",
"question": "Where was Genghis Khan buried?",
"additionalContext": "string",
"recommendedAnswer": {
"content": "string",
"contentType": "text | markdown | html"
}
}
],
"updatedAt": "2021-10-02T14:20:50.52Z",
"additionalContext": "string",
"recommendedAnswer": {
"content": "string",
"contentType": "text | markdown | html"
}
}
],
"meta": {
"countTotal": 42
},
"links": {
"next": {
"href": "string"
},
"prev": {
"href": "string"
},
"self": {
"href": "string"
}
}
}

Create a starter

Creates a new starter for the assistant.

Facts

Rate limit Tier 2 (100 requests per minute)

Path Parameters

  • assistantId string
    Required

    The ID of the assistant in which to create the starter.

Request Body

  • application/json object
    Show application/json properties
    • question string
      Required

      Starter sample question.

    • followups array of objects

      List of followups.

      Show followups properties
      • id string
        Required

        Unique identifier of the Followup.

      • question string
        Required

        Starter sample question.

      • additionalContext string
        Required

        Optional context collected from curated meant to be leveraged by LLM-based question recommendation system.

      • recommendedAnswer object
        Required
        Show recommendedAnswer properties
        • content string
          Required

          Starter answer content.

        • contentType string
          Required

          Answer type of content.

    • additionalContext string

      Optional context collected from curated meant to be leveraged by LLM-based question recommendation system.

    • recommendedAnswer object
      Show recommendedAnswer properties
      • content string
        Required

        Starter answer content.

      • contentType string
        Required

        Answer type of content.

Responses

201

Successfully created a new assistant starter.

  • application/json object
    Show application/json properties
    • id string
      Required

      Unique identifier of the starter.

    • question string
      Required

      Starter sample question.

    • createdAt string
      Required

      Datetime when the starter was created.

    • followups array of objects

      List of followups.

      Show followups properties
      • id string
        Required

        Unique identifier of the Followup.

      • question string
        Required

        Starter sample question.

      • additionalContext string
        Required

        Optional context collected from curated meant to be leveraged by LLM-based question recommendation system.

      • recommendedAnswer object
        Required
        Show recommendedAnswer properties
        • content string
          Required

          Starter answer content.

        • contentType string
          Required

          Answer type of content.

    • updatedAt string
      Required

      Datetime when the starter was updated.

    • additionalContext string
      Required

      Optional context collected from curated meant to be leveraged by LLM-based question recommendation system.

    • recommendedAnswer object
      Required
      Show recommendedAnswer properties
      • content string
        Required

        Starter answer content.

      • contentType string
        Required

        Answer type of content.

400

The request is in incorrect format or starter limit exceeded.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

403

The user does not have privileges to perform the requested action.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

404

The assistant was not found.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string
POST /api/v1/assistants/{assistantId}/starters
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.assistants.createAssistantStarter(
'507f191e810c19729de860ea',
{
additionalContext: 'string',
followups: [
{
additionalContext: 'string',
id: '507f191e810c19729de860ea',
question:
'Where was Genghis Khan buried?',
recommendedAnswer: {
content: 'string',
contentType: 'text | markdown | html',
},
},
],
question: 'Where was Genghis Khan buried?',
recommendedAnswer: {
content: 'string',
contentType: 'text | markdown | html',
},
},
)
qlik assistant starter create \
--assistantId '507f191e810c19729de860ea' \
--followups-additionalContext '' \
--followups-id '' \
--followups-question '' \
--followups-recommendedAnswer-content '' \
--followups-recommendedAnswer-contentType '' \
--question 'Where was Genghis Khan buried?' \
--recommendedAnswer-content 'string' \
--recommendedAnswer-contentType 'text | markdown | html'
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/assistants/{assistantId}/starters" \
-X POST \
-H "Content-type: application/json" \
-H "Authorization: Bearer <access_token>" \
-d '{"question":"Where was Genghis Khan buried?","followups":[{"id":"507f191e810c19729de860ea","question":"Where was Genghis Khan buried?","additionalContext":"string","recommendedAnswer":{"content":"string","contentType":"text | markdown | html"}}],"additionalContext":"string","recommendedAnswer":{"content":"string","contentType":"text | markdown | html"}}'

Example Response

{
"id": "507f191e810c19729de860ea",
"question": "Where was Genghis Khan buried?",
"createdAt": "2021-10-02T14:20:50.52Z",
"followups": [
{
"id": "507f191e810c19729de860ea",
"question": "Where was Genghis Khan buried?",
"additionalContext": "string",
"recommendedAnswer": {
"content": "string",
"contentType": "text | markdown | html"
}
}
],
"updatedAt": "2021-10-02T14:20:50.52Z",
"additionalContext": "string",
"recommendedAnswer": {
"content": "string",
"contentType": "text | markdown | html"
}
}

Get a starter

Retrieves the specified starter.

Facts

Rate limit Tier 1 (1000 requests per minute)

Path Parameters

  • assistantId string
    Required

    The ID of the assistant containing the requested starter.

  • starterId string
    Required

    The ID of the starter to retrieve.

Responses

200

Successfully retrieved the starter.

  • application/json object
    Show application/json properties
    • id string
      Required

      Unique identifier of the starter.

    • question string
      Required

      Starter sample question.

    • createdAt string
      Required

      Datetime when the starter was created.

    • followups array of objects

      List of followups.

      Show followups properties
      • id string
        Required

        Unique identifier of the Followup.

      • question string
        Required

        Starter sample question.

      • additionalContext string
        Required

        Optional context collected from curated meant to be leveraged by LLM-based question recommendation system.

      • recommendedAnswer object
        Required
        Show recommendedAnswer properties
        • content string
          Required

          Starter answer content.

        • contentType string
          Required

          Answer type of content.

    • updatedAt string
      Required

      Datetime when the starter was updated.

    • additionalContext string
      Required

      Optional context collected from curated meant to be leveraged by LLM-based question recommendation system.

    • recommendedAnswer object
      Required
      Show recommendedAnswer properties
      • content string
        Required

        Starter answer content.

      • contentType string
        Required

        Answer type of content.

400

The request is in incorrect format.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

403

The operation failed due to insufficient permissions.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

404

The starter was not found.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string
GET /api/v1/assistants/{assistantId}/starters/{starterId}
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.assistants.getAssistantStarter(
'507f191e810c19729de860ea',
'507f191e810c19729de860ea',
)
qlik assistant starter get '507f191e810c19729de860ea' \
--assistantId '507f191e810c19729de860ea'
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/assistants/{assistantId}/starters/{starterId}" \
-H "Authorization: Bearer <access_token>"

Example Response

{
"id": "507f191e810c19729de860ea",
"question": "Where was Genghis Khan buried?",
"createdAt": "2021-10-02T14:20:50.52Z",
"followups": [
{
"id": "507f191e810c19729de860ea",
"question": "Where was Genghis Khan buried?",
"additionalContext": "string",
"recommendedAnswer": {
"content": "string",
"contentType": "text | markdown | html"
}
}
],
"updatedAt": "2021-10-02T14:20:50.52Z",
"additionalContext": "string",
"recommendedAnswer": {
"content": "string",
"contentType": "text | markdown | html"
}
}

Update a starter

Updates the specified starter.

Facts

Rate limit Tier 2 (100 requests per minute)

Path Parameters

  • assistantId string
    Required

    The ID of the assistant containing the requested starter.

  • starterId string
    Required

    The ID of the starter to retrieve.

Request Body

  • application/json object
    Show application/json properties
    • id string
      Required

      Unique identifier of the starter.

    • question string
      Required

      Starter sample question.

    • followups array of objects

      List of followups.

      Show followups properties
      • id string
        Required

        Unique identifier of the Followup.

      • question string
        Required

        Starter sample question.

      • additionalContext string
        Required

        Optional context collected from curated meant to be leveraged by LLM-based question recommendation system.

      • recommendedAnswer object
        Required
        Show recommendedAnswer properties
        • content string
          Required

          Starter answer content.

        • contentType string
          Required

          Answer type of content.

    • additionalContext string
      Required

      Optional context collected from curated meant to be leveraged by LLM-based question recommendation system.

    • recommendedAnswer object
      Required
      Show recommendedAnswer properties
      • content string
        Required

        Starter answer content.

      • contentType string
        Required

        Answer type of content.

Responses

200

Successfully updated the starter.

  • application/json object
    Show application/json properties
    • id string
      Required

      Unique identifier of the starter.

    • question string
      Required

      Starter sample question.

    • createdAt string
      Required

      Datetime when the starter was created.

    • followups array of objects

      List of followups.

      Show followups properties
      • id string
        Required

        Unique identifier of the Followup.

      • question string
        Required

        Starter sample question.

      • additionalContext string
        Required

        Optional context collected from curated meant to be leveraged by LLM-based question recommendation system.

      • recommendedAnswer object
        Required
        Show recommendedAnswer properties
        • content string
          Required

          Starter answer content.

        • contentType string
          Required

          Answer type of content.

    • updatedAt string
      Required

      Datetime when the starter was updated.

    • additionalContext string
      Required

      Optional context collected from curated meant to be leveraged by LLM-based question recommendation system.

    • recommendedAnswer object
      Required
      Show recommendedAnswer properties
      • content string
        Required

        Starter answer content.

      • contentType string
        Required

        Answer type of content.

400

The request is in incorrect format.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

403

The operation failed due to insufficient permissions.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

404

The record was not found.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string
PUT /api/v1/assistants/{assistantId}/starters/{starterId}
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.assistants.updateAssistantStarter(
'507f191e810c19729de860ea',
'507f191e810c19729de860ea',
{
additionalContext: 'string',
followups: [
{
additionalContext: 'string',
id: '507f191e810c19729de860ea',
question:
'Where was Genghis Khan buried?',
recommendedAnswer: {
content: 'string',
contentType: 'text | markdown | html',
},
},
],
id: '507f191e810c19729de860ea',
question: 'Where was Genghis Khan buried?',
recommendedAnswer: {
content: 'string',
contentType: 'text | markdown | html',
},
},
)
qlik assistant starter update '507f191e810c19729de860ea' \
--assistantId '507f191e810c19729de860ea' \
--additionalContext 'string' \
--followups-additionalContext '' \
--followups-id '' \
--followups-question '' \
--followups-recommendedAnswer-content '' \
--followups-recommendedAnswer-contentType '' \
--id '507f191e810c19729de860ea' \
--question 'Where was Genghis Khan buried?' \
--recommendedAnswer-content 'string' \
--recommendedAnswer-contentType 'text | markdown | html'
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/assistants/{assistantId}/starters/{starterId}" \
-X PUT \
-H "Content-type: application/json" \
-H "Authorization: Bearer <access_token>" \
-d '{"id":"507f191e810c19729de860ea","question":"Where was Genghis Khan buried?","followups":[{"id":"507f191e810c19729de860ea","question":"Where was Genghis Khan buried?","additionalContext":"string","recommendedAnswer":{"content":"string","contentType":"text | markdown | html"}}],"additionalContext":"string","recommendedAnswer":{"content":"string","contentType":"text | markdown | html"}}'

Example Response

{
"id": "507f191e810c19729de860ea",
"question": "Where was Genghis Khan buried?",
"createdAt": "2021-10-02T14:20:50.52Z",
"followups": [
{
"id": "507f191e810c19729de860ea",
"question": "Where was Genghis Khan buried?",
"additionalContext": "string",
"recommendedAnswer": {
"content": "string",
"contentType": "text | markdown | html"
}
}
],
"updatedAt": "2021-10-02T14:20:50.52Z",
"additionalContext": "string",
"recommendedAnswer": {
"content": "string",
"contentType": "text | markdown | html"
}
}

Delete a starter

Deletes the starter and all of its resources.

Facts

Rate limit Tier 2 (100 requests per minute)

Path Parameters

  • assistantId string
    Required

    The ID of the assistant containing the requested starter.

  • starterId string
    Required

    The ID of the starter to delete.

Responses

204

Successful operation.

400

The request is in incorrect format.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

403

The operation failed due to insufficient permissions.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

404

The assistant was not found.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string
DELETE /api/v1/assistants/{assistantId}/starters/{starterId}
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.assistants.deleteAssistantStarter(
'507f191e810c19729de860ea',
'507f191e810c19729de860ea',
)
qlik assistant starter rm '507f191e810c19729de860ea' \
--assistantId '507f191e810c19729de860ea'
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/assistants/{assistantId}/starters/{starterId}" \
-X DELETE \
-H "Authorization: Bearer <access_token>"

Update a Followup

Updates the specified Followup.

Facts

Rate limit Tier 2 (100 requests per minute)

Path Parameters

  • assistantId string
    Required

    The ID of the assistant containing the requested Followup.

  • followupId string
    Required

    The ID of the Followup to update.

  • starterId string
    Required

    The ID of the starter containing the requested Followup.

Request Body

  • application/json object
    Show application/json properties
    • id string
      Required

      Unique identifier of the Followup.

    • question string
      Required

      Starter sample question.

    • additionalContext string
      Required

      Optional context collected from curated meant to be leveraged by LLM-based question recommendation system.

    • recommendedAnswer object
      Required
      Show recommendedAnswer properties
      • content string
        Required

        Starter answer content.

      • contentType string
        Required

        Answer type of content.

Responses

200

Successfully updated the Followup.

  • application/json object
    Show application/json properties
    • id string
      Required

      Unique identifier of the starter.

    • question string
      Required

      Starter sample question.

    • createdAt string
      Required

      Datetime when the starter was created.

    • followups array of objects

      List of followups.

      Show followups properties
      • id string
        Required

        Unique identifier of the Followup.

      • question string
        Required

        Starter sample question.

      • additionalContext string
        Required

        Optional context collected from curated meant to be leveraged by LLM-based question recommendation system.

      • recommendedAnswer object
        Required
        Show recommendedAnswer properties
        • content string
          Required

          Starter answer content.

        • contentType string
          Required

          Answer type of content.

    • updatedAt string
      Required

      Datetime when the starter was updated.

    • additionalContext string
      Required

      Optional context collected from curated meant to be leveraged by LLM-based question recommendation system.

    • recommendedAnswer object
      Required
      Show recommendedAnswer properties
      • content string
        Required

        Starter answer content.

      • contentType string
        Required

        Answer type of content.

400

The request is in incorrect format.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

403

The operation failed due to insufficient permissions.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

404

The record was not found.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string
PUT /api/v1/assistants/{assistantId}/starters/{starterId}/followups/{followupId}
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.assistants.updateAssistantStarterFollowup(
'507f191e810c19729de860ea',
'507f191e810c19729de860ea',
'507f191e810c19729de860ea',
{
additionalContext: 'string',
id: '507f191e810c19729de860ea',
question: 'Where was Genghis Khan buried?',
recommendedAnswer: {
content: 'string',
contentType: 'text | markdown | html',
},
},
)
qlik assistant starter followup update '507f191e810c19729de860ea' \
--assistantId '507f191e810c19729de860ea' \
--starterId '507f191e810c19729de860ea' \
--additionalContext 'string' \
--id '507f191e810c19729de860ea' \
--question 'Where was Genghis Khan buried?' \
--recommendedAnswer-content 'string' \
--recommendedAnswer-contentType 'text | markdown | html'
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/assistants/{assistantId}/starters/{starterId}/followups/{followupId}" \
-X PUT \
-H "Content-type: application/json" \
-H "Authorization: Bearer <access_token>" \
-d '{"id":"507f191e810c19729de860ea","question":"Where was Genghis Khan buried?","additionalContext":"string","recommendedAnswer":{"content":"string","contentType":"text | markdown | html"}}'

Example Response

{
"id": "507f191e810c19729de860ea",
"question": "Where was Genghis Khan buried?",
"createdAt": "2021-10-02T14:20:50.52Z",
"followups": [
{
"id": "507f191e810c19729de860ea",
"question": "Where was Genghis Khan buried?",
"additionalContext": "string",
"recommendedAnswer": {
"content": "string",
"contentType": "text | markdown | html"
}
}
],
"updatedAt": "2021-10-02T14:20:50.52Z",
"additionalContext": "string",
"recommendedAnswer": {
"content": "string",
"contentType": "text | markdown | html"
}
}

Delete a Followup

Deletes the specified Followup.

Facts

Rate limit Tier 2 (100 requests per minute)

Path Parameters

  • assistantId string
    Required

    The ID of the assistant containing the requested Followup.

  • followupId string
    Required

    The ID of the Followup to delete.

  • starterId string
    Required

    The ID of the starter containing the requested Followup.

Responses

204

Successful operation.

400

The request is in incorrect format.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

403

The operation failed due to insufficient permissions.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

404

The Followup was not found.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string
DELETE /api/v1/assistants/{assistantId}/starters/{starterId}/followups/{followupId}
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.assistants.deleteAssistantStarterFollowup(
'507f191e810c19729de860ea',
'507f191e810c19729de860ea',
'507f191e810c19729de860ea',
)
qlik assistant starter followup rm '507f191e810c19729de860ea' \
--assistantId '507f191e810c19729de860ea' \
--starterId '507f191e810c19729de860ea'
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/assistants/{assistantId}/starters/{starterId}/followups/{followupId}" \
-X DELETE \
-H "Authorization: Bearer <access_token>"

List threads

Retrieves the list of threads for the assistant.

Facts

Rate limit Tier 1 (1000 requests per minute)

Query Parameters

  • filter string

    Optional parameter to filter threads.

  • limit integer

    The number of assistants to get.

  • next string

    Optional parameter to request the next page.

  • prev string

    Optional parameter to request the previous page.

  • sort string

    Optional resource field name to sort on, case insensitive, e.g. name. Can be prefixed with - to set descending order; defaults to ascending.

    Can be one of: "NAME""-NAME""CREATED""-CREATED""UPDATED""-UPDATED"

Path Parameters

  • assistantId string
    Required

    The ID of the assistant from which to retrieve threads.

Responses

200

Successfully retrieved the threads for the assistant.

  • application/json object
    Show application/json properties
    • data array of objects
      Required
      Show data properties
      • id string
        Required

        Unique identifier of the thread.

      • name string
        Required

        The name of the thread.

      • ownerId string
        Required
      • favorite boolean
        Required

        If thread is marked as favorite.

      • createdAt string
        Required

        Datetime when the thread was created.

      • deletedAt string

        Datetime when the thread was deleted.

      • updatedAt string
        Required

        Datetime when the thread was updated.

      • hasFeedback boolean
        Required

        If feedback was provided for a thread interaction.

      • summaryStats object
        Required
        Show summaryStats properties
        • likes integer
          Required

          Amount of likes for a thread or an assistant.

        • other integer

          Count of answers which users disliked and gave "other" as reason.

        • reviews integer
          Required

          Amount of reviews for a thread or an assistant.

        • dislikes integer
          Required

          Amount of dislikes for a thread or an assistant.

        • unhelpful integer

          Count of answers which users marked as "unhelpful".

        • inaccurate integer

          Count of answers which users marked as "inaccurate".

        • irrelevant integer

          Count of answers which users marked as "irrelevant".

        • repetitive integer

          Count of answers which users marked as "repetitive".

        • unanswered integer

          Count of questions for which the assistant provided no answer.

        • interactions integer
          Required

          Amount of interactions for a thread or an assistant.

      • useUserPreferredLanguage boolean
        Required

        If the thread should respond in the user's preferred language.

    • meta object
      Show meta properties
      • countTotal integer
    • links object
      Show links properties
      • next object
        Show next properties
        • href string
      • prev object
        Show prev properties
        • href string
      • self object
        Show self properties
        • href string

400

The request is in incorrect format.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

403

The operation failed due to insufficient permissions.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

404

The assistant was not found.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string
GET /api/v1/assistants/{assistantId}/threads
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.assistants.getAssistantThreads(
'507f191e810c19729de860ea',
{},
)
qlik assistant thread ls \
--assistantId '507f191e810c19729de860ea'
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/assistants/{assistantId}/threads" \
-H "Authorization: Bearer <access_token>"

Example Response

{
"data": [
{
"id": "507f191e810c19729de860ea",
"name": "Initial conversation",
"ownerId": "10d347c4-f28a-4faf-93f0-48e781aaf303",
"favorite": false,
"createdAt": "2021-10-02T14:20:50.52Z",
"deletedAt": "2021-10-02T14:20:50.52Z",
"updatedAt": "2021-10-02T14:20:50.52Z",
"hasFeedback": false,
"summaryStats": {
"likes": 42,
"other": 42,
"reviews": 42,
"dislikes": 42,
"unhelpful": 42,
"inaccurate": 42,
"irrelevant": 42,
"repetitive": 42,
"unanswered": 42,
"interactions": 42
},
"useUserPreferredLanguage": false
}
],
"meta": {
"countTotal": 42
},
"links": {
"next": {
"href": "string"
},
"prev": {
"href": "string"
},
"self": {
"href": "string"
}
}
}

Create a thread

Creates a new thread for the assistant.

Facts

Rate limit Tier 2 (100 requests per minute)

Path Parameters

  • assistantId string
    Required

    The ID of the assistant in which to create the thread.

Request Body

  • application/json object
    Show application/json properties
    • name string
      Required

      The name of the thread.

    • useUserPreferredLanguage boolean

      Whether the thread should use the user's preferred language.

Responses

201

Successfully created a new assistant thread.

  • application/json object
    Show application/json properties
    • id string
      Required

      Unique identifier of the thread.

    • name string
      Required

      The name of the thread.

    • ownerId string
      Required
    • favorite boolean
      Required

      If thread is marked as favorite.

    • createdAt string
      Required

      Datetime when the thread was created.

    • deletedAt string

      Datetime when the thread was deleted.

    • updatedAt string
      Required

      Datetime when the thread was updated.

    • hasFeedback boolean
      Required

      If feedback was provided for a thread interaction.

    • summaryStats object
      Required
      Show summaryStats properties
      • likes integer
        Required

        Amount of likes for a thread or an assistant.

      • other integer

        Count of answers which users disliked and gave "other" as reason.

      • reviews integer
        Required

        Amount of reviews for a thread or an assistant.

      • dislikes integer
        Required

        Amount of dislikes for a thread or an assistant.

      • unhelpful integer

        Count of answers which users marked as "unhelpful".

      • inaccurate integer

        Count of answers which users marked as "inaccurate".

      • irrelevant integer

        Count of answers which users marked as "irrelevant".

      • repetitive integer

        Count of answers which users marked as "repetitive".

      • unanswered integer

        Count of questions for which the assistant provided no answer.

      • interactions integer
        Required

        Amount of interactions for a thread or an assistant.

    • useUserPreferredLanguage boolean
      Required

      If the thread should respond in the user's preferred language.

400

The request is in incorrect format.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

403

The user does not have privileges to perform the requested action.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

404

The assistant was not found.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string
POST /api/v1/assistants/{assistantId}/threads
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.assistants.createAssistantThread(
'507f191e810c19729de860ea',
{ name: 'Initial conversation' },
)
qlik assistant thread create \
--assistantId '507f191e810c19729de860ea' \
--name 'Initial conversation'
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/assistants/{assistantId}/threads" \
-X POST \
-H "Content-type: application/json" \
-H "Authorization: Bearer <access_token>" \
-d '{"name":"Initial conversation","useUserPreferredLanguage":false}'

Example Response

{
"id": "507f191e810c19729de860ea",
"name": "Initial conversation",
"ownerId": "10d347c4-f28a-4faf-93f0-48e781aaf303",
"favorite": false,
"createdAt": "2021-10-02T14:20:50.52Z",
"deletedAt": "2021-10-02T14:20:50.52Z",
"updatedAt": "2021-10-02T14:20:50.52Z",
"hasFeedback": false,
"summaryStats": {
"likes": 42,
"other": 42,
"reviews": 42,
"dislikes": 42,
"unhelpful": 42,
"inaccurate": 42,
"irrelevant": 42,
"repetitive": 42,
"unanswered": 42,
"interactions": 42
},
"useUserPreferredLanguage": false
}

Get a thread

Retrieves a thread for the assistant.

Facts

Rate limit Tier 1 (1000 requests per minute)

Path Parameters

  • assistantid string
    Required

    The ID of the assistant containing the requested thread.

  • threadid string
    Required

    The ID of the thread to retrieve.

Responses

200

Successfully retrieved the thread.

  • application/json object
    Show application/json properties
    • id string
      Required

      Unique identifier of the thread.

    • name string
      Required

      The name of the thread.

    • ownerId string
      Required

      Unique identifier of the thread owner.

    • favorite boolean
      Required

      If thread is marked as favorite.

    • messages array of objects
      Required
      Show messages properties
      • id string
        Required
      • role string
        Required

        human or ai role.

      • content string
        Required

        Message content.

      • sources array of objects
        Required

        List of sources used to generate AI messages (interactions).

        Show sources properties
        • chunks array of objects
          Required

          List of Chunks used for "AI" generated messages.

          Show chunks properties
          • text string

            Chunk text for "AI" generated message source.

          • chunkId string
            Required

            Chunk unique identifier for "AI" generated message source.

        • source string
          Required

          Path to the document used.

        • documentId string
          Required

          Reference to Document used for "AI" generated messages.

        • datasourceId string
          Required

          Reference to DataSource used for "AI" generated messages.

        • lastIndexedAt string

          Datetime when the knowledgebase was last indexed.

        • knowledgebaseId string
          Required

          Reference to KnowledgeBase used for "AI" generated messages.

      • createdAt string
        Required

        Datetime when the interaction was created.

    • createdAt string
      Required

      Datetime when the thread was created.

    • deletedAt string

      Datetime when the thread was deleted.

    • updatedAt string
      Required

      Datetime when the thread was updated.

    • hasFeedback boolean
      Required

      If feedback was provided for a thread interaction.

    • summaryStats object
      Required
      Show summaryStats properties
      • likes integer
        Required

        Amount of likes for a thread or an assistant.

      • other integer

        Count of answers which users disliked and gave "other" as reason.

      • reviews integer
        Required

        Amount of reviews for a thread or an assistant.

      • dislikes integer
        Required

        Amount of dislikes for a thread or an assistant.

      • unhelpful integer

        Count of answers which users marked as "unhelpful".

      • inaccurate integer

        Count of answers which users marked as "inaccurate".

      • irrelevant integer

        Count of answers which users marked as "irrelevant".

      • repetitive integer

        Count of answers which users marked as "repetitive".

      • unanswered integer

        Count of questions for which the assistant provided no answer.

      • interactions integer
        Required

        Amount of interactions for a thread or an assistant.

    • useUserPreferredLanguage boolean
      Required

      If the thread should respond in the user's preferred language.

400

The request is in incorrect format.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

403

The operation failed due to insufficient permissions.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

404

The thread was not found.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string
GET /api/v1/assistants/{assistantid}/threads/{threadid}
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.assistants.getAssistantThread(
'507f191e810c19729de860ea',
'507f191e810c19729de860ea',
)
qlik assistant thread get '507f191e810c19729de860ea' \
--assistantId '507f191e810c19729de860ea'
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/assistants/{assistantid}/threads/{threadid}" \
-H "Authorization: Bearer <access_token>"

Example Response

{
"id": "507f191e810c19729de860ea",
"name": "Initial conversation",
"ownerId": "507f191e810c19729de860ea",
"favorite": false,
"messages": [
{
"id": "10d347c4-f28a-4faf-93f0-48e781aaf303",
"role": "ai",
"content": "Somewhere in an unmarked grave",
"sources": [
{
"chunks": [
{
"text": "string",
"chunkId": "10d347c4-f28a-4faf-93f0-48e781aaf303"
}
],
"source": "Reference.md",
"documentId": "10d347c4-f28a-4faf-93f0-48e781aaf303",
"datasourceId": "10d347c4-f28a-4faf-93f0-48e781aaf303",
"lastIndexedAt": "2021-10-02T14:20:50.52Z",
"knowledgebaseId": "10d347c4-f28a-4faf-93f0-48e781aaf303"
}
],
"createdAt": "2021-10-02T14:20:50.52Z"
}
],
"createdAt": "2021-10-02T14:20:50.52Z",
"deletedAt": "2021-10-02T14:20:50.52Z",
"updatedAt": "2021-10-02T14:20:50.52Z",
"hasFeedback": false,
"summaryStats": {
"likes": 42,
"other": 42,
"reviews": 42,
"dislikes": 42,
"unhelpful": 42,
"inaccurate": 42,
"irrelevant": 42,
"repetitive": 42,
"unanswered": 42,
"interactions": 42
},
"useUserPreferredLanguage": false
}

Update thread properties

Updates the properties of an existing thread with JSON Patch-formatted data.

Facts

Rate limit Tier 2 (100 requests per minute)

Path Parameters

  • assistantid string
    Required

    The ID of the assistant containing the requested thread.

  • threadid string
    Required

    The ID of the thread to retrieve.

Request Body

Required
  • application/json array of objects

    An array of JSON Patch documents.

    Show application/json properties
    • op string
      Required

      The operation to be performed.

      Can be one of: "replace""add"

    • path string
      Required

      A JSON Pointer.

    • value string|number|boolean
      Required

      The value to be used for this operation.

      One of:
      • string
      • number
      • boolean

Responses

204

Thread updated successfully.

400

Bad request. Payload could not be parsed to a JSON Patch or Patch operations are invalid.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

401

Not authorized.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

403

The operation failed due to insufficient permissions.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

404

The term to patch was not found.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

429

The request has been rate-limited.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string
PATCH /api/v1/assistants/{assistantid}/threads/{threadid}
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.assistants.patchAssistantThread(
'507f191e810c19729de860ea',
'507f191e810c19729de860ea',
[
{
op: 'replace',
path: '/name',
value: 'new name',
},
],
)
qlik assistant thread patch '507f191e810c19729de860ea' \
--assistantId '507f191e810c19729de860ea' \
--op 'replace' \
--path '/name' \
--value new name
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/assistants/{assistantid}/threads/{threadid}" \
-X PATCH \
-H "Content-type: application/json" \
-H "Authorization: Bearer <access_token>" \
-d '[{"op":"replace","path":"/name","value":"new name"}]'

Delete a thread

Deletes the specified thread and all of its resources.

Facts

Rate limit Tier 2 (100 requests per minute)

Path Parameters

  • assistantid string
    Required

    The ID of the assistant containing the requested thread.

  • threadid string
    Required

    The ID of the thread to retrieve.

Responses

204

Successful operation.

400

The request is in incorrect format.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

403

The operation failed due to insufficient permissions.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

404

The assistant was not found.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string
DELETE /api/v1/assistants/{assistantid}/threads/{threadid}
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.assistants.deleteAssistantThread(
'507f191e810c19729de860ea',
'507f191e810c19729de860ea',
)
qlik assistant thread rm '507f191e810c19729de860ea' \
--assistantId '507f191e810c19729de860ea'
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/assistants/{assistantid}/threads/{threadid}" \
-X DELETE \
-H "Authorization: Bearer <access_token>"

Execute synchronous prompt

Execute prompt in synchronous non-streaming mode.

Facts

Rate limit Tier 2 (100 requests per minute)

Path Parameters

  • assistantId string
    Required

    The ID of the Assistant containing requested Thread

  • threadId string
    Required

    The ID of the Thread to retrieve

Request Body

  • application/json object
    Show application/json properties
    • input object
      Show input properties
      • prompt string

        Input prompt string for the Assistant to respond to.

      • promptType string

        Sets the prompt type to thread.

        Can be one of: "thread"

      • includeText boolean

        Returns text from chunks in sources output. Default value is false.

Responses

200

Prompt is successfully executed.

  • application/json object
    Show application/json properties
    • output string

      Assistant's response to the prompt

    • sources array of objects

      List of sources used to generate AI messages

      Show sources properties
      • chunks array of objects

        List of Chunks used for "AI" generated messages

      • source string

        path to the document used

      • documentId string

        reference to Document used for "AI" generated messages

      • datasourceId string

        reference to DataSource used for "AI" generated messages

      • knowledgebaseId string

        reference to KnowledgeBase used for "AI" generated messages

    • question string

      Question asked by the user for assistant to answer

400

The request is in incorrect format

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string

        Custom error codes

        • AE-1 - Internal processing error
        • AE-2 - Incorrect request
        • AE-3 - Authentication issue
        • AE-4 - Prompt is rejected
        • AE-5 - Resource is not found
        • AE-6 - API usage rate limit is exceeded
        • AE-7 - Method is not allowed
      • title string
      • detail string
    • traceId string

403

The user does not have privileges to perform the requested action.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string

        Custom error codes

        • AE-1 - Internal processing error
        • AE-2 - Incorrect request
        • AE-3 - Authentication issue
        • AE-4 - Prompt is rejected
        • AE-5 - Resource is not found
        • AE-6 - API usage rate limit is exceeded
        • AE-7 - Method is not allowed
      • title string
      • detail string
    • traceId string

404

Assistant is not found.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string

        Custom error codes

        • AE-1 - Internal processing error
        • AE-2 - Incorrect request
        • AE-3 - Authentication issue
        • AE-4 - Prompt is rejected
        • AE-5 - Resource is not found
        • AE-6 - API usage rate limit is exceeded
        • AE-7 - Method is not allowed
      • title string
      • detail string
    • traceId string

500

Prompt processing error.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string

        Custom error codes

        • AE-1 - Internal processing error
        • AE-2 - Incorrect request
        • AE-3 - Authentication issue
        • AE-4 - Prompt is rejected
        • AE-5 - Resource is not found
        • AE-6 - API usage rate limit is exceeded
        • AE-7 - Method is not allowed
      • title string
      • detail string
    • traceId string
POST /api/v1/assistants/{assistantId}/threads/{threadId}/actions/invoke
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.assistants.invokeAssistantThread(
'507f191e810c19729de860ea',
'507f191e810c19729de860ea',
{
input: {
includeText: true,
prompt: 'What is a LLM?',
promptType: 'thread',
},
},
)
qlik assistant thread invoke \
--assistantId '507f191e810c19729de860ea' \
--threadId '507f191e810c19729de860ea'
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/assistants/{assistantId}/threads/{threadId}/actions/invoke" \
-X POST \
-H "Content-type: application/json" \
-H "Authorization: Bearer <access_token>" \
-d '{"input":{"prompt":"What is a LLM?","promptType":"thread","includeText":true}}'

Example Response

{
"output": "LLM stands for Large Language Model",
"sources": [
{
"chunks": [
{
"text": "LLM stands for Large Language Model",
"chunkId": "10d347c4-f28a-4faf-93f0-48e781aaf303"
}
],
"source": "Reference.md",
"documentId": "10d347c4-f28a-4faf-93f0-48e781aaf303",
"datasourceId": "10d347c4-f28a-4faf-93f0-48e781aaf303",
"knowledgebaseId": "10d347c4-f28a-4faf-93f0-48e781aaf303"
}
],
"question": "What was the primary goal of the Apollo program?"
}

Execute asynchronous prompt

Execute prompt in asynchronous streaming mode.

Facts

Rate limit Tier 2 (100 requests per minute)

Path Parameters

  • assistantId string
    Required

    The ID of the Assistant containing requested Thread

  • threadId string
    Required

    The ID of the Thread to retrieve

Request Body

  • application/json object
    Show application/json properties
    • input object
      Show input properties
      • prompt string

        Input prompt string for the Assistant to respond to.

      • promptType string

        Sets the prompt type to thread.

        Can be one of: "thread"

      • includeText boolean

        Returns text from chunks in sources output. Default value is false.

Responses

200

Prompt is successfully executed.

  • application/json object
    Show application/json properties
    • output string

      Assistant's response to the prompt

    • sources array of objects

      List of sources used to generate AI messages

      Show sources properties
      • chunks array of objects

        List of Chunks used for "AI" generated messages

      • source string

        path to the document used

      • documentId string

        reference to Document used for "AI" generated messages

      • datasourceId string

        reference to DataSource used for "AI" generated messages

      • knowledgebaseId string

        reference to KnowledgeBase used for "AI" generated messages

400

The request is in incorrect format

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string

        Custom error codes

        • AE-1 - Internal processing error
        • AE-2 - Incorrect request
        • AE-3 - Authentication issue
        • AE-4 - Prompt is rejected
        • AE-5 - Resource is not found
        • AE-6 - API usage rate limit is exceeded
        • AE-7 - Method is not allowed
      • title string
      • detail string
    • traceId string

403

The user does not have privileges to perform the requested action.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string

        Custom error codes

        • AE-1 - Internal processing error
        • AE-2 - Incorrect request
        • AE-3 - Authentication issue
        • AE-4 - Prompt is rejected
        • AE-5 - Resource is not found
        • AE-6 - API usage rate limit is exceeded
        • AE-7 - Method is not allowed
      • title string
      • detail string
    • traceId string

404

Method is not allowed.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string

        Custom error codes

        • AE-1 - Internal processing error
        • AE-2 - Incorrect request
        • AE-3 - Authentication issue
        • AE-4 - Prompt is rejected
        • AE-5 - Resource is not found
        • AE-6 - API usage rate limit is exceeded
        • AE-7 - Method is not allowed
      • title string
      • detail string
    • traceId string

405

Assistant is not found.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string

        Custom error codes

        • AE-1 - Internal processing error
        • AE-2 - Incorrect request
        • AE-3 - Authentication issue
        • AE-4 - Prompt is rejected
        • AE-5 - Resource is not found
        • AE-6 - API usage rate limit is exceeded
        • AE-7 - Method is not allowed
      • title string
      • detail string
    • traceId string

500

Prompt processing error.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string

        Custom error codes

        • AE-1 - Internal processing error
        • AE-2 - Incorrect request
        • AE-3 - Authentication issue
        • AE-4 - Prompt is rejected
        • AE-5 - Resource is not found
        • AE-6 - API usage rate limit is exceeded
        • AE-7 - Method is not allowed
      • title string
      • detail string
    • traceId string
POST /api/v1/assistants/{assistantId}/threads/{threadId}/actions/stream
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.assistants.streamAssistantThread(
'507f191e810c19729de860ea',
'507f191e810c19729de860ea',
{
input: {
includeText: true,
prompt: 'What is a LLM?',
promptType: 'thread',
},
},
)
# qlik-cli has not implemented support for POST /api/v1/assistants/{assistantId}/threads/{threadId}/actions/stream yet.
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/assistants/{assistantId}/threads/{threadId}/actions/stream" \
-X POST \
-H "Content-type: application/json" \
-H "Authorization: Bearer <access_token>" \
-d '{"input":{"prompt":"What is a LLM?","promptType":"thread","includeText":true}}'

Example Response

{
"output": "LLM stands for Large Language Model",
"sources": [
{
"chunks": [
{
"text": "LLM stands for Large Language Model",
"chunkId": "10d347c4-f28a-4faf-93f0-48e781aaf303"
}
],
"source": "Reference.md",
"documentId": "10d347c4-f28a-4faf-93f0-48e781aaf303",
"datasourceId": "10d347c4-f28a-4faf-93f0-48e781aaf303",
"knowledgebaseId": "10d347c4-f28a-4faf-93f0-48e781aaf303"
}
]
}

List interactions

Retrieves the list of interactions for the thread.

Facts

Rate limit Tier 1 (1000 requests per minute)

Query Parameters

  • limit integer

    The number of feedback to get.

  • next string

    Optional parameter to request the next page.

  • prev string

    Optional parameter to request the previous page.

  • sort string

    Optional resource field name to sort on, case insensitive, e.g. created. Can be prefixed with - to set descending order; defaults to ascending.

    Can be one of: "CREATED""-CREATED""UPDATED""-UPDATED"

Path Parameters

  • assistantId string
    Required

    The ID of the assistant from which to retrieve the interactions.

  • threadId string
    Required

    The ID of the thread from which to retrieve the interactions.

Responses

200

Successfully retrieved the thread interactions.

  • application/json object
    Show application/json properties
    • data array of objects
      Required
      Show data properties
      • id string
        Required
      • ownerId string
        Required

        Unique identifier of user which created the interaction.

      • request string
        Required

        Interaction request content.

      • sources array of objects
        Required

        List of sources used to generate AI messages (interactions).

        Show sources properties
        • chunks array of objects
          Required

          List of Chunks used for "AI" generated messages.

          Show chunks properties
          • text string

            Chunk text for "AI" generated message source.

          • chunkId string
            Required

            Chunk unique identifier for "AI" generated message source.

        • source string
          Required

          Path to the document used.

        • documentId string
          Required

          Reference to Document used for "AI" generated messages.

        • datasourceId string
          Required

          Reference to DataSource used for "AI" generated messages.

        • lastIndexedAt string

          Datetime when the knowledgebase was last indexed.

        • knowledgebaseId string
          Required

          Reference to KnowledgeBase used for "AI" generated messages.

      • feedback object
        Show feedback properties
        • id string
          Required

          Unique feedback identifier.

        • vote integer
          Required

          Integer representation of feedback given (-1 = negative, 1 = positive).

        • reason string
          Required

          Reason for feedback.

        • comment string
          Required

          Optional comment for feedback.

        • reviewedAt string

          Datetime when the feedback was reviewed.

        • reviewerId string
          Required

          Unique feedback reviewer identifier.

        • reviewStatus string
          Required

          Feedback review status.

      • rejected boolean

        Indicator the system marked request as suspicious.

      • response string
        Required

        Interaction response content.

      • threadId string
        Required

        ID of the thread to which the interaction belongs.

      • createdAt string
        Required

        Datetime when the interaction was created.

      • updatedAt string
        Required

        Datetime when the interaction was updated.

    • meta object
      Show meta properties
      • countTotal integer
    • links object
      Show links properties
      • next object
        Show next properties
        • href string
      • prev object
        Show prev properties
        • href string
      • self object
        Show self properties
        • href string

400

The request is in incorrect format.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

403

The operation failed due to insufficient permissions.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

404

The feedback was not found.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string
GET /api/v1/assistants/{assistantId}/threads/{threadId}/interactions
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.assistants.getAssistantThreadInteractions(
'507f191e810c19729de860ea',
'507f191e810c19729de860bb',
{},
)
qlik assistant thread interaction ls \
--assistantId '507f191e810c19729de860ea' \
--threadId '507f191e810c19729de860bb'
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/assistants/{assistantId}/threads/{threadId}/interactions" \
-H "Authorization: Bearer <access_token>"

Example Response

{
"data": [
{
"id": "10d347c4-f28a-4faf-93f0-48e781aaf303",
"ownerId": "65e310c43fb1cf46654e0878",
"request": "Where was Genghis Khan buried?",
"sources": [
{
"chunks": [
{
"text": "string",
"chunkId": "10d347c4-f28a-4faf-93f0-48e781aaf303"
}
],
"source": "Reference.md",
"documentId": "10d347c4-f28a-4faf-93f0-48e781aaf303",
"datasourceId": "10d347c4-f28a-4faf-93f0-48e781aaf303",
"lastIndexedAt": "2021-10-02T14:20:50.52Z",
"knowledgebaseId": "10d347c4-f28a-4faf-93f0-48e781aaf303"
}
],
"feedback": {
"id": "507f191e810c19729de860ea",
"vote": 1,
"reason": "inaccurate | irrelevant | repetitive | unhelpful | other",
"comment": "string",
"reviewedAt": "2021-10-02T14:20:50.52Z",
"reviewerId": "507f191e810c19729de860ea",
"reviewStatus": "reviewed | unreviewed"
},
"rejected": true,
"response": "Somewhere in an unmarked grave",
"threadId": "125c24c4-668c-4c97-bef8-30d910169913",
"createdAt": "2021-10-02T14:20:50.52Z",
"updatedAt": "2021-10-02T14:20:55.52Z"
}
],
"meta": {
"countTotal": 42
},
"links": {
"next": {
"href": "string"
},
"prev": {
"href": "string"
},
"self": {
"href": "string"
}
}
}

Create an interaction

Creates a new interaction for the thread.

Facts

Rate limit Tier 2 (100 requests per minute)

Path Parameters

  • assistantId string
    Required

    The ID of the assistant in which to create the interaction.

  • threadId string
    Required

    The ID of the thread in which to create the interaction.

Request Body

  • application/json object
    Show application/json properties
    • request string
      Required

      Interaction request content.

    • sources array of objects
      Required

      List of sources used to generate AI messages (interactions).

      Show sources properties
      • chunks array of objects
        Required

        List of Chunks used for "AI" generated messages.

        Show chunks properties
        • text string

          Chunk text for "AI" generated message source.

        • chunkId string
          Required

          Chunk unique identifier for "AI" generated message source.

      • source string
        Required

        Path to the document used.

      • documentId string
        Required

        Reference to Document used for "AI" generated messages.

      • datasourceId string
        Required

        Reference to DataSource used for "AI" generated messages.

      • lastIndexedAt string

        Datetime when the knowledgebase was last indexed.

      • knowledgebaseId string
        Required

        Reference to KnowledgeBase used for "AI" generated messages.

    • rejected boolean

      Indicator the system marked request as suspicious.

    • response string
      Required

      Interaction response content.

    • rejectionReason integer

      Rejection reason for a question:

      • 1 - PROMPT_INJECTION
      • 2 - OUT_OF_CONTEXT
      • 3 - TOO_COMPLEX

      Can be one of: 123

Responses

201

Successfully created a new thread interaction.

  • application/json object
    Show application/json properties
    • id string
      Required
    • ownerId string
      Required

      Unique identifier of user which created the interaction.

    • request string
      Required

      Interaction request content.

    • sources array of objects
      Required

      List of sources used to generate AI messages (interactions).

      Show sources properties
      • chunks array of objects
        Required

        List of Chunks used for "AI" generated messages.

        Show chunks properties
        • text string

          Chunk text for "AI" generated message source.

        • chunkId string
          Required

          Chunk unique identifier for "AI" generated message source.

      • source string
        Required

        Path to the document used.

      • documentId string
        Required

        Reference to Document used for "AI" generated messages.

      • datasourceId string
        Required

        Reference to DataSource used for "AI" generated messages.

      • lastIndexedAt string

        Datetime when the knowledgebase was last indexed.

      • knowledgebaseId string
        Required

        Reference to KnowledgeBase used for "AI" generated messages.

    • feedback object
      Show feedback properties
      • id string
        Required

        Unique feedback identifier.

      • vote integer
        Required

        Integer representation of feedback given (-1 = negative, 1 = positive).

      • reason string
        Required

        Reason for feedback.

      • comment string
        Required

        Optional comment for feedback.

      • reviewedAt string

        Datetime when the feedback was reviewed.

      • reviewerId string
        Required

        Unique feedback reviewer identifier.

      • reviewStatus string
        Required

        Feedback review status.

    • rejected boolean

      Indicator the system marked request as suspicious.

    • response string
      Required

      Interaction response content.

    • threadId string
      Required

      ID of the thread to which the interaction belongs.

    • createdAt string
      Required

      Datetime when the interaction was created.

    • updatedAt string
      Required

      Datetime when the interaction was updated.

400

The request is in incorrect format.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

403

The user does not have privileges to perform the requested action.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

404

The assistant or the thread was not found.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string
POST /api/v1/assistants/{assistantId}/threads/{threadId}/interactions
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.assistants.createAssistantThreadInteraction(
'507f191e810c19729de860ea',
'507f191e810c19729de860ea',
{
rejected: true,
rejectionReason: 1,
request: 'Where was Genghis Khan buried?',
response: 'Somewhere in an unmarked grave',
sources: [
{
chunks: [
{
chunkId:
'10d347c4-f28a-4faf-93f0-48e781aaf303',
text: 'string',
},
],
datasourceId:
'10d347c4-f28a-4faf-93f0-48e781aaf303',
documentId:
'10d347c4-f28a-4faf-93f0-48e781aaf303',
knowledgebaseId:
'10d347c4-f28a-4faf-93f0-48e781aaf303',
lastIndexedAt: '2021-10-02T14:20:50.52Z',
source: 'Reference.md',
},
],
},
)
qlik assistant thread interaction create \
--assistantId '507f191e810c19729de860ea' \
--threadId '507f191e810c19729de860ea' \
--request 'Where was Genghis Khan buried?' \
--response 'Somewhere in an unmarked grave' \
--sources-chunks-chunkId '' \
--sources-chunks-text '' \
--sources-datasourceId '' \
--sources-documentId '' \
--sources-knowledgebaseId '' \
--sources-lastIndexedAt '' \
--sources-source ''
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/assistants/{assistantId}/threads/{threadId}/interactions" \
-X POST \
-H "Content-type: application/json" \
-H "Authorization: Bearer <access_token>" \
-d '{"request":"Where was Genghis Khan buried?","sources":[{"chunks":[{"text":"string","chunkId":"10d347c4-f28a-4faf-93f0-48e781aaf303"}],"source":"Reference.md","documentId":"10d347c4-f28a-4faf-93f0-48e781aaf303","datasourceId":"10d347c4-f28a-4faf-93f0-48e781aaf303","lastIndexedAt":"2021-10-02T14:20:50.52Z","knowledgebaseId":"10d347c4-f28a-4faf-93f0-48e781aaf303"}],"rejected":true,"response":"Somewhere in an unmarked grave","rejectionReason":1}'

Example Response

{
"id": "10d347c4-f28a-4faf-93f0-48e781aaf303",
"ownerId": "65e310c43fb1cf46654e0878",
"request": "Where was Genghis Khan buried?",
"sources": [
{
"chunks": [
{
"text": "string",
"chunkId": "10d347c4-f28a-4faf-93f0-48e781aaf303"
}
],
"source": "Reference.md",
"documentId": "10d347c4-f28a-4faf-93f0-48e781aaf303",
"datasourceId": "10d347c4-f28a-4faf-93f0-48e781aaf303",
"lastIndexedAt": "2021-10-02T14:20:50.52Z",
"knowledgebaseId": "10d347c4-f28a-4faf-93f0-48e781aaf303"
}
],
"feedback": {
"id": "507f191e810c19729de860ea",
"vote": 1,
"reason": "inaccurate | irrelevant | repetitive | unhelpful | other",
"comment": "string",
"reviewedAt": "2021-10-02T14:20:50.52Z",
"reviewerId": "507f191e810c19729de860ea",
"reviewStatus": "reviewed | unreviewed"
},
"rejected": true,
"response": "Somewhere in an unmarked grave",
"threadId": "125c24c4-668c-4c97-bef8-30d910169913",
"createdAt": "2021-10-02T14:20:50.52Z",
"updatedAt": "2021-10-02T14:20:55.52Z"
}

Get an interaction

Retrieves an interaction for the thread.

Facts

Rate limit Tier 1 (1000 requests per minute)

Path Parameters

  • assistantId string
    Required

    The ID of the assistant in which to retrieve the interaction.

  • interactionId string
    Required

    The ID of the interaction to retrieve.

  • threadId string
    Required

    The ID of the thread in which to retrieve the interaction.

Responses

200

Successfully retrieved the interaction.

  • application/json object
    Show application/json properties
    • id string
      Required
    • ownerId string
      Required

      Unique identifier of user which created the interaction.

    • request string
      Required

      Interaction request content.

    • sources array of objects
      Required

      List of sources used to generate AI messages (interactions).

      Show sources properties
      • chunks array of objects
        Required

        List of Chunks used for "AI" generated messages.

        Show chunks properties
        • text string

          Chunk text for "AI" generated message source.

        • chunkId string
          Required

          Chunk unique identifier for "AI" generated message source.

      • source string
        Required

        Path to the document used.

      • documentId string
        Required

        Reference to Document used for "AI" generated messages.

      • datasourceId string
        Required

        Reference to DataSource used for "AI" generated messages.

      • lastIndexedAt string

        Datetime when the knowledgebase was last indexed.

      • knowledgebaseId string
        Required

        Reference to KnowledgeBase used for "AI" generated messages.

    • feedback object
      Show feedback properties
      • id string
        Required

        Unique feedback identifier.

      • vote integer
        Required

        Integer representation of feedback given (-1 = negative, 1 = positive).

      • reason string
        Required

        Reason for feedback.

      • comment string
        Required

        Optional comment for feedback.

      • reviewedAt string

        Datetime when the feedback was reviewed.

      • reviewerId string
        Required

        Unique feedback reviewer identifier.

      • reviewStatus string
        Required

        Feedback review status.

    • rejected boolean

      Indicator the system marked request as suspicious.

    • response string
      Required

      Interaction response content.

    • threadId string
      Required

      ID of the thread to which the interaction belongs.

    • createdAt string
      Required

      Datetime when the interaction was created.

    • updatedAt string
      Required

      Datetime when the interaction was updated.

400

The request is in incorrect format.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

403

The operation failed due to insufficient permissions.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

404

The interaction was not found.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string
GET /api/v1/assistants/{assistantId}/threads/{threadId}/interactions/{interactionId}
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.assistants.getAssistantThreadInteraction(
'507f191e810c19729de860ea',
'507f191e810c19729de860ea',
'507f191e810c19729de860ea',
)
qlik assistant thread interaction get '507f191e810c19729de860ea' \
--assistantId '507f191e810c19729de860ea' \
--threadId '507f191e810c19729de860ea'
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/assistants/{assistantId}/threads/{threadId}/interactions/{interactionId}" \
-H "Authorization: Bearer <access_token>"

Example Response

{
"id": "10d347c4-f28a-4faf-93f0-48e781aaf303",
"ownerId": "65e310c43fb1cf46654e0878",
"request": "Where was Genghis Khan buried?",
"sources": [
{
"chunks": [
{
"text": "string",
"chunkId": "10d347c4-f28a-4faf-93f0-48e781aaf303"
}
],
"source": "Reference.md",
"documentId": "10d347c4-f28a-4faf-93f0-48e781aaf303",
"datasourceId": "10d347c4-f28a-4faf-93f0-48e781aaf303",
"lastIndexedAt": "2021-10-02T14:20:50.52Z",
"knowledgebaseId": "10d347c4-f28a-4faf-93f0-48e781aaf303"
}
],
"feedback": {
"id": "507f191e810c19729de860ea",
"vote": 1,
"reason": "inaccurate | irrelevant | repetitive | unhelpful | other",
"comment": "string",
"reviewedAt": "2021-10-02T14:20:50.52Z",
"reviewerId": "507f191e810c19729de860ea",
"reviewStatus": "reviewed | unreviewed"
},
"rejected": true,
"response": "Somewhere in an unmarked grave",
"threadId": "125c24c4-668c-4c97-bef8-30d910169913",
"createdAt": "2021-10-02T14:20:50.52Z",
"updatedAt": "2021-10-02T14:20:55.52Z"
}

Delete an interaction

Deletes the specified interaction and all of its resources.

Facts

Rate limit Tier 2 (100 requests per minute)

Path Parameters

  • assistantId string
    Required

    The ID of the assistant in which to delete the interaction.

  • interactionId string
    Required

    The ID of the interaction to delete.

  • threadId string
    Required

    The ID of the thread in which to delete the interaction.

Responses

204

Successful operation.

400

The request is in incorrect format.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

403

The operation failed due to insufficient permissions.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

404

The resource was not found.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string
DELETE /api/v1/assistants/{assistantId}/threads/{threadId}/interactions/{interactionId}
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.assistants.deleteAssistantThreadInteraction(
'507f191e810c19729de860ea',
'507f191e810c19729de860ea',
'507f191e810c19729de860ea',
)
qlik assistant thread interaction rm '507f191e810c19729de860ea' \
--assistantId '507f191e810c19729de860ea' \
--threadId '507f191e810c19729de860ea'
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/assistants/{assistantId}/threads/{threadId}/interactions/{interactionId}" \
-X DELETE \
-H "Authorization: Bearer <access_token>"

Create feedback

Creates feedback for the thread.

Facts

Rate limit Tier 2 (100 requests per minute)

Path Parameters

  • assistantId string
    Required

    The ID of the assistant in which to create the feedback.

  • interactionId string
    Required

    The ID of the interaction in which to create the feedback.

  • threadId string
    Required

    The ID of the thread in which to create the feedback.

Request Body

  • application/json object
    Show application/json properties
    • vote integer
      Required

      Integer representation of feedback given (-1 = negative, 1 = positive).

    • reason string
      Required

      Reason for feedback.

    • comment string

      Optional comment for feedback.

Responses

201

Successfully created a new thread feedback.

  • application/json object
    Show application/json properties
    • id string
      Required
    • ownerId string
      Required

      Unique identifier of user which created the interaction.

    • request string
      Required

      Interaction request content.

    • sources array of objects
      Required

      List of sources used to generate AI messages (interactions).

      Show sources properties
      • chunks array of objects
        Required

        List of Chunks used for "AI" generated messages.

        Show chunks properties
        • text string

          Chunk text for "AI" generated message source.

        • chunkId string
          Required

          Chunk unique identifier for "AI" generated message source.

      • source string
        Required

        Path to the document used.

      • documentId string
        Required

        Reference to Document used for "AI" generated messages.

      • datasourceId string
        Required

        Reference to DataSource used for "AI" generated messages.

      • lastIndexedAt string

        Datetime when the knowledgebase was last indexed.

      • knowledgebaseId string
        Required

        Reference to KnowledgeBase used for "AI" generated messages.

    • feedback object
      Show feedback properties
      • id string
        Required

        Unique feedback identifier.

      • vote integer
        Required

        Integer representation of feedback given (-1 = negative, 1 = positive).

      • reason string
        Required

        Reason for feedback.

      • comment string
        Required

        Optional comment for feedback.

      • reviewedAt string

        Datetime when the feedback was reviewed.

      • reviewerId string
        Required

        Unique feedback reviewer identifier.

      • reviewStatus string
        Required

        Feedback review status.

    • rejected boolean

      Indicator the system marked request as suspicious.

    • response string
      Required

      Interaction response content.

    • threadId string
      Required

      ID of the thread to which the interaction belongs.

    • createdAt string
      Required

      Datetime when the interaction was created.

    • updatedAt string
      Required

      Datetime when the interaction was updated.

400

The request is in incorrect format.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

403

The user does not have privileges to perform the requested action.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

404

The resource was not found.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string
POST /api/v1/assistants/{assistantId}/threads/{threadId}/interactions/{interactionId}/feedback
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.assistants.createAssistantThreadInteractionFeedback(
'507f191e810c19729de860ea',
'507f191e810c19729de860ea',
'507f191e810c19729de860ea',
{
comment: 'string',
reason:
'inaccurate | irrelevant | repetitive | unhelpful | other',
vote: 1,
},
)
qlik assistant thread interaction feedback create \
--assistantId '507f191e810c19729de860ea' \
--threadId '507f191e810c19729de860ea' \
--interactionId '507f191e810c19729de860ea' \
--reason 'inaccurate | irrelevant | repetitive | unhelpful | other' \
--vote 1
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/assistants/{assistantId}/threads/{threadId}/interactions/{interactionId}/feedback" \
-X POST \
-H "Content-type: application/json" \
-H "Authorization: Bearer <access_token>" \
-d '{"vote":1,"reason":"inaccurate | irrelevant | repetitive | unhelpful | other","comment":"string"}'

Example Response

{
"id": "10d347c4-f28a-4faf-93f0-48e781aaf303",
"ownerId": "65e310c43fb1cf46654e0878",
"request": "Where was Genghis Khan buried?",
"sources": [
{
"chunks": [
{
"text": "string",
"chunkId": "10d347c4-f28a-4faf-93f0-48e781aaf303"
}
],
"source": "Reference.md",
"documentId": "10d347c4-f28a-4faf-93f0-48e781aaf303",
"datasourceId": "10d347c4-f28a-4faf-93f0-48e781aaf303",
"lastIndexedAt": "2021-10-02T14:20:50.52Z",
"knowledgebaseId": "10d347c4-f28a-4faf-93f0-48e781aaf303"
}
],
"feedback": {
"id": "507f191e810c19729de860ea",
"vote": 1,
"reason": "inaccurate | irrelevant | repetitive | unhelpful | other",
"comment": "string",
"reviewedAt": "2021-10-02T14:20:50.52Z",
"reviewerId": "507f191e810c19729de860ea",
"reviewStatus": "reviewed | unreviewed"
},
"rejected": true,
"response": "Somewhere in an unmarked grave",
"threadId": "125c24c4-668c-4c97-bef8-30d910169913",
"createdAt": "2021-10-02T14:20:50.52Z",
"updatedAt": "2021-10-02T14:20:55.52Z"
}

Update feedback

Updates feedback for the thread.

Facts

Rate limit Tier 2 (100 requests per minute)

Path Parameters

  • assistantId string
    Required

    The ID of the assistant containing the requested feedback.

  • feedbackId string
    Required

    The ID of the feedback to update.

  • interactionId string
    Required

    The ID of the interaction containing the requested Feedback.

  • threadId string
    Required

    The ID of the thread containing the requested feedback.

Request Body

  • application/json array of objects

    An array of JSON Patch documents.

    Show application/json properties
    • op string
      Required

      The operation to be performed.

      Can be one of: "replace""add"

    • path string
      Required

      A JSON Pointer.

    • value string|number|boolean
      Required

      The value to be used for this operation.

      One of:
      • string
      • number
      • boolean

Responses

204

Successfully updated the feedback.

400

The request is in incorrect format.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

403

The operation failed due to insufficient permissions.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

404

The resource was not found.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string
PATCH /api/v1/assistants/{assistantId}/threads/{threadId}/interactions/{interactionId}/feedback/{feedbackId}
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.assistants.patchAssistantThreadInteractionFeedback(
'507f191e810c19729de860ea',
'507f191e810c19729de860ea',
'507f191e810c19729de860ea',
'507f191e810c19729de860ea',
[
{
op: 'replace',
path: '/reason',
value: 'irrelevant',
},
],
)
qlik assistant thread interaction feedback patch '507f191e810c19729de860ea' \
--assistantId '507f191e810c19729de860ea' \
--threadId '507f191e810c19729de860ea' \
--interactionId '507f191e810c19729de860ea' \
--op 'replace' \
--path '/reason' \
--value irrelevant
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/assistants/{assistantId}/threads/{threadId}/interactions/{interactionId}/feedback/{feedbackId}" \
-X PATCH \
-H "Content-type: application/json" \
-H "Authorization: Bearer <access_token>" \
-d '[{"op":"replace","path":"/reason","value":"irrelevant"}]'

Create feedback review

Creates feedback review for the thread.

Facts

Rate limit Tier 2 (100 requests per minute)

Path Parameters

  • assistantId string
    Required

    The ID of the assistant in which to create the feedback review.

  • interactionId string
    Required

    The ID of the interaction in which to create the feedback review.

  • threadId string
    Required

    The ID of the thread in which to create the feedback review.

Request Body

  • application/json object
    Show application/json properties
    • reviewStatus string
      Required

      Review status.

Responses

201

Successfully created a new thread feedback.

  • application/json object
    Show application/json properties
    • id string
      Required
    • ownerId string
      Required

      Unique identifier of user which created the interaction.

    • request string
      Required

      Interaction request content.

    • sources array of objects
      Required

      List of sources used to generate AI messages (interactions).

      Show sources properties
      • chunks array of objects
        Required

        List of Chunks used for "AI" generated messages.

        Show chunks properties
        • text string

          Chunk text for "AI" generated message source.

        • chunkId string
          Required

          Chunk unique identifier for "AI" generated message source.

      • source string
        Required

        Path to the document used.

      • documentId string
        Required

        Reference to Document used for "AI" generated messages.

      • datasourceId string
        Required

        Reference to DataSource used for "AI" generated messages.

      • lastIndexedAt string

        Datetime when the knowledgebase was last indexed.

      • knowledgebaseId string
        Required

        Reference to KnowledgeBase used for "AI" generated messages.

    • feedback object
      Show feedback properties
      • id string
        Required

        Unique feedback identifier.

      • vote integer
        Required

        Integer representation of feedback given (-1 = negative, 1 = positive).

      • reason string
        Required

        Reason for feedback.

      • comment string
        Required

        Optional comment for feedback.

      • reviewedAt string

        Datetime when the feedback was reviewed.

      • reviewerId string
        Required

        Unique feedback reviewer identifier.

      • reviewStatus string
        Required

        Feedback review status.

    • rejected boolean

      Indicator the system marked request as suspicious.

    • response string
      Required

      Interaction response content.

    • threadId string
      Required

      ID of the thread to which the interaction belongs.

    • createdAt string
      Required

      Datetime when the interaction was created.

    • updatedAt string
      Required

      Datetime when the interaction was updated.

400

The request is in incorrect format.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

403

The user does not have privileges to perform the requested action.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

404

A resource was not found.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string
POST /api/v1/assistants/{assistantId}/threads/{threadId}/interactions/{interactionId}/reviews
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.assistants.createAssistantThreadInteractionReview(
'507f191e810c19729de860ea',
'507f191e810c19729de860ea',
'507f191e810c19729de860ea',
{ reviewStatus: 'reviewed | unreviewed' },
)
qlik assistant thread interaction review create \
--assistantId '507f191e810c19729de860ea' \
--threadId '507f191e810c19729de860ea' \
--interactionId '507f191e810c19729de860ea' \
--reviewStatus 'reviewed | unreviewed'
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/assistants/{assistantId}/threads/{threadId}/interactions/{interactionId}/reviews" \
-X POST \
-H "Content-type: application/json" \
-H "Authorization: Bearer <access_token>" \
-d '{"reviewStatus":"reviewed | unreviewed"}'

Example Response

{
"id": "10d347c4-f28a-4faf-93f0-48e781aaf303",
"ownerId": "65e310c43fb1cf46654e0878",
"request": "Where was Genghis Khan buried?",
"sources": [
{
"chunks": [
{
"text": "string",
"chunkId": "10d347c4-f28a-4faf-93f0-48e781aaf303"
}
],
"source": "Reference.md",
"documentId": "10d347c4-f28a-4faf-93f0-48e781aaf303",
"datasourceId": "10d347c4-f28a-4faf-93f0-48e781aaf303",
"lastIndexedAt": "2021-10-02T14:20:50.52Z",
"knowledgebaseId": "10d347c4-f28a-4faf-93f0-48e781aaf303"
}
],
"feedback": {
"id": "507f191e810c19729de860ea",
"vote": 1,
"reason": "inaccurate | irrelevant | repetitive | unhelpful | other",
"comment": "string",
"reviewedAt": "2021-10-02T14:20:50.52Z",
"reviewerId": "507f191e810c19729de860ea",
"reviewStatus": "reviewed | unreviewed"
},
"rejected": true,
"response": "Somewhere in an unmarked grave",
"threadId": "125c24c4-668c-4c97-bef8-30d910169913",
"createdAt": "2021-10-02T14:20:50.52Z",
"updatedAt": "2021-10-02T14:20:55.52Z"
}

Get an assistant

Retrieves the specified assistant.

Facts

Rate limit Tier 1 (1000 requests per minute)

Path Parameters

  • id string
    Required

    The ID of the assistant to retrieve.

Responses

200

Successfully retrieved the assistant.

  • application/json object
    Show application/json properties
    • id string
      Required

      Unique identifier of the assistant.

    • name string
      Required

      The name of the assistant.

    • tags array of strings
      Required

      The list of tags associated with the assistant.

    • title string

      The title of the assistant.

    • ownerId string
      Required

      Unique identifier of the assistant owner.

    • spaceId string
      Required

      Unique identifier of the space containing the assistant.

    • tenantId string
      Required

      Unique identifier of the assistant tenant.

    • createdAt string
      Required

      Datetime when the assistant was created.

    • createdBy string
      Required

      Unique identifier of the user who created the assistant.

    • hasAvatar boolean

      Indicates if the assistant has an avatar.

    • updatedAt string
      Required

      Datetime when the assistant was updated.

    • updatedBy string
      Required

      Unique identifier of the user who last updated the assistant.

    • description string
      Required

      The description of the assistant.

    • systemMessage string Deprecated

      System prompt setting up conversation context.

    • knowledgeBases array of strings
      Required

      List of knowledgebases the assistant is using.

    • welcomeMessage string
      Required

      Initial message in the chat conversation.

    • customProperties object
      Required

      freeform JSON to allow custom customization options.

    • defaultPromptType string

      Default prompt type for the assistant.

      Can be one of: "thread""oneshot"

    • orderedStarterIds array of strings

      List of starter IDs in the order they will be sorted.

400

The request is in incorrect format.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

403

The operation failed due to insufficient permissions.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

404

The assistant was not found.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string
GET /api/v1/assistants/{id}
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.assistants.getAssistant(
'507f191e810c19729de860ea',
)
qlik assistant get '507f191e810c19729de860ea'
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/assistants/{id}" \
-H "Authorization: Bearer <access_token>"

Example Response

{
"id": "507f191e810c19729de860ea",
"name": "Organization-wide Assistant",
"tags": [
"Red",
"Sales"
],
"title": "Assistant for Sales activities",
"ownerId": "507f191e810c19729de860ea",
"spaceId": "507f191e810c19729de860ea",
"tenantId": "507f191e810c19729de860ea",
"createdAt": "2021-10-02T14:20:50.52Z",
"createdBy": "507f191e810c19729de860ea",
"hasAvatar": true,
"updatedAt": "2021-10-02T14:20:50.52Z",
"updatedBy": "507f191e810c19729de860ea",
"description": "This assistant is used for...",
"systemMessage": "You are helpful Sales assistant. Provide concise and actionable insights.",
"knowledgeBases": [
"507f191e810c19729de860ea"
],
"welcomeMessage": "Welcome to Sales process support Assistant.",
"customProperties": {
"customErrors": {
"outsideScopeError": "Outside of scope error",
"complexQuestionError": "Complex question error",
"promptInjectionError": "Prompt injection error"
}
},
"defaultPromptType": "thread",
"orderedStarterIds": [
"507f191e810c19729de860ea",
"787f191e810c19729de860er"
]
}

Update assistant properties

Updates the properties of an existing assistant with JSON Patch-formatted data.

Facts

Rate limit Tier 2 (100 requests per minute)

Header Parameters

  • if-match string

    Optional header to do conditional updates. Using the Etag value that was returned the last time the assistant was fetched.

Path Parameters

  • id string
    Required

    The assistant ID.

Request Body

Required
  • application/json array of objects

    An array of JSON Patch documents.

    Show application/json properties
    • op string
      Required

      The operation to be performed.

      Can be one of: "replace""add"

    • path string
      Required

      A JSON Pointer.

    • value string|number|boolean
      Required

      The value to be used for this operation.

      One of:
      • string
      • number
      • boolean

Responses

204

Assistant updated successfully.

400

Bad request. Payload could not be parsed to a JSON Patch or Patch operations are invalid.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

401

Not authorized.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

403

The operation failed due to insufficient permissions.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

404

The term to patch was not found.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

429

The request has been rate-limited.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string
PATCH /api/v1/assistants/{id}
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.assistants.patchAssistant(
'507f191e810c19729de860ea',
[
{
op: 'replace',
path: '/name',
value: 'new name',
},
{
op: 'replace',
path: '/description',
value: 'new description',
},
{
op: 'add',
path: '/defaultPromptType',
value: 'thread',
},
{ op: 'remove', path: '/avatar' },
{
op: 'add',
path: '/avatar',
value:
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAlAQAAAAAsYlcCAAAACklEQVR4AWMYBQABAwABRUEDtQAAAABJRU5ErkJggg==',
},
{
op: 'replace',
path: '/avatar',
value:
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAlAQAAAAAsYlcCAAAACklEQVR4AWMYBQABAwABRUEDtQAAAABJRU5ErkJggg==',
},
],
)
qlik assistant patch '507f191e810c19729de860ea' \
--op 'replace' \
--path '/name' \
--value new name
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/assistants/{id}" \
-X PATCH \
-H "Content-type: application/json" \
-H "Authorization: Bearer <access_token>" \
-d '[{"op":"replace","path":"/name","value":"new name"},{"op":"replace","path":"/description","value":"new description"},{"op":"add","path":"/defaultPromptType","value":"thread"},{"op":"remove","path":"/avatar"},{"op":"add","path":"/avatar","value":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAlAQAAAAAsYlcCAAAACklEQVR4AWMYBQABAwABRUEDtQAAAABJRU5ErkJggg=="},{"op":"replace","path":"/avatar","value":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAlAQAAAAAsYlcCAAAACklEQVR4AWMYBQABAwABRUEDtQAAAABJRU5ErkJggg=="}]'

Delete an assistant

Deletes the assistant and all of its resources.

Facts

Rate limit Tier 2 (100 requests per minute)

Path Parameters

  • id string
    Required

    The ID of the assistant to delete.

Responses

204

Successful operation.

400

The request is in incorrect format.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

403

The operation failed due to insufficient permissions.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string

404

The assistant was not found.

  • application/json object
    Show application/json properties
    • errors array of objects
      Show errors properties
      • code string
      • title string
      • detail string
    • traceId string
DELETE /api/v1/assistants/{id}
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.assistants.deleteAssistant(
'507f191e810c19729de860ea',
)
qlik assistant rm '507f191e810c19729de860ea'
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/assistants/{id}" \
-X DELETE \
-H "Authorization: Bearer <access_token>"