Knowledgebases

Knowledgebases are collections of individual data sources, that are indexed for use in generating responses to user questions via Assistants for Qlik Answers.

List knowledgebases

Returns a list of all knowledgebases the user has access to.

Facts

Rate limit Tier 1 (1000 requests per minute)

Query Parameters

  • limit integer

    The number of knowledgebases 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, eg. name. Can be prefixed with - to set descending order, defaults to ascending.

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

  • 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 knowledgebase

      • name string
        Required

        Name of the knowledgebase

      • tags array of strings
        Required

        List of tags associated with the knowledgebase.

      • ownerId string
        Required

        The unique identifier of the knowledgebase owner

      • spaceId string
        Required

        The unique identifier of the space containing the knowledgebase

      • tenantId string

        Unique identifier of the tenant

      • createdAt string
        Required

        Datetime when the knowledgebase was created

      • createdBy string
        Required

        Unique identifier of the user who created the knowledgebase

      • updatedAt string
        Required

        Datetime when the knowledgebase was updated

      • updatedBy string
        Required

        The unique identifier of the user who last updated the knowledgebase

      • description string
        Required

        Description of the knowledgebase

      • lastIndexedAt string

        Datetime when the knowledgebase was last indexed

      • contentSummary object
        Required
        Show contentSummary properties
        • fileSize integer
          Required
        • textSize integer
          Required
        • fileCount integer
          Required
        • effectivePages integer
          Required
      • advancedIndexing boolean

        User opt in to advanced parsing and chunking pipeline. Default is false, which will run legacy parsing and chunking.

      • selectedErrorsCount integer

        Number of selected errors to store in the case of any failed datasources.

    • 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/knowledgebases
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.knowledgebases.getKnowledgebases({})
qlik knowledgebase ls
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/knowledgebases" \
-H "Authorization: Bearer <access_token>"

Example Response

{
"data": [
{
"id": "f256b3e4-03e0-4f74-ae46-a4d43882ee5d",
"name": "Organization wide knowledgebase",
"tags": [
"Red",
"Sales"
],
"ownerId": "507f191e810c19729de860ea",
"spaceId": "507f191e810c19729de860ea",
"tenantId": "507f191e810c19729de860ea",
"createdAt": "2021-10-02T14:20:50.52Z",
"createdBy": "507f191e810c19729de860ea",
"updatedAt": "2021-10-02T14:20:50.52Z",
"updatedBy": "507f191e810c19729de860ea",
"description": "This knowledgebase is used for...",
"lastIndexedAt": "2021-10-02T14:20:50.52Z",
"contentSummary": {
"fileSize": 42,
"textSize": 42,
"fileCount": 42,
"effectivePages": 42
},
"advancedIndexing": true,
"selectedErrorsCount": 10
}
],
"links": {
"next": {
"href": "string"
},
"prev": {
"href": "string"
},
"self": {
"href": "string"
}
}
}

Create new knowledgebase

Creates a new knowledgebase.

Facts

Rate limit Tier 2 (100 requests per minute)

Request Body

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

      Name of the knowledgebase

    • tags array of strings

      List of tags for knowledgebase

    • spaceId string
      Required

      Unique identifier of the space to contain the knowledgebase

    • description string

      Description of the knowledgebase

    • advancedIndexing boolean

      User opt in to advanced parsing and chunking pipeline. Default is false, which will run legacy parsing and chunking.

    • selectedErrorsCount integer

      Number of selected errors to store in the case of any failed datasources. Optional value with a default of 10.

Responses

201

Successfully created a new knowledgebase.

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

      Unique identifier of the knowledgebase

    • name string
      Required

      Name of the knowledgebase

    • tags array of strings
      Required

      List of tags associated with the knowledgebase.

    • ownerId string
      Required

      The unique identifier of the knowledgebase owner

    • spaceId string
      Required

      The unique identifier of the space containing the knowledgebase

    • tenantId string

      Unique identifier of the tenant

    • createdAt string
      Required

      Datetime when the knowledgebase was created

    • createdBy string
      Required

      Unique identifier of the user who created the knowledgebase

    • updatedAt string
      Required

      Datetime when the knowledgebase was updated

    • updatedBy string
      Required

      The unique identifier of the user who last updated the knowledgebase

    • description string
      Required

      Description of the knowledgebase

    • lastIndexedAt string

      Datetime when the knowledgebase was last indexed

    • contentSummary object
      Required
      Show contentSummary properties
      • fileSize integer
        Required
      • textSize integer
        Required
      • fileCount integer
        Required
      • effectivePages integer
        Required
    • advancedIndexing boolean

      User opt in to advanced parsing and chunking pipeline. Default is false, which will run legacy parsing and chunking.

    • selectedErrorsCount integer

      Number of selected errors to store in the case of any failed datasources.

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/knowledgebases
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.knowledgebases.createKnowledgebase({
advancedIndexing: true,
description:
'This knowledgebase is used for...',
name: 'Organization wide knowledgebase',
selectedErrorsCount: 10,
spaceId: '507f191e810c19729de860ea',
tags: ['Red', 'Sales'],
})
qlik knowledgebase create \
--name 'Organization wide knowledgebase' \
--spaceId '507f191e810c19729de860ea'
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/knowledgebases" \
-X POST \
-H "Content-type: application/json" \
-H "Authorization: Bearer <access_token>" \
-d '{"name":"Organization wide knowledgebase","tags":["Red","Sales"],"spaceId":"507f191e810c19729de860ea","description":"This knowledgebase is used for...","advancedIndexing":true,"selectedErrorsCount":10}'

Example Response

{
"id": "f256b3e4-03e0-4f74-ae46-a4d43882ee5d",
"name": "Organization wide knowledgebase",
"tags": [
"Red",
"Sales"
],
"ownerId": "507f191e810c19729de860ea",
"spaceId": "507f191e810c19729de860ea",
"tenantId": "507f191e810c19729de860ea",
"createdAt": "2021-10-02T14:20:50.52Z",
"createdBy": "507f191e810c19729de860ea",
"updatedAt": "2021-10-02T14:20:50.52Z",
"updatedBy": "507f191e810c19729de860ea",
"description": "This knowledgebase is used for...",
"lastIndexedAt": "2021-10-02T14:20:50.52Z",
"contentSummary": {
"fileSize": 42,
"textSize": 42,
"fileCount": 42,
"effectivePages": 42
},
"advancedIndexing": true,
"selectedErrorsCount": 10
}

Retrieve a knowledgebase

Retrieves a specific knowledgebase.

Facts

Rate limit Tier 1 (1000 requests per minute)

Path Parameters

  • id string
    Required

    The id of the knowledgebase to retrieve.

Responses

200

Successfully retrieved the knowledgebase.

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

      Unique identifier of the knowledgebase

    • name string
      Required

      Name of the knowledgebase

    • tags array of strings
      Required

      List of tags associated with the knowledgebase.

    • ownerId string
      Required

      The unique identifier of the knowledgebase owner

    • spaceId string
      Required

      The unique identifier of the space containing the knowledgebase

    • tenantId string

      Unique identifier of the tenant

    • createdAt string
      Required

      Datetime when the knowledgebase was created

    • createdBy string
      Required

      Unique identifier of the user who created the knowledgebase

    • updatedAt string
      Required

      Datetime when the knowledgebase was updated

    • updatedBy string
      Required

      The unique identifier of the user who last updated the knowledgebase

    • description string
      Required

      Description of the knowledgebase

    • lastIndexedAt string

      Datetime when the knowledgebase was last indexed

    • contentSummary object
      Required
      Show contentSummary properties
      • fileSize integer
        Required
      • textSize integer
        Required
      • fileCount integer
        Required
      • effectivePages integer
        Required
    • advancedIndexing boolean

      User opt in to advanced parsing and chunking pipeline. Default is false, which will run legacy parsing and chunking.

    • selectedErrorsCount integer

      Number of selected errors to store in the case of any failed datasources.

    • datasources array of objects

      Specification on where to fetch the files for. This is required when the type == 'file'. Only one of path and files can be set. Path takes precedence if both are provided.

      Show datasources properties
      • id string
        Required

        Unique identifier of the datasource

      • name string

        Name of the datasource

      • type string
        Required

        Can be one of: "file""web""database"

      • spaceId string

        The unique identifier of the space containing the datasource

      • chunking object
        Show chunking properties
        • size integer
          Required

          Size of chunks

        • type string
          Required

          Chunking strategy

        • overlap integer
          Required

          Chunk overlap, should be less than size

        • separators array of strings
          Required

          List of separators to chunk by

        • keepSeparator boolean
          Required

          Allows to keep or remove separators used

      • syncInfo object
        Show syncInfo properties
        • status string
          Required

          Sync status

          Can be one of: "neverIndexed""progress""completed""completedWithError""toAdd""toDelete"

        • startedAt string
          Required

          Datetime when the sync task was started

        • lastSyncId string

          sync Id

        • completedAt string
          Required

          Datetime when the sync task was completed

      • fileConfig object

        Specification on where to fetch the files for. This is required when the type == 'file'. Only one of path and files can be set. Path takes precedence if both are provided.

        Show fileConfig properties
        • files array of strings
        • scope object

          Scope for the file crawler.

          Show scope properties
          • depth integer
            Required

            The number of levels of sub folders that should be considered

          • maxSize integer

            Optional parameter. Max size of downloaded files in bytes

          • extensions array of strings

            list of file extensions to be considered

          • maxFilesTotal integer

            Total number of files that should be considered

          • modifiedAfter string

            only files modified after this time should be indexed. If set older files will be removed from index.

          • maxFilesPerFolder integer

            Maximum number of files per folder that should be considered

        • folder string

          Root folder for traversing.

        • userId string
          Required

          userId of the owner of the datasource fileConfig

        • connectionId string
          Required

          connection id to be used to retrieve the raw data

        • crawlPatterns array of objects

          Pattern matching links to crawl

          Show crawlPatterns properties
          • type string
            Required

            include or exclude

            Can be one of: "include""exclude"

          • pattern string
            Required

            Regex patterna to filter links on

      • sourceCount integer

        The number of times that a datasource was referenced as a source in an answer

      • contentSummary object
        Required
        Show contentSummary properties
        • fileSize integer
          Required
        • textSize integer
          Required
        • fileCount integer
          Required
        • effectivePages integer
          Required
    • indexingProgress object

      Aggregate indexing progress for the knowledgebase across the current sync.

      Show indexingProgress properties
      • status string

        Aggregate indexing status for the knowledgebase.

        Can be one of: "notStarted""inProgress""completed""completedWithError""cancelled"

      • syncId string

        Identifier of the sync currently driving this progress.

      • updatedAt string

        When this progress snapshot was last updated.

      • filesTotal integer

        Total number of files to index in the current sync.

      • filesFailed integer

        Number of files that failed to index.

      • filesProcessed integer

        Number of files processed so far.

      • overallPercent integer

        Aggregate indexing progress across the knowledgebase, 0-100.

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 knowledgebase is 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/knowledgebases/{id}
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.knowledgebases.getKnowledgebase(
'f256b3e4-03e0-4f74-ae46-a4d43882ee5d',
)
qlik knowledgebase get 'f256b3e4-03e0-4f74-ae46-a4d43882ee5d'
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/knowledgebases/{id}" \
-H "Authorization: Bearer <access_token>"

Example Response

{
"id": "f256b3e4-03e0-4f74-ae46-a4d43882ee5d",
"name": "Organization wide knowledgebase",
"tags": [
"Red",
"Sales"
],
"ownerId": "507f191e810c19729de860ea",
"spaceId": "507f191e810c19729de860ea",
"tenantId": "507f191e810c19729de860ea",
"createdAt": "2021-10-02T14:20:50.52Z",
"createdBy": "507f191e810c19729de860ea",
"updatedAt": "2021-10-02T14:20:50.52Z",
"updatedBy": "507f191e810c19729de860ea",
"description": "This knowledgebase is used for...",
"lastIndexedAt": "2021-10-02T14:20:50.52Z",
"contentSummary": {
"fileSize": 42,
"textSize": 42,
"fileCount": 42,
"effectivePages": 42
},
"advancedIndexing": true,
"selectedErrorsCount": 10,
"datasources": [
{
"id": "f256b3e4-03e0-4f74-ae46-a4d43882ee5d",
"name": "string",
"type": "file",
"spaceId": "507f191e810c19729de860ea",
"chunking": {
"size": 1024,
"type": "recursive",
"overlap": 20,
"separators": [
"\n",
".",
" "
],
"keepSeparator": false
},
"syncInfo": {
"status": "neverIndexed",
"startedAt": "2021-10-02T14:20:50.52Z",
"lastSyncId": "f256b3e4-03e0-4f74-ae46-a4d43882ee5d",
"completedAt": "2021-10-02T14:20:50.52Z"
},
"fileConfig": {
"files": [
"string"
],
"scope": {
"depth": 1,
"maxSize": 1000000,
"extensions": [
"pdf"
],
"maxFilesTotal": 50,
"modifiedAfter": "2021-10-02T14:20:50.52Z",
"maxFilesPerFolder": 100
},
"folder": "folderA/folderB",
"userId": "507f191e810c19729de860ea",
"connectionId": "f256b3e4-03e0-4f74-ae46-a4d43882ee5d",
"crawlPatterns": [
{
"type": "include",
"pattern": "(.*)example(.*)"
}
]
},
"sourceCount": 10,
"contentSummary": {
"fileSize": 42,
"textSize": 42,
"fileCount": 42,
"effectivePages": 42
}
}
],
"indexingProgress": {
"status": "inProgress",
"syncId": "f256b3e4-03e0-4f74-ae46-a4d43882ee5d",
"updatedAt": "2021-10-02T14:20:50.52Z",
"filesTotal": 100,
"filesFailed": 2,
"filesProcessed": 45,
"overallPercent": 45
}
}

Update a knowledgebase

Updates properties of a specific knowledgebase.

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 knowledgebase was fetched.

Path Parameters

  • id string
    Required

    The knowledgebase 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"

    • 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

Knowledgebase 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

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/knowledgebases/{id}
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.knowledgebases.patchKnowledgebase(
'f256b3e4-03e0-4f74-ae46-a4d43882ee5d',
[
{
op: 'replace',
path: '/name',
value: 'new name',
},
{
op: 'replace',
path: '/description',
value: 'new description',
},
],
)
qlik knowledgebase patch 'f256b3e4-03e0-4f74-ae46-a4d43882ee5d' \
--op 'replace' \
--path '/name' \
--value new name
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/knowledgebases/{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"}]'

Delete a knowledgebase

Deletes a knowledgebase and all of its resources.

Facts

Rate limit Tier 2 (100 requests per minute)

Path Parameters

  • id string
    Required

    The id of the knowledgebase 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 knowledgebase is 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/knowledgebases/{id}
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.knowledgebases.deleteKnowledgebase(
'f256b3e4-03e0-4f74-ae46-a4d43882ee5d',
)
qlik knowledgebase rm 'f256b3e4-03e0-4f74-ae46-a4d43882ee5d'
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/knowledgebases/{id}" \
-X DELETE \
-H "Authorization: Bearer <access_token>"

Search chunks from a knowledge base

Execute search with either SIMPLE or FULL mode. SIMPLE does semantic search while FULL will also do reranking and include keyword based chunks. 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

  • id string
    Required

    The ID of the knowledgebase

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

Knowledgebase 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/knowledgebases/{id}/actions/search
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.knowledgebases.searchKnowledgebase(
'507f191e810c19729de860ea',
{
prompt: 'What is LLM?',
searchMode: 'SIMPLE',
topN: 20,
},
)
qlik knowledgebase search '507f191e810c19729de860ea' \
--prompt 'What is LLM?'
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/knowledgebases/{id}/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
}
]
}

Add a datasource to a knowledgebase

Adds a datasource to a knowledgebase.

Facts

Rate limit Tier 2 (100 requests per minute)

Path Parameters

  • id string
    Required

    The id of the knowledgebase.

Request Body

  • application/json object

    Specification on where to fetch the files for. This is required when the type == 'file'. Only one of path and files can be set. Path takes precedence if both are provided.

    Show application/json properties
    • name string
      Required

      Name of the datasource

    • type string
      Required

      Can be one of: "file""web""database"

    • fileConfig object

      Specification on where to fetch the files for. This is required when the type == 'file'. Only one of path and files can be set. Path takes precedence if both are provided.

      Show fileConfig properties
      • files array of strings
      • scope object

        Scope for the file crawler.

        Show scope properties
        • depth integer
          Required

          The number of levels of sub folders that should be considered

        • maxSize integer

          Optional parameter. Max size of downloaded files in bytes

        • extensions array of strings

          list of file extensions to be considered

        • maxFilesTotal integer

          Total number of files that should be considered

        • modifiedAfter string

          only files modified after this time should be indexed. If set older files will be removed from index.

        • maxFilesPerFolder integer

          Maximum number of files per folder that should be considered

      • folder string

        Root folder for traversing.

      • userId string
        Required

        userId of the owner of the datasource fileConfig

      • connectionId string
        Required

        connection id to be used to retrieve the raw data

      • crawlPatterns array of objects

        Pattern matching links to crawl

        Show crawlPatterns properties
        • type string
          Required

          include or exclude

          Can be one of: "include""exclude"

        • pattern string
          Required

          Regex patterna to filter links on

Responses

201

Successfully added a datasource to the knowledgebase.

  • application/json object

    Specification on where to fetch the files for. This is required when the type == 'file'. Only one of path and files can be set. Path takes precedence if both are provided.

    Show application/json properties
    • id string
      Required

      Unique identifier of the datasource

    • name string

      Name of the datasource

    • type string
      Required

      Can be one of: "file""web""database"

    • spaceId string

      The unique identifier of the space containing the datasource

    • chunking object
      Show chunking properties
      • size integer
        Required

        Size of chunks

      • type string
        Required

        Chunking strategy

      • overlap integer
        Required

        Chunk overlap, should be less than size

      • separators array of strings
        Required

        List of separators to chunk by

      • keepSeparator boolean
        Required

        Allows to keep or remove separators used

    • syncInfo object
      Show syncInfo properties
      • status string
        Required

        Sync status

        Can be one of: "neverIndexed""progress""completed""completedWithError""toAdd""toDelete"

      • startedAt string
        Required

        Datetime when the sync task was started

      • lastSyncId string

        sync Id

      • completedAt string
        Required

        Datetime when the sync task was completed

    • fileConfig object

      Specification on where to fetch the files for. This is required when the type == 'file'. Only one of path and files can be set. Path takes precedence if both are provided.

      Show fileConfig properties
      • files array of strings
      • scope object

        Scope for the file crawler.

        Show scope properties
        • depth integer
          Required

          The number of levels of sub folders that should be considered

        • maxSize integer

          Optional parameter. Max size of downloaded files in bytes

        • extensions array of strings

          list of file extensions to be considered

        • maxFilesTotal integer

          Total number of files that should be considered

        • modifiedAfter string

          only files modified after this time should be indexed. If set older files will be removed from index.

        • maxFilesPerFolder integer

          Maximum number of files per folder that should be considered

      • folder string

        Root folder for traversing.

      • userId string
        Required

        userId of the owner of the datasource fileConfig

      • connectionId string
        Required

        connection id to be used to retrieve the raw data

      • crawlPatterns array of objects

        Pattern matching links to crawl

        Show crawlPatterns properties
        • type string
          Required

          include or exclude

          Can be one of: "include""exclude"

        • pattern string
          Required

          Regex patterna to filter links on

    • sourceCount integer

      The number of times that a datasource was referenced as a source in an answer

    • contentSummary object
      Required
      Show contentSummary properties
      • fileSize integer
        Required
      • textSize integer
        Required
      • fileCount integer
        Required
      • effectivePages integer
        Required

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 knowledgebase is 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/knowledgebases/{id}/datasources
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.knowledgebases.createKnowledgebaseDatasource(
'f256b3e4-03e0-4f74-ae46-a4d43882ee5d',
{
fileConfig: {
connectionId:
'f256b3e4-03e0-4f74-ae46-a4d43882ee5d',
crawlPatterns: [
{
pattern: '(.*)example(.*)',
type: 'include',
},
],
files: ['string'],
folder: 'folderA/folderB',
scope: {
depth: 1,
extensions: ['pdf'],
maxFilesPerFolder: 100,
maxFilesTotal: 50,
maxSize: 1000000,
modifiedAfter: '2021-10-02T14:20:50.52Z',
},
userId: '507f191e810c19729de860ea',
},
name: 'string',
type: 'file',
},
)
qlik knowledgebase datasource create \
--knowledgebaseId 'f256b3e4-03e0-4f74-ae46-a4d43882ee5d' \
--fileConfig-connectionId 'f256b3e4-03e0-4f74-ae46-a4d43882ee5d' \
--fileConfig-crawlPatterns-pattern '' \
--fileConfig-crawlPatterns-type '' \
--fileConfig-scope-depth 1 \
--fileConfig-userId '507f191e810c19729de860ea' \
--name 'string' \
--type 'file'
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/knowledgebases/{id}/datasources" \
-X POST \
-H "Content-type: application/json" \
-H "Authorization: Bearer <access_token>" \
-d '{"name":"string","type":"file","fileConfig":{"files":["string"],"scope":{"depth":1,"maxSize":1000000,"extensions":["pdf"],"maxFilesTotal":50,"modifiedAfter":"2021-10-02T14:20:50.52Z","maxFilesPerFolder":100},"folder":"folderA/folderB","userId":"507f191e810c19729de860ea","connectionId":"f256b3e4-03e0-4f74-ae46-a4d43882ee5d","crawlPatterns":[{"type":"include","pattern":"(.*)example(.*)"}]}}'

Example Response

{
"id": "f256b3e4-03e0-4f74-ae46-a4d43882ee5d",
"name": "string",
"type": "file",
"spaceId": "507f191e810c19729de860ea",
"chunking": {
"size": 1024,
"type": "recursive",
"overlap": 20,
"separators": [
"\n",
".",
" "
],
"keepSeparator": false
},
"syncInfo": {
"status": "neverIndexed",
"startedAt": "2021-10-02T14:20:50.52Z",
"lastSyncId": "f256b3e4-03e0-4f74-ae46-a4d43882ee5d",
"completedAt": "2021-10-02T14:20:50.52Z"
},
"fileConfig": {
"files": [
"string"
],
"scope": {
"depth": 1,
"maxSize": 1000000,
"extensions": [
"pdf"
],
"maxFilesTotal": 50,
"modifiedAfter": "2021-10-02T14:20:50.52Z",
"maxFilesPerFolder": 100
},
"folder": "folderA/folderB",
"userId": "507f191e810c19729de860ea",
"connectionId": "f256b3e4-03e0-4f74-ae46-a4d43882ee5d",
"crawlPatterns": [
{
"type": "include",
"pattern": "(.*)example(.*)"
}
]
},
"sourceCount": 10,
"contentSummary": {
"fileSize": 42,
"textSize": 42,
"fileCount": 42,
"effectivePages": 42
}
}

Update a knowledgebase datasource

Updates a specified datasource.

Facts

Rate limit Tier 2 (100 requests per minute)

Path Parameters

  • datasourceId string
    Required

    The id of the datasource to update.

  • id string
    Required

    The id of a knowledgebase.

Request Body

  • application/json object

    Specification on where to fetch the files for. This is required when the type == 'file'. Only one of path and files can be set. Path takes precedence if both are provided.

    Show application/json properties
    • id string
      Required

      Unique identifier of the datasource

    • name string

      Name of the datasource

    • type string
      Required

      Can be one of: "file""web""database"

    • spaceId string

      The unique identifier of the space containing the datasource

    • chunking object
      Show chunking properties
      • size integer
        Required

        Size of chunks

      • type string
        Required

        Chunking strategy

      • overlap integer
        Required

        Chunk overlap, should be less than size

      • separators array of strings
        Required

        List of separators to chunk by

      • keepSeparator boolean
        Required

        Allows to keep or remove separators used

    • syncInfo object
      Show syncInfo properties
      • lastSyncId string

        sync Id

    • fileConfig object

      Specification on where to fetch the files for. This is required when the type == 'file'. Only one of path and files can be set. Path takes precedence if both are provided.

      Show fileConfig properties
      • files array of strings
      • scope object

        Scope for the file crawler.

        Show scope properties
        • depth integer
          Required

          The number of levels of sub folders that should be considered

        • maxSize integer

          Optional parameter. Max size of downloaded files in bytes

        • extensions array of strings

          list of file extensions to be considered

        • maxFilesTotal integer

          Total number of files that should be considered

        • modifiedAfter string

          only files modified after this time should be indexed. If set older files will be removed from index.

        • maxFilesPerFolder integer

          Maximum number of files per folder that should be considered

      • folder string

        Root folder for traversing.

      • userId string
        Required

        userId of the owner of the datasource fileConfig

      • connectionId string
        Required

        connection id to be used to retrieve the raw data

      • crawlPatterns array of objects

        Pattern matching links to crawl

        Show crawlPatterns properties
        • type string
          Required

          include or exclude

          Can be one of: "include""exclude"

        • pattern string
          Required

          Regex patterna to filter links on

    • sourceCount integer

      The number of times that a datasource was referenced as a source in an answer

    • contentSummary object
      Required
      Show contentSummary properties
      • fileSize integer
        Required
      • textSize integer
        Required
      • fileCount integer
        Required
      • effectivePages integer
        Required

Responses

200

Successfully updated the datasource.

  • application/json object

    Specification on where to fetch the files for. This is required when the type == 'file'. Only one of path and files can be set. Path takes precedence if both are provided.

    Show application/json properties
    • id string
      Required

      Unique identifier of the datasource

    • name string

      Name of the datasource

    • type string
      Required

      Can be one of: "file""web""database"

    • spaceId string

      The unique identifier of the space containing the datasource

    • chunking object
      Show chunking properties
      • size integer
        Required

        Size of chunks

      • type string
        Required

        Chunking strategy

      • overlap integer
        Required

        Chunk overlap, should be less than size

      • separators array of strings
        Required

        List of separators to chunk by

      • keepSeparator boolean
        Required

        Allows to keep or remove separators used

    • syncInfo object
      Show syncInfo properties
      • status string
        Required

        Sync status

        Can be one of: "neverIndexed""progress""completed""completedWithError""toAdd""toDelete"

      • startedAt string
        Required

        Datetime when the sync task was started

      • lastSyncId string

        sync Id

      • completedAt string
        Required

        Datetime when the sync task was completed

    • fileConfig object

      Specification on where to fetch the files for. This is required when the type == 'file'. Only one of path and files can be set. Path takes precedence if both are provided.

      Show fileConfig properties
      • files array of strings
      • scope object

        Scope for the file crawler.

        Show scope properties
        • depth integer
          Required

          The number of levels of sub folders that should be considered

        • maxSize integer

          Optional parameter. Max size of downloaded files in bytes

        • extensions array of strings

          list of file extensions to be considered

        • maxFilesTotal integer

          Total number of files that should be considered

        • modifiedAfter string

          only files modified after this time should be indexed. If set older files will be removed from index.

        • maxFilesPerFolder integer

          Maximum number of files per folder that should be considered

      • folder string

        Root folder for traversing.

      • userId string
        Required

        userId of the owner of the datasource fileConfig

      • connectionId string
        Required

        connection id to be used to retrieve the raw data

      • crawlPatterns array of objects

        Pattern matching links to crawl

        Show crawlPatterns properties
        • type string
          Required

          include or exclude

          Can be one of: "include""exclude"

        • pattern string
          Required

          Regex patterna to filter links on

    • sourceCount integer

      The number of times that a datasource was referenced as a source in an answer

    • contentSummary object
      Required
      Show contentSummary properties
      • fileSize integer
        Required
      • textSize integer
        Required
      • fileCount integer
        Required
      • effectivePages integer
        Required

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 is 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/knowledgebases/{id}/datasources/{datasourceId}
// qlik-api has not implemented support for `PUT /api/v1/knowledgebases/{id}/datasources/{datasourceId}` yet.
// In the meantime, you can use fetch like this:
const response = await fetch(
'/api/v1/knowledgebases/{id}/datasources/{datasourceId}',
{
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
id: 'f256b3e4-03e0-4f74-ae46-a4d43882ee5d',
name: 'string',
type: 'file',
spaceId: '507f191e810c19729de860ea',
chunking: {
size: 1024,
type: 'recursive',
overlap: 20,
separators: ['\n', '.', ' '],
keepSeparator: false,
},
syncInfo: {
lastSyncId:
'f256b3e4-03e0-4f74-ae46-a4d43882ee5d',
},
fileConfig: {
files: ['string'],
scope: {
depth: 1,
maxSize: 1000000,
extensions: ['pdf'],
maxFilesTotal: 50,
modifiedAfter:
'2021-10-02T14:20:50.52Z',
maxFilesPerFolder: 100,
},
folder: 'folderA/folderB',
userId: '507f191e810c19729de860ea',
connectionId:
'f256b3e4-03e0-4f74-ae46-a4d43882ee5d',
crawlPatterns: [
{
type: 'include',
pattern: '(.*)example(.*)',
},
],
},
sourceCount: 10,
contentSummary: {
fileSize: 42,
textSize: 42,
fileCount: 42,
effectivePages: 42,
},
}),
},
)
qlik knowledgebase datasource update 'f256b3e4-03e0-4f74-ae46-a4d43882ee5d' \
--knowledgebaseId 'f256b3e4-03e0-4f74-ae46-a4d43882ee5d' \
--chunking-keepSeparator false \
--chunking-overlap 20 \
--chunking-separators '
,., ' \
--chunking-size 1024 \
--chunking-type 'recursive' \
--contentSummary-effectivePages 42 \
--contentSummary-fileCount 42 \
--contentSummary-fileSize 42 \
--contentSummary-textSize 42 \
--fileConfig-connectionId 'f256b3e4-03e0-4f74-ae46-a4d43882ee5d' \
--fileConfig-crawlPatterns-pattern '' \
--fileConfig-crawlPatterns-type '' \
--fileConfig-scope-depth 1 \
--fileConfig-userId '507f191e810c19729de860ea' \
--id-in-body 'f256b3e4-03e0-4f74-ae46-a4d43882ee5d' \
--type 'file'
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/knowledgebases/{id}/datasources/{datasourceId}" \
-X PUT \
-H "Content-type: application/json" \
-H "Authorization: Bearer <access_token>" \
-d '{"id":"f256b3e4-03e0-4f74-ae46-a4d43882ee5d","name":"string","type":"file","spaceId":"507f191e810c19729de860ea","chunking":{"size":1024,"type":"recursive","overlap":20,"separators":["\n","."," "],"keepSeparator":false},"syncInfo":{"lastSyncId":"f256b3e4-03e0-4f74-ae46-a4d43882ee5d"},"fileConfig":{"files":["string"],"scope":{"depth":1,"maxSize":1000000,"extensions":["pdf"],"maxFilesTotal":50,"modifiedAfter":"2021-10-02T14:20:50.52Z","maxFilesPerFolder":100},"folder":"folderA/folderB","userId":"507f191e810c19729de860ea","connectionId":"f256b3e4-03e0-4f74-ae46-a4d43882ee5d","crawlPatterns":[{"type":"include","pattern":"(.*)example(.*)"}]},"sourceCount":10,"contentSummary":{"fileSize":42,"textSize":42,"fileCount":42,"effectivePages":42}}'

Example Response

{
"id": "f256b3e4-03e0-4f74-ae46-a4d43882ee5d",
"name": "string",
"type": "file",
"spaceId": "507f191e810c19729de860ea",
"chunking": {
"size": 1024,
"type": "recursive",
"overlap": 20,
"separators": [
"\n",
".",
" "
],
"keepSeparator": false
},
"syncInfo": {
"status": "neverIndexed",
"startedAt": "2021-10-02T14:20:50.52Z",
"lastSyncId": "f256b3e4-03e0-4f74-ae46-a4d43882ee5d",
"completedAt": "2021-10-02T14:20:50.52Z"
},
"fileConfig": {
"files": [
"string"
],
"scope": {
"depth": 1,
"maxSize": 1000000,
"extensions": [
"pdf"
],
"maxFilesTotal": 50,
"modifiedAfter": "2021-10-02T14:20:50.52Z",
"maxFilesPerFolder": 100
},
"folder": "folderA/folderB",
"userId": "507f191e810c19729de860ea",
"connectionId": "f256b3e4-03e0-4f74-ae46-a4d43882ee5d",
"crawlPatterns": [
{
"type": "include",
"pattern": "(.*)example(.*)"
}
]
},
"sourceCount": 10,
"contentSummary": {
"fileSize": 42,
"textSize": 42,
"fileCount": 42,
"effectivePages": 42
}
}

Delete a knowledgebase datasource

Deletes a specified datasource and all its resources.

Facts

Rate limit Tier 2 (100 requests per minute)

Path Parameters

  • datasourceId string
    Required

    The id of the datasource to delete.

  • id string
    Required

    The id of the knowledgebase the datasource belongs to.

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 knowledgebase is 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/knowledgebases/{id}/datasources/{datasourceId}
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.knowledgebases.deleteKnowledgebaseDatasource(
'f256b3e4-03e0-4f74-ae46-a4d43882ee5d',
'f256b3e4-03e0-4f74-ae46-a4d43882ee5d',
)
qlik knowledgebase datasource rm 'f256b3e4-03e0-4f74-ae46-a4d43882ee5d' \
--knowledgebaseId 'f256b3e4-03e0-4f74-ae46-a4d43882ee5d'
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/knowledgebases/{id}/datasources/{datasourceId}" \
-X DELETE \
-H "Authorization: Bearer <access_token>"

Cancel sync of a knowledgebase datasource

Cancels ongoing sync for a specified datasource.

Facts

Rate limit Tier 2 (100 requests per minute)

Path Parameters

  • datasourceId string
    Required

    The id of the datasource to cancel sync for.

  • id string
    Required

    The id of the knowledgebase the datasource belongs to.

Responses

200

Successfully cancelled sync.

  • application/json object

    Response when a datasource sync is started, contains the sync Id

    Show application/json properties
    • id string
      Required

      Unique identifier of the sync

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 does not exist.

  • 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/knowledgebases/{id}/datasources/{datasourceId}/actions/cancel
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.knowledgebases.cancelKnowledgebaseDatasource(
'f256b3e4-03e0-4f74-ae46-a4d43882ee5d',
'f256b3e4-03e0-4f74-ae46-a4d43882ee5d',
)
qlik knowledgebase datasource cancel \
--knowledgebaseId 'f256b3e4-03e0-4f74-ae46-a4d43882ee5d' \
--datasourceId 'f256b3e4-03e0-4f74-ae46-a4d43882ee5d'
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/knowledgebases/{id}/datasources/{datasourceId}/actions/cancel" \
-X POST \
-H "Authorization: Bearer <access_token>"

Example Response

{
"id": "f256b3e4-03e0-4f74-ae46-a4d43882ee5d"
}

Download knowledgebase datasource reference

Downloads a specified reference.

Facts

Rate limit Tier 2 (100 requests per minute)

Path Parameters

  • datasourceId string
    Required

    The id of the datasource to download from.

  • id string
    Required

    The id of the knowledgebase the datasource belongs to.

Request Body

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

      file path to the file to downlaod.

Responses

200

Download a file from a datasource.

  • application/json object

    Download information for the file.

    Show application/json properties
    • url string
      Required

      URL to download the file.

    • name string
      Required

      The requested file name.

    • spaceId string
      Required

      Space id the file belongs in.

    • fileSize integer
      Required

      Size of downloaded file.

    • mimeType string
      Required

      The mimetype of the file.

    • lastUpdatedAt string
      Required

      Date for last time the file was modified.

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 does not exist.

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

409

The data connection credentials are missing, expired, or no longer valid and must be reauthenticated.

  • 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/knowledgebases/{id}/datasources/{datasourceId}/actions/download
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.knowledgebases.downloadKnowledgebaseDatasource(
'f256b3e4-03e0-4f74-ae46-a4d43882ee5d',
'f256b3e4-03e0-4f74-ae46-a4d43882ee5d',
{ path: 'folder/file.pdf' },
)
qlik knowledgebase datasource download \
--knowledgebaseId 'f256b3e4-03e0-4f74-ae46-a4d43882ee5d' \
--datasourceId 'f256b3e4-03e0-4f74-ae46-a4d43882ee5d' \
--path 'folder/file.pdf'
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/knowledgebases/{id}/datasources/{datasourceId}/actions/download" \
-X POST \
-H "Content-type: application/json" \
-H "Authorization: Bearer <access_token>" \
-d '{"path":"folder/file.pdf"}'

Example Response

{
"url": "/v1/temp-contents/65f4287d785c400fe6d1e861",
"name": "stories/content/billy.txt",
"spaceId": "507f191e810c19729de860ea",
"fileSize": 542,
"mimeType": "text/plain",
"lastUpdatedAt": "2020-04-16T23:17:28Z"
}

Sync a knowledgebase datasource

Starts syncing a specified datasource to a specified knowledgebase index.

Facts

Rate limit Tier 2 (100 requests per minute)

Query Parameters

  • migrate boolean

    Optional parameter to migrate indexed files to docdetails collection

Path Parameters

  • datasourceId string
    Required

    The id of the datasource to sync.

  • id string
    Required

    The id of the knowledgebase the datasource belongs to.

Responses

202

Successfully started sync.

  • application/json object

    Response when a datasource sync is started, contains the sync Id

    Show application/json properties
    • id string
      Required

      Unique identifier of the sync

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 does not exist.

  • 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/knowledgebases/{id}/datasources/{datasourceId}/actions/sync
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.knowledgebases.syncKnowledgebaseDatasource(
'f256b3e4-03e0-4f74-ae46-a4d43882ee5d',
'f256b3e4-03e0-4f74-ae46-a4d43882ee5d',
{},
)
qlik knowledgebase datasource sync \
--knowledgebaseId 'f256b3e4-03e0-4f74-ae46-a4d43882ee5d' \
--datasourceId 'f256b3e4-03e0-4f74-ae46-a4d43882ee5d'
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/knowledgebases/{id}/datasources/{datasourceId}/actions/sync" \
-X POST \
-H "Authorization: Bearer <access_token>"

Example Response

{
"id": "f256b3e4-03e0-4f74-ae46-a4d43882ee5d"
}

List knowledgebase datasource sync histories

Retrieves sync history for a specified datasource in a knowledgebase. Returns a 404 if there is no sync history, or if the calling user doesn't have access to the datasource.

Facts

Rate limit Tier 1 (1000 requests per minute)

Query Parameters

  • limit integer

    The number of knowledgebases 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, eg. name. Can be prefixed with - to set descending order, defaults to ascending.

    Can be one of: "COMPLETED""-COMPLETED"

Path Parameters

  • datasourceId string
    Required

    The id of the datasource.

  • id string
    Required

    The id of the knowledgebase the datasource belongs to.

Responses

200

List of sync items ordered by the completed time.

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

        sync id

      • status string
        Required

        Sync status

        Can be one of: "neverIndexed""progress""completed""completedWithError"

      • docStats object
        Required

        Summary of documents processed

        Show docStats properties
        • added integer
          Required
        • errors integer
          Required
        • deleted integer
          Required
        • updated integer
          Required
        • deltaBytes integer
          Required
        • deltaTextSize integer
          Required
        • largestFileSize integer
          Required
        • deltaEffectivePages integer
          Required
        • totalBytesProcessed integer
          Required
      • startedAt string
        Required

        Datetime when the sync task was started

      • completedAt string

        Datetime when the sync task was completed

      • triggerType string
        Required

        Datasource trigger type, was it manually or automatically synced

      • connectionId string
        Required

        Connection id that the datasource used

      • datasourceId string
        Required

        datasource id

      • errorSummary array of objects

        Aggregated, deduplicated view of failures grouped by error code. Lets the UI surface a smart summary (e.g. "1000 files failed to parse") instead of a flat list of raw error strings.

        Show errorSummary properties
        • code string
          Required

          Stable, machine-readable error category shared across services and the UI.

          Can be one of: "unknown""file_size_exceeded""download_failed""parse_failed""parse_timeout""chunk_failed""chunk_timeout""guardrail_blocked""unsupported_file""index_verification_failed""file_not_found""document_has_macros""scan_failed""pages_limit_exceeded""pages_enforcement_failed""governance_budget_exceeded"

        • count integer
          Required

          Number of files that failed with this error code.

        • sample string

          A representative (sanitized) error message for this category.

        • sources array of strings

          Up to selectedErrorsCount example sources that failed with this code.

      • selectedErrors array of strings

        populated with up to the first selectedErrorsCount errors if there were any during sync

    • 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

404

The datasource is not found, the datasource has no sync history (no syncs have been run), or the calling user doesn't have access to this datasource in the knowledgebase.

  • 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/knowledgebases/{id}/datasources/{datasourceId}/histories
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.knowledgebases.getKnowledgebaseDatasourceHistories(
'f256b3e4-03e0-4f74-ae46-a4d43882ee5d',
'f256b3e4-03e0-4f74-ae46-a4d43882ee5d',
{},
)
qlik knowledgebase datasource history ls \
--knowledgebaseId 'f256b3e4-03e0-4f74-ae46-a4d43882ee5d' \
--datasourceId 'f256b3e4-03e0-4f74-ae46-a4d43882ee5d'
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/knowledgebases/{id}/datasources/{datasourceId}/histories" \
-H "Authorization: Bearer <access_token>"

Example Response

{
"data": [
{
"id": "f256b3e4-03e0-4f74-ae46-a4d43882ee5d",
"status": [
"neverIndexed | progress | completed | completedWithError"
],
"docStats": {
"added": 1,
"errors": 0,
"deleted": 0,
"updated": 0,
"deltaBytes": 0,
"deltaTextSize": 0,
"largestFileSize": 123044444,
"deltaEffectivePages": 0,
"totalBytesProcessed": 123044444
},
"startedAt": "2021-10-02T14:20:50.52Z",
"completedAt": "2021-10-02T14:20:50.52Z",
"triggerType": [
"manual | schedule"
],
"connectionId": "ee6a390c-5d33-11e8-9c2d-fa7ae01bbebc",
"datasourceId": "f256b3e4-03e0-4f74-ae46-a4d43882ee5d",
"errorSummary": [
{
"code": "string",
"count": 1000,
"sample": "failed to parse document",
"sources": [
"myfile.pdf"
]
}
],
"selectedErrors": [
"unsupported file extension"
]
}
],
"meta": {
"countTotal": 42
},
"links": {
"next": {
"href": "string"
},
"prev": {
"href": "string"
},
"self": {
"href": "string"
}
}
}

Retrieve a knowledgebase datasource sync history

Deprecated

Retrieves detailed sync history for a specified datasource.

Facts

Rate limit Tier 1 (1000 requests per minute)
Deprecated This endpoint is deprecated and will eventually be removed. Read our API policy here.

Path Parameters

  • datasourceId string
    Required

    The id of the datasource.

  • id string
    Required

    The id of the knowledgebase the datasource belongs to.

  • syncId string
    Required

    The sync identifier.

Responses

200

List of sync items ordered by the start time.

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

      document Id

    • error string

      error if one happened during sync

    • action string
      Required

      acion performed

      Can be one of: "add""delete""update"

    • chunks integer

      number of chunks

    • source string
      Required

      Source of the document

    • syncId string
      Required

      sync Id

    • duration object
      Show duration properties
      • chunk integer
        Required
      • embed integer
        Required
      • parse integer
        Required
      • store integer
        Required
      • download integer
        Required
    • fileSize integer

      file size

    • syncedAt string
      Required

      Datetime when the sync task was executed

    • chunkSize integer

      chunk size

    • errorCode string

      Stable, machine-readable error category for the failure, allowing the UI to map it to a friendly message without brittle string matching. Only populated when the file failed to index.

      Can be one of: "unknown""file_size_exceeded""download_failed""parse_failed""parse_timeout""chunk_failed""chunk_timeout""guardrail_blocked""unsupported_file""index_verification_failed""file_not_found""document_has_macros""scan_failed""pages_limit_exceeded""pages_enforcement_failed""governance_budget_exceeded"

    • explicitPages integer
      Required

      page count

    • fileStartedAt string

      Datetime when the file processing started

    • fileCompletedAt string

      Datetime when the file processing finished

    • fileLastModified string

      Datetime when the file was last modified

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 does not exist.

  • 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/knowledgebases/{id}/datasources/{datasourceId}/histories/{syncId}
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.knowledgebases.getKnowledgebaseDatasourceHistory(
'f256b3e4-03e0-4f74-ae46-a4d43882ee5d',
'f256b3e4-03e0-4f74-ae46-a4d43882ee5d',
'f256b3e4-03e0-4f74-ae46-a4d43882ee5d',
)
# qlik-cli has not implemented support for GET /api/v1/knowledgebases/{id}/datasources/{datasourceId}/histories/{syncId} yet.
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/knowledgebases/{id}/datasources/{datasourceId}/histories/{syncId}" \
-H "Authorization: Bearer <access_token>"

Example Response

{
"id": "f256b3e4-03e0-4f74-ae46-a4d43882ee5d",
"error": "unsupported file extension",
"action": "add",
"chunks": 10,
"source": "myfile.pdf",
"syncId": "f256b3e4-03e0-4f74-ae46-a4d43882ee5d",
"duration": {
"chunk": 0,
"embed": 996,
"parse": 0,
"store": 3653363805,
"download": 207
},
"fileSize": 123044444,
"syncedAt": "2021-10-02T14:20:50.52Z",
"chunkSize": 14721,
"errorCode": "string",
"explicitPages": 42,
"fileStartedAt": "2021-10-02T14:20:50.52Z",
"fileCompletedAt": "2021-10-02T14:21:50.52Z",
"fileLastModified": "2024-02-16T20:06:02Z"
}

Get a knowledgebase datasource schedule

Returns a datasource schedule.

Facts

Rate limit Tier 1 (1000 requests per minute)

Path Parameters

  • datasourceId string
    Required

    The id of the datasource the schedule belongs to.

  • id string
    Required

    The id of the knowledgebase the schedule belongs to.

Responses

200

Successfully created a schedule.

  • application/json object
    Show application/json properties
    • ownerId string
      Required
    • spaceId string
    • tenantId string
      Required
    • calendars array of objects
      Required

      An event specification relative to the calendar, similar to a traditional cron specification.

      Show calendars properties
      • hour array of objects
        Required

        Hour range to match (0-23). Default matches 0

        Show hour properties
        • end integer

          End of the range (inclusive). If end < start, then end is interpreted as equal to start. Optional, defaulted to Start

        • step integer

          Step to be take between each value. Optional, defaulted to 1

        • start integer
          Required

          Start of the range (inclusive)

      • year array of objects
        Required

        Year range to match. Default matches all years

        Show year properties
        • end integer

          End of the range (inclusive). If end < start, then end is interpreted as equal to start. Optional, defaulted to Start

        • step integer

          Step to be take between each value. Optional, defaulted to 1

        • start integer
          Required

          Start of the range (inclusive)

      • month array of objects
        Required

        Month range to match (1-12). Default matches all months

        Show month properties
        • end integer

          End of the range (inclusive). If end < start, then end is interpreted as equal to start. Optional, defaulted to Start

        • step integer

          Step to be take between each value. Optional, defaulted to 1

        • start integer
          Required

          Start of the range (inclusive)

      • minute array of objects
        Required

        Minute range to match (0-59). Default matches 0

        Show minute properties
        • end integer

          End of the range (inclusive). If end < start, then end is interpreted as equal to start. Optional, defaulted to Start

        • step integer

          Step to be take between each value. Optional, defaulted to 1

        • start integer
          Required

          Start of the range (inclusive)

      • second array of objects
        Required

        Second range to match (0-59). Default matches 0

        Show second properties
        • end integer

          End of the range (inclusive). If end < start, then end is interpreted as equal to start. Optional, defaulted to Start

        • step integer

          Step to be take between each value. Optional, defaulted to 1

        • start integer
          Required

          Start of the range (inclusive)

      • comment string
        Required

        Description of the intention of this schedule

      • dayOfWeek array of objects
        Required

        DayOfWeek range to match (0-6; 0 is Sunday). Default matches all days of the week

        Show dayOfWeek properties
        • end integer

          End of the range (inclusive). If end < start, then end is interpreted as equal to start. Optional, defaulted to Start

        • step integer

          Step to be take between each value. Optional, defaulted to 1

        • start integer
          Required

          Start of the range (inclusive)

      • dayOfMonth array of objects
        Required

        DayOfMonth range to match (1-31). Default matches all days

        Show dayOfMonth properties
        • end integer

          End of the range (inclusive). If end < start, then end is interpreted as equal to start. Optional, defaulted to Start

        • step integer

          Step to be take between each value. Optional, defaulted to 1

        • start integer
          Required

          Start of the range (inclusive)

    • intervals array of objects

      For example, an every of 1 hour with offset of zero would match every hour, on the hour. The same every but an offset of 19 minutes would match every xx:19:00.

      Show intervals properties
      • every string
        Required

        The period to repeat the interval

      • offset string

        A fixed offset added to the intervals period. Optional, defaults to 0

    • datasourceId string
    • knowledgebaseId string
      Required

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 does not exist.

  • 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/knowledgebases/{id}/datasources/{datasourceId}/schedules
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.knowledgebases.getKnowledgebaseDatasourceSchedule(
'f256b3e4-03e0-4f74-ae46-a4d43882ee5d',
'f256b3e4-03e0-4f74-ae46-a4d43882ee5d',
)
qlik knowledgebase datasource schedule get \
--knowledgebaseId 'f256b3e4-03e0-4f74-ae46-a4d43882ee5d' \
--datasourceId 'f256b3e4-03e0-4f74-ae46-a4d43882ee5d'
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/knowledgebases/{id}/datasources/{datasourceId}/schedules" \
-H "Authorization: Bearer <access_token>"

Example Response

{
"ownerId": "507f191e810c19729de860ed",
"spaceId": "507f191e810c19729de860ec",
"tenantId": "507f191e810c19729de860eb",
"calendars": [
{
"hour": [
{
"end": 42,
"step": 1,
"start": 42
}
],
"year": [
{
"end": 42,
"step": 1,
"start": 42
}
],
"month": [
{
"end": 42,
"step": 1,
"start": 42
}
],
"minute": [
{
"end": 42,
"step": 1,
"start": 42
}
],
"second": [
{
"end": 42,
"step": 1,
"start": 42
}
],
"comment": "string",
"dayOfWeek": [
{
"end": 42,
"step": 1,
"start": 42
}
],
"dayOfMonth": [
{
"end": 42,
"step": 1,
"start": 42
}
]
}
],
"intervals": [
{
"every": "5h30m",
"offset": "0s"
}
],
"datasourceId": "f256b3e4-03e0-4f74-ae46-a4d43882ee5d",
"knowledgebaseId": "f256b3e4-03e0-4f74-ae46-a4d43882ee5d"
}

Create a knowledgebase datasource schedule

Creates or updates a specified datasource schedule.

Facts

Rate limit Tier 2 (100 requests per minute)

Path Parameters

  • datasourceId string
    Required

    The id of the datasource the schedule belongs to.

  • id string
    Required

    The id of the knowledgebase the schedule belongs to.

Request Body

  • application/json object
    Show application/json properties
    • calendars array of objects

      An event specification relative to the calendar, similar to a traditional cron specification.

      Show calendars properties
      • hour array of objects
        Required

        Hour range to match (0-23). Default matches 0

        Show hour properties
        • end integer

          End of the range (inclusive). If end < start, then end is interpreted as equal to start. Optional, defaulted to Start

        • step integer

          Step to be take between each value. Optional, defaulted to 1

        • start integer
          Required

          Start of the range (inclusive)

      • year array of objects
        Required

        Year range to match. Default matches all years

        Show year properties
        • end integer

          End of the range (inclusive). If end < start, then end is interpreted as equal to start. Optional, defaulted to Start

        • step integer

          Step to be take between each value. Optional, defaulted to 1

        • start integer
          Required

          Start of the range (inclusive)

      • month array of objects
        Required

        Month range to match (1-12). Default matches all months

        Show month properties
        • end integer

          End of the range (inclusive). If end < start, then end is interpreted as equal to start. Optional, defaulted to Start

        • step integer

          Step to be take between each value. Optional, defaulted to 1

        • start integer
          Required

          Start of the range (inclusive)

      • minute array of objects
        Required

        Minute range to match (0-59). Default matches 0

        Show minute properties
        • end integer

          End of the range (inclusive). If end < start, then end is interpreted as equal to start. Optional, defaulted to Start

        • step integer

          Step to be take between each value. Optional, defaulted to 1

        • start integer
          Required

          Start of the range (inclusive)

      • second array of objects
        Required

        Second range to match (0-59). Default matches 0

        Show second properties
        • end integer

          End of the range (inclusive). If end < start, then end is interpreted as equal to start. Optional, defaulted to Start

        • step integer

          Step to be take between each value. Optional, defaulted to 1

        • start integer
          Required

          Start of the range (inclusive)

      • comment string
        Required

        Description of the intention of this schedule

      • dayOfWeek array of objects
        Required

        DayOfWeek range to match (0-6; 0 is Sunday). Default matches all days of the week

        Show dayOfWeek properties
        • end integer

          End of the range (inclusive). If end < start, then end is interpreted as equal to start. Optional, defaulted to Start

        • step integer

          Step to be take between each value. Optional, defaulted to 1

        • start integer
          Required

          Start of the range (inclusive)

      • dayOfMonth array of objects
        Required

        DayOfMonth range to match (1-31). Default matches all days

        Show dayOfMonth properties
        • end integer

          End of the range (inclusive). If end < start, then end is interpreted as equal to start. Optional, defaulted to Start

        • step integer

          Step to be take between each value. Optional, defaulted to 1

        • start integer
          Required

          Start of the range (inclusive)

    • intervals array of objects

      For example, an every of 1 hour with offset of zero would match every hour, on the hour. The same every but an offset of 19 minutes would match every xx:19:00.

      Show intervals properties
      • every string
        Required

        The period to repeat the interval

      • offset string

        A fixed offset added to the intervals period. Optional, defaults to 0

Responses

200

Successfully created a schedule.

  • application/json object
    Show application/json properties
    • ownerId string
      Required
    • spaceId string
    • tenantId string
      Required
    • calendars array of objects
      Required

      An event specification relative to the calendar, similar to a traditional cron specification.

      Show calendars properties
      • hour array of objects
        Required

        Hour range to match (0-23). Default matches 0

        Show hour properties
        • end integer

          End of the range (inclusive). If end < start, then end is interpreted as equal to start. Optional, defaulted to Start

        • step integer

          Step to be take between each value. Optional, defaulted to 1

        • start integer
          Required

          Start of the range (inclusive)

      • year array of objects
        Required

        Year range to match. Default matches all years

        Show year properties
        • end integer

          End of the range (inclusive). If end < start, then end is interpreted as equal to start. Optional, defaulted to Start

        • step integer

          Step to be take between each value. Optional, defaulted to 1

        • start integer
          Required

          Start of the range (inclusive)

      • month array of objects
        Required

        Month range to match (1-12). Default matches all months

        Show month properties
        • end integer

          End of the range (inclusive). If end < start, then end is interpreted as equal to start. Optional, defaulted to Start

        • step integer

          Step to be take between each value. Optional, defaulted to 1

        • start integer
          Required

          Start of the range (inclusive)

      • minute array of objects
        Required

        Minute range to match (0-59). Default matches 0

        Show minute properties
        • end integer

          End of the range (inclusive). If end < start, then end is interpreted as equal to start. Optional, defaulted to Start

        • step integer

          Step to be take between each value. Optional, defaulted to 1

        • start integer
          Required

          Start of the range (inclusive)

      • second array of objects
        Required

        Second range to match (0-59). Default matches 0

        Show second properties
        • end integer

          End of the range (inclusive). If end < start, then end is interpreted as equal to start. Optional, defaulted to Start

        • step integer

          Step to be take between each value. Optional, defaulted to 1

        • start integer
          Required

          Start of the range (inclusive)

      • comment string
        Required

        Description of the intention of this schedule

      • dayOfWeek array of objects
        Required

        DayOfWeek range to match (0-6; 0 is Sunday). Default matches all days of the week

        Show dayOfWeek properties
        • end integer

          End of the range (inclusive). If end < start, then end is interpreted as equal to start. Optional, defaulted to Start

        • step integer

          Step to be take between each value. Optional, defaulted to 1

        • start integer
          Required

          Start of the range (inclusive)

      • dayOfMonth array of objects
        Required

        DayOfMonth range to match (1-31). Default matches all days

        Show dayOfMonth properties
        • end integer

          End of the range (inclusive). If end < start, then end is interpreted as equal to start. Optional, defaulted to Start

        • step integer

          Step to be take between each value. Optional, defaulted to 1

        • start integer
          Required

          Start of the range (inclusive)

    • intervals array of objects

      For example, an every of 1 hour with offset of zero would match every hour, on the hour. The same every but an offset of 19 minutes would match every xx:19:00.

      Show intervals properties
      • every string
        Required

        The period to repeat the interval

      • offset string

        A fixed offset added to the intervals period. Optional, defaults to 0

    • datasourceId string
    • knowledgebaseId string
      Required

201

Successfully created a schedule.

  • application/json object
    Show application/json properties
    • ownerId string
      Required
    • spaceId string
    • tenantId string
      Required
    • calendars array of objects
      Required

      An event specification relative to the calendar, similar to a traditional cron specification.

      Show calendars properties
      • hour array of objects
        Required

        Hour range to match (0-23). Default matches 0

        Show hour properties
        • end integer

          End of the range (inclusive). If end < start, then end is interpreted as equal to start. Optional, defaulted to Start

        • step integer

          Step to be take between each value. Optional, defaulted to 1

        • start integer
          Required

          Start of the range (inclusive)

      • year array of objects
        Required

        Year range to match. Default matches all years

        Show year properties
        • end integer

          End of the range (inclusive). If end < start, then end is interpreted as equal to start. Optional, defaulted to Start

        • step integer

          Step to be take between each value. Optional, defaulted to 1

        • start integer
          Required

          Start of the range (inclusive)

      • month array of objects
        Required

        Month range to match (1-12). Default matches all months

        Show month properties
        • end integer

          End of the range (inclusive). If end < start, then end is interpreted as equal to start. Optional, defaulted to Start

        • step integer

          Step to be take between each value. Optional, defaulted to 1

        • start integer
          Required

          Start of the range (inclusive)

      • minute array of objects
        Required

        Minute range to match (0-59). Default matches 0

        Show minute properties
        • end integer

          End of the range (inclusive). If end < start, then end is interpreted as equal to start. Optional, defaulted to Start

        • step integer

          Step to be take between each value. Optional, defaulted to 1

        • start integer
          Required

          Start of the range (inclusive)

      • second array of objects
        Required

        Second range to match (0-59). Default matches 0

        Show second properties
        • end integer

          End of the range (inclusive). If end < start, then end is interpreted as equal to start. Optional, defaulted to Start

        • step integer

          Step to be take between each value. Optional, defaulted to 1

        • start integer
          Required

          Start of the range (inclusive)

      • comment string
        Required

        Description of the intention of this schedule

      • dayOfWeek array of objects
        Required

        DayOfWeek range to match (0-6; 0 is Sunday). Default matches all days of the week

        Show dayOfWeek properties
        • end integer

          End of the range (inclusive). If end < start, then end is interpreted as equal to start. Optional, defaulted to Start

        • step integer

          Step to be take between each value. Optional, defaulted to 1

        • start integer
          Required

          Start of the range (inclusive)

      • dayOfMonth array of objects
        Required

        DayOfMonth range to match (1-31). Default matches all days

        Show dayOfMonth properties
        • end integer

          End of the range (inclusive). If end < start, then end is interpreted as equal to start. Optional, defaulted to Start

        • step integer

          Step to be take between each value. Optional, defaulted to 1

        • start integer
          Required

          Start of the range (inclusive)

    • intervals array of objects

      For example, an every of 1 hour with offset of zero would match every hour, on the hour. The same every but an offset of 19 minutes would match every xx:19:00.

      Show intervals properties
      • every string
        Required

        The period to repeat the interval

      • offset string

        A fixed offset added to the intervals period. Optional, defaults to 0

    • datasourceId string
    • knowledgebaseId string
      Required

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 does not exist.

  • 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/knowledgebases/{id}/datasources/{datasourceId}/schedules
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.knowledgebases.createKnowledgebaseDatasourceSchedule(
'f256b3e4-03e0-4f74-ae46-a4d43882ee5d',
'f256b3e4-03e0-4f74-ae46-a4d43882ee5d',
{
calendars: [
{
comment: 'string',
dayOfMonth: [
{ end: 42, start: 42, step: 1 },
],
dayOfWeek: [
{ end: 42, start: 42, step: 1 },
],
hour: [{ end: 42, start: 42, step: 1 }],
minute: [{ end: 42, start: 42, step: 1 }],
month: [{ end: 42, start: 42, step: 1 }],
second: [{ end: 42, start: 42, step: 1 }],
year: [{ end: 42, start: 42, step: 1 }],
},
],
intervals: [{ every: '5h30m', offset: '0s' }],
},
)
qlik knowledgebase datasource schedule create \
--knowledgebaseId 'f256b3e4-03e0-4f74-ae46-a4d43882ee5d' \
--datasourceId 'f256b3e4-03e0-4f74-ae46-a4d43882ee5d' \
--calendars-comment '' \
--calendars-dayOfMonth-end \
--calendars-dayOfMonth-start \
--calendars-dayOfMonth-step \
--calendars-dayOfWeek-end \
--calendars-dayOfWeek-start \
--calendars-dayOfWeek-step \
--calendars-hour-end \
--calendars-hour-start \
--calendars-hour-step \
--calendars-minute-end \
--calendars-minute-start \
--calendars-minute-step \
--calendars-month-end \
--calendars-month-start \
--calendars-month-step \
--calendars-second-end \
--calendars-second-start \
--calendars-second-step \
--calendars-year-end \
--calendars-year-start \
--calendars-year-step \
--intervals-every ''
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/knowledgebases/{id}/datasources/{datasourceId}/schedules" \
-X POST \
-H "Content-type: application/json" \
-H "Authorization: Bearer <access_token>" \
-d '{"calendars":[{"hour":[{"end":42,"step":1,"start":42}],"year":[{"end":42,"step":1,"start":42}],"month":[{"end":42,"step":1,"start":42}],"minute":[{"end":42,"step":1,"start":42}],"second":[{"end":42,"step":1,"start":42}],"comment":"string","dayOfWeek":[{"end":42,"step":1,"start":42}],"dayOfMonth":[{"end":42,"step":1,"start":42}]}],"intervals":[{"every":"5h30m","offset":"0s"}]}'

Example Response

{
"ownerId": "507f191e810c19729de860ed",
"spaceId": "507f191e810c19729de860ec",
"tenantId": "507f191e810c19729de860eb",
"calendars": [
{
"hour": [
{
"end": 42,
"step": 1,
"start": 42
}
],
"year": [
{
"end": 42,
"step": 1,
"start": 42
}
],
"month": [
{
"end": 42,
"step": 1,
"start": 42
}
],
"minute": [
{
"end": 42,
"step": 1,
"start": 42
}
],
"second": [
{
"end": 42,
"step": 1,
"start": 42
}
],
"comment": "string",
"dayOfWeek": [
{
"end": 42,
"step": 1,
"start": 42
}
],
"dayOfMonth": [
{
"end": 42,
"step": 1,
"start": 42
}
]
}
],
"intervals": [
{
"every": "5h30m",
"offset": "0s"
}
],
"datasourceId": "f256b3e4-03e0-4f74-ae46-a4d43882ee5d",
"knowledgebaseId": "f256b3e4-03e0-4f74-ae46-a4d43882ee5d"
}

Delete knowledgebase datasource schedule

Deletes a datasource schedule.

Facts

Rate limit Tier 2 (100 requests per minute)

Path Parameters

  • datasourceId string
    Required

    The id of the datasource the schedule belongs to.

  • id string
    Required

    The id of the knowledgebase the schedule belongs to.

Responses

204

Successfully deleted a schedule.

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 does not exist.

  • 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/knowledgebases/{id}/datasources/{datasourceId}/schedules
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.knowledgebases.deleteKnowledgebaseDatasourceSchedule(
'f256b3e4-03e0-4f74-ae46-a4d43882ee5d',
'f256b3e4-03e0-4f74-ae46-a4d43882ee5d',
)
qlik knowledgebase datasource schedule rm \
--knowledgebaseId 'f256b3e4-03e0-4f74-ae46-a4d43882ee5d' \
--datasourceId 'f256b3e4-03e0-4f74-ae46-a4d43882ee5d'
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/knowledgebases/{id}/datasources/{datasourceId}/schedules" \
-X DELETE \
-H "Authorization: Bearer <access_token>"

Retrieve knowledgebase sync history

Retrieves sync history for the specified knowledgebase. Will return a 404 if no sync history exists, or if the calling user does not have access to synced datasources.

Facts

Rate limit Tier 1 (1000 requests per minute)

Query Parameters

  • limit integer

    The number of sync histories 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, eg. name. Can be prefixed with - to set descending order, defaults to ascending.

    Can be one of: "COMPLETED""-COMPLETED"

Path Parameters

  • id string
    Required

    The id of the knowledgebase.

Responses

200

List of sync items ordered by the completed time.

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

        sync id

      • status string
        Required

        Sync status

        Can be one of: "neverIndexed""progress""completed""completedWithError"

      • docStats object
        Required

        Summary of documents processed

        Show docStats properties
        • added integer
          Required
        • errors integer
          Required
        • deleted integer
          Required
        • updated integer
          Required
        • deltaBytes integer
          Required
        • deltaTextSize integer
          Required
        • largestFileSize integer
          Required
        • deltaEffectivePages integer
          Required
        • totalBytesProcessed integer
          Required
      • startedAt string
        Required

        Datetime when the sync task was started

      • completedAt string

        Datetime when the sync task was completed

      • triggerType string
        Required

        Datasource trigger type, was it manually or automatically synced

      • connectionId string
        Required

        Connection id that the datasource used

      • datasourceId string
        Required

        datasource id

      • errorSummary array of objects

        Aggregated, deduplicated view of failures grouped by error code. Lets the UI surface a smart summary (e.g. "1000 files failed to parse") instead of a flat list of raw error strings.

        Show errorSummary properties
        • code string
          Required

          Stable, machine-readable error category shared across services and the UI.

          Can be one of: "unknown""file_size_exceeded""download_failed""parse_failed""parse_timeout""chunk_failed""chunk_timeout""guardrail_blocked""unsupported_file""index_verification_failed""file_not_found""document_has_macros""scan_failed""pages_limit_exceeded""pages_enforcement_failed""governance_budget_exceeded"

        • count integer
          Required

          Number of files that failed with this error code.

        • sample string

          A representative (sanitized) error message for this category.

        • sources array of strings

          Up to selectedErrorsCount example sources that failed with this code.

      • selectedErrors array of strings

        populated with up to the first selectedErrorsCount errors if there were any during sync

    • 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

404

The knowledgebase is not found, the knowledgebase has no sync history, or the calling user doesn't have access to the datasources in the knowledgebase.

  • 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/knowledgebases/{id}/histories
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.knowledgebases.getKnowledgebaseHistories(
'f256b3e4-03e0-4f74-ae46-a4d43882ee5d',
{},
)
qlik knowledgebase histories 'f256b3e4-03e0-4f74-ae46-a4d43882ee5d'
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/knowledgebases/{id}/histories" \
-H "Authorization: Bearer <access_token>"

Example Response

{
"data": [
{
"id": "f256b3e4-03e0-4f74-ae46-a4d43882ee5d",
"status": [
"neverIndexed | progress | completed | completedWithError"
],
"docStats": {
"added": 1,
"errors": 0,
"deleted": 0,
"updated": 0,
"deltaBytes": 0,
"deltaTextSize": 0,
"largestFileSize": 123044444,
"deltaEffectivePages": 0,
"totalBytesProcessed": 123044444
},
"startedAt": "2021-10-02T14:20:50.52Z",
"completedAt": "2021-10-02T14:20:50.52Z",
"triggerType": [
"manual | schedule"
],
"connectionId": "ee6a390c-5d33-11e8-9c2d-fa7ae01bbebc",
"datasourceId": "f256b3e4-03e0-4f74-ae46-a4d43882ee5d",
"errorSummary": [
{
"code": "string",
"count": 1000,
"sample": "failed to parse document",
"sources": [
"myfile.pdf"
]
}
],
"selectedErrors": [
"unsupported file extension"
]
}
],
"meta": {
"countTotal": 42
},
"links": {
"next": {
"href": "string"
},
"prev": {
"href": "string"
},
"self": {
"href": "string"
}
}
}