Knowledge_bases

Knowledge base related APIs

Knowledge Base Diff

post
Authorizations
Header parameters
AGENT-EMAILstringOptional

Optional: Email of the agent to use for this request

USER-EMAILstringOptional

Optional: Email address to associate with the user

OWN-USER-IDstringOptional

Optional: User ID to identify or create a user

Body
leftIdstringRequired

The left knowledge base ID

rightIdstringRequired

The right knowledge base ID

Responses
200

OK

application/json
post
POST /webapi/v2/knowledge_base_diff HTTP/1.1
Host: backend.alli.ai
API-KEY: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 34

{
  "leftId": "text",
  "rightId": "text"
}
200

OK

{
  "result": [
    {
      "left": {
        "status": "text",
        "page": 1,
        "line": 1,
        "text": "text",
        "highlight": "text"
      },
      "right": {
        "status": "text",
        "page": 1,
        "line": 1,
        "text": "text",
        "highlight": "text"
      },
      "row": 1,
      "comment": "text"
    }
  ]
}

Download document by filename

get
Authorizations
Path parameters
project_idstringRequired
Header parameters
AGENT-EMAILstringOptional

Optional: Email of the agent to use for this request

USER-EMAILstringOptional

Optional: Email address to associate with the user

OWN-USER-IDstringOptional

Optional: User ID to identify or create a user

Body
filenamestringOptional

Name of the document to download

Responses
200

Document file downloaded successfully

application/octet-stream
Responsestring · binary
get
GET /download_document_by_name/{project_id} HTTP/1.1
Host: backend.alli.ai
API-KEY: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 19

{
  "filename": "text"
}
binary

Get Single Document

get

This is the method to get all details of a single document.

Authorizations
Query parameters
idstringRequired

The id of the document.

Header parameters
AGENT-EMAILstringOptional

Optional: Email of the agent to use for this request

USER-EMAILstringOptional

Optional: Email address to associate with the user

OWN-USER-IDstringOptional

Optional: User ID to identify or create a user

Responses
200

Successfully retrieved document details

application/json
get
GET /webapi/single_document HTTP/1.1
Host: backend.alli.ai
API-KEY: YOUR_API_KEY
Accept: */*
200

Successfully retrieved document details

{
  "result": {
    "id": "text",
    "documentName": "text",
    "createdDate": "2025-08-14",
    "hashtags": [
      "text"
    ],
    "agentFeedback": {
      "positiveCount": 1,
      "negativeCount": 1
    },
    "userFeedback": {
      "positiveCount": 1,
      "negativeCount": 1
    }
  }
}

Upload Documents

post

This API method allows you to upload documents for Cognitive Search. Available file formats for the upload: PDF, TXT, MS Word, PowerPoint, Excel, HTM and HTML. To upload a HTML file with linked resources, please compress in a ZIP file along with any relative linked resources before uploading.

Authorizations
Header parameters
AGENT-EMAILstringOptional

Optional: Email of the agent to use for this request

USER-EMAILstringOptional

Optional: Email address to associate with the user

OWN-USER-IDstringOptional

Optional: User ID to identify or create a user

Body
filestring · binaryOptional

Your local file location

hashtagsstring[]Optional

Hashtags for the uploading file

footerTitlestringOptional

You can type in the source of the answer as a footer for search results from the uploaded file. The footer text will appear next to 'From' in search results.

footerUrlstringOptional

You can put the URL you want to link to the footerTitle.

parentFolderIdstringOptional

Target folder ID to upload to. Null to insert at top level.

allowOtherAgentsViewbooleanOptional

Whether to allow other agents to view this document

allowOtherUsersViewbooleanOptional

Whether to allow other users to view this document

Responses
200

File uploaded successfully

application/json
post
POST /webapi/upload_file HTTP/1.1
Host: backend.alli.ai
API-KEY: YOUR_API_KEY
Content-Type: multipart/form-data
Accept: */*
Content-Length: 156

{
  "file": "binary",
  "hashtags": [
    "text"
  ],
  "footerTitle": "text",
  "footerUrl": "text",
  "parentFolderId": "text",
  "allowOtherAgentsView": true,
  "allowOtherUsersView": true
}
{
  "result": {
    "id": "text",
    "file_name": "text",
    "hashtags": [
      "text"
    ],
    "footer": "text"
  }
}

Upload Documents from S3

post

This API lets you transfer documents stored in S3 into Cognitive Search. They will appear as Knowledge Base documents in the dashboard. Available file formats are same in the section of Upload Documents.

Authorizations
Header parameters
AGENT-EMAILstringOptional

Optional: Email of the agent to use for this request

USER-EMAILstringOptional

Optional: Email address to associate with the user

OWN-USER-IDstringOptional

Optional: User ID to identify or create a user

Body
pathstringOptional

S3 path of the file. It should end with the file name. Don't include the bucket name

secretKeystringOptional

Your S3 Secret Key.

accessKeystringOptional

Your S3 Access Key.

bucketstringOptional

Name of S3 bucket containing your file.

footerTitlestringOptional

You can type in the source of the answer as a footer for search results from the uploaded file. The footer text will appear next to 'From' in search results.

footerUrlstringOptional

You can put the URL you want to link to the footerTitle.

hashtagsstring[]Optional

Hashtags for the document.

parentFolderIdstringOptional

Target folder ID to upload to. Null to insert at top level.

Responses
200

File uploaded successfully from S3

application/json
post
POST /webapi/upload_from_s3 HTTP/1.1
Host: backend.alli.ai
API-KEY: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 153

{
  "path": "text",
  "secretKey": "text",
  "accessKey": "text",
  "bucket": "text",
  "footerTitle": "text",
  "footerUrl": "text",
  "hashtags": [
    "text"
  ],
  "parentFolderId": "text"
}
{
  "result": {
    "id": "text",
    "file_name": "text",
    "hashtags": [
      "text"
    ],
    "footer": "text"
  }
}

Check Document Status

get

Once you upload documents through API, it is converted, parsed, and embedded as vectors. This API shows the status of the process for a document being uploaded.

Authorizations
Query parameters
idstringRequired

The document id to check the status

Header parameters
AGENT-EMAILstringOptional

Optional: Email of the agent to use for this request

USER-EMAILstringOptional

Optional: Email address to associate with the user

OWN-USER-IDstringOptional

Optional: User ID to identify or create a user

Responses
200

File status retrieved successfully

application/json
get
GET /webapi/check_file_status HTTP/1.1
Host: backend.alli.ai
API-KEY: YOUR_API_KEY
Accept: */*
{
  "result": {
    "id": "text",
    "status": "text",
    "errorName": "text"
  }
}

Rename Documents (Knowledge Base)

post

This API lets you update the name for an uploaded document.

Authorizations
Header parameters
AGENT-EMAILstringOptional

Optional: Email of the agent to use for this request

USER-EMAILstringOptional

Optional: Email address to associate with the user

OWN-USER-IDstringOptional

Optional: User ID to identify or create a user

Body
idstringOptional

The document ID that you want to rename.

filenamestringOptional

The new name for the specified document.

Responses
200

Knowledge base name updated successfully

application/json
post
POST /webapi/update_kb_name HTTP/1.1
Host: backend.alli.ai
API-KEY: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 31

{
  "id": "text",
  "filename": "text"
}
{
  "result": {
    "id": "text",
    "filename": "text"
  }
}

Search Documents by Title

get

This API allows you to search for documents by their titles, not their content.

Authorizations
Query parameters
querystringRequired

The search term for document titles.

hashtagsstringOptional

Comma-separated list of hashtags to filter documents by.

combinedHashtagsstringOptional

Complex hashtag filtering using semicolons to separate groups and commas to separate tags within a group (e.g., "a,b;c,d").

excludingHashtagsstringOptional

Comma-separated list of hashtags to exclude documents by.

useVectorstringOptional

Set to 'true' to use vector search for semantic matching, or 'false' for text-based search.

sortKeystringOptional

The property field to sort results by.

sortDirectionstring · enumOptional

The direction to sort results in (ascending or descending).

Possible values:
offsetintegerOptional

Number of results to skip for pagination.

limitintegerOptional

Maximum number of results to return.

Header parameters
AGENT-EMAILstringOptional

Optional: Email of the agent to use for this request

USER-EMAILstringOptional

Optional: Email address to associate with the user

OWN-USER-IDstringOptional

Optional: User ID to identify or create a user

Responses
200

Successfully searched documents by title

application/json
get
GET /webapi/search_document_by_title HTTP/1.1
Host: backend.alli.ai
API-KEY: YOUR_API_KEY
Accept: */*
200

Successfully searched documents by title

{
  "result": [
    {
      "id": "text",
      "file_name": "text",
      "page_count": 1,
      "download_url": "text",
      "hashtags": [
        "text"
      ],
      "score": 1,
      "folder": "text",
      "agentEditor": [
        "text"
      ],
      "agentViewer": [
        "text"
      ]
    }
  ]
}

Delete Documents

post

This API lets you delete uploaded files.

Authorizations
Header parameters
AGENT-EMAILstringOptional

Optional: Email of the agent to use for this request

USER-EMAILstringOptional

Optional: Email address to associate with the user

OWN-USER-IDstringOptional

Optional: User ID to identify or create a user

Body
idsstring[]Optional

The document IDs that you want to delete in the array format

Responses
200

Files deleted successfully

application/json
post
POST /webapi/delete_file HTTP/1.1
Host: backend.alli.ai
API-KEY: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 16

{
  "ids": [
    "text"
  ]
}
200

Files deleted successfully

{
  "result": {
    "ok": true
  },
  "errors": {}
}

List Documents

get

This API lets you list out the uploaded documents.

Authorizations
Query parameters
hashtagsSearchOperatorstring · enumOptional

Either AND or OR, logical operator used to match multiple hashtags. Defaults to OR.

Default: ORPossible values:
statusbooleanOptional

The on/off status of the document to filter the list.

searchTermstringOptional

Keyword search query to filter the list. You can use operators to run advanced searches. "TERM1 TERM2" for AND, "TERM1 OR TERM2" for OR, and "TERM\ for exact match.

hashtagsstring[]Optional

Hashtag information to filter the list.

orderstring · enumOptional

The order type of the list. FILE_NAME_ASC/DESC for file name, TYPE_ASC/DESC for file type, STATUS_ASC/DESC for on/off status, CREATED_AT_ASC/DESC for upload date.

Possible values:
offsetintegerOptional

offset allows you to specify the ranking number of the first item on the page.

limitinteger · min: 1 · max: 100Optional

limit allows you to set the number of objects returned on one page. The maximum value is 100.

Header parameters
AGENT-EMAILstringOptional

Optional: Email of the agent to use for this request

USER-EMAILstringOptional

Optional: Email address to associate with the user

OWN-USER-IDstringOptional

Optional: User ID to identify or create a user

Responses
200

Successfully retrieved list of documents

application/json
get
GET /webapi/knowledge_bases HTTP/1.1
Host: backend.alli.ai
API-KEY: YOUR_API_KEY
Accept: */*
200

Successfully retrieved list of documents

{
  "result": {
    "items": [
      {
        "id": "text",
        "fileName": "text",
        "hashtags": [
          "text"
        ],
        "autoHashtags": [
          {}
        ],
        "folder": "text",
        "agentEditor": [
          "text"
        ],
        "agentViewer": [
          "text"
        ],
        "userViewer": {
          "variables": {}
        },
        "allowOtherAgentsView": true,
        "allowOtherUsersView": true
      }
    ]
  },
  "errors": {}
}

Preview Documents

get

This API lets you preview the uploaded documents.

Authorizations
Query parameters
idstringRequired

The document ID that you want to preview

pageNostringRequired

Pages of the document you want to preview

Header parameters
AGENT-EMAILstringOptional

Optional: Email of the agent to use for this request

USER-EMAILstringOptional

Optional: Email address to associate with the user

OWN-USER-IDstringOptional

Optional: User ID to identify or create a user

API-KEYstringRequired

Your API key can be found in your dashboard Settings menu, under the General tab.

Responses
200

Successfully retrieved document preview

application/json
get
GET /webapi/knowledge_base_preview HTTP/1.1
Host: backend.alli.ai
API-KEY: text
Accept: */*
200

Successfully retrieved document preview

{
  "result": {
    "totalPageCount": 1,
    "pageNo": 1,
    "css": "text",
    "body": "text",
    "highlightIndexes": [
      1
    ],
    "exactAnswer": "text",
    "pdf": "text",
    "draftjs": "text",
    "highlights": {
      "indexes": [
        1
      ],
      "pageIndexes": [
        1
      ],
      "__typename": "text"
    },
    "knowledgeBase": {
      "id": "text",
      "title": "text",
      "__typename": "text"
    },
    "__typename": "text"
  },
  "errors": {}
}

Update Documents

post

This API lets you update hashtags, footer title, and footer title link for a document.

Authorizations
Header parameters
AGENT-EMAILstringOptional

Optional: Email of the agent to use for this request

USER-EMAILstringOptional

Optional: Email address to associate with the user

OWN-USER-IDstringOptional

Optional: User ID to identify or create a user

Body
idstringRequired

The id of the document you want to update

footerTitlestringOptional

You can type in the source of the answer as a footer for search results from the uploaded file. The footer text will appear next to 'From' in search results.

footerUrlstringOptional

You can put the URL you want to link to the footerTitle.

hashtagsstring[]Optional

List of string hashtags you want to add to the document

Responses
200

Document updated successfully

application/json
post
POST /webapi/update_document HTTP/1.1
Host: backend.alli.ai
API-KEY: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 73

{
  "id": "text",
  "footerTitle": "text",
  "footerUrl": "text",
  "hashtags": [
    "text"
  ]
}
200

Document updated successfully

{
  "result": {
    "knowledgeBase": {
      "id": "text",
      "hashtags": [
        "text"
      ],
      "footer": "text"
    }
  },
  "errors": {}
}

Knowledge Base Toggle Status

post

This API lets you change the status of many documents (AKA knowledge bases) at once

Authorizations
Header parameters
AGENT-EMAILstringOptional

Optional: Email of the agent to use for this request

USER-EMAILstringOptional

Optional: Email address to associate with the user

OWN-USER-IDstringOptional

Optional: User ID to identify or create a user

Body
usebooleanRequired

Whether to turn all the status of all the knowledge bases to on (True) or off (False)

idsstring[]Required

This is a list of the ids of the knowledge bases that you want to toggle.

Responses
200

Knowledge base statuses toggled successfully

application/json
post
POST /webapi/toggle_documents HTTP/1.1
Host: backend.alli.ai
API-KEY: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 27

{
  "use": true,
  "ids": [
    "text"
  ]
}
200

Knowledge base statuses toggled successfully

{
  "result": {
    "knowledgeBases": [
      {
        "id": "text",
        "status": true
      }
    ]
  },
  "errors": {}
}

Was this helpful?