Knowledge base

Create a knowledge base entry

Creates a new knowledge base entry for a replica based on text, file, URL, or Youtube Videos. For YouTube playlists, the system will automatically create separate entries for each video in the playlist.

post/v1/replicas/{replicaUUID}/knowledge-base

Request

  • Base URL: https://api.sensay.io
  • URL: https://api.sensay.io/v1/replicas/{replicaUUID}/knowledge-base
  • Auth: one of:
    • API key in header X-ORGANIZATION-SECRET
    • API key in header X-ORGANIZATION-SECRET and API key in header X-USER-ID and API key in header X-USER-ID-TYPE

Path parameters

replicaUUIDstring uuid required

The replica unique identifier (UUID)

Example:03db5651-cb61-4bdf-9ef0-89561f7c9c53

Headers

X-API-Versionstring
Example:2025-03-25
Content-Encoding'gzip'

Content encoding for request body compression. Optional - when used, client is responsible for gzipping and sending binary data.

Request body

titlestring

Title for this knowledge base entry. Helps identify the content in listings.

urlstring

A public URL to an HTML page to ingest into the knowledge base. The URL must be publicly accessible without authentication. Google domains(e.g. www.google.com, docs.google.com) are not allowed. Only the rendered text on the web page is used for training, embedded media (image, video, audio) is not used. For training using video files, please provide YouTube links in one of the following formats: https://www.youtube.com/watch?v=VIDEO_ID https://www.youtube.com/shorts/SHORT_VIDEO_ID https://www.youtube.com/playlist?list=PLAYLIST_ID

autoRefreshboolean

Whether to allow automatic content updates from the URL, handled by the system.

textstring

The text content you want your replica to learn

filenamestring

The name of the file that you intend to upload. Supported file types:

  • Documents: .doc, .docx, .rtf, .pdf, .pdfa
  • Spreadsheets and Tabular Data: .csv, .tsv, .xls, .xlsx, .xlsm, .xlsb, .ods, .dta, .sas7bdat, .xpt
  • Presentations: .ppt, .pptx
  • Text Files: .txt, .md, .htm, .html, .css, .js, .xml
  • Data Text Files: .json, .yml, .yaml
  • E-books: .epub
  • Images: .png, .jpg, .jpeg, .webp, .heic, .heif, .tiff, .bmp
  • Audio Files: .mp3, .wav, .aac, .ogg, .flac
  • Video Files: .mp4, .mpeg, .mov, .avi, .mpg, .webm, .mkv (Maximum duration: 90 minutes)

Example request

{
  "title": "Company information",
  "url": "https://example.com",
  "text": "Our company was founded in 2020. We specialize in AI-powered customer service solutions.",
  "filename": "example.txt"
}

Response

The created knowledge base entry

successboolean required

Indicates if the knowledge base entry was created successfully

Example response

{
  "success": true,
  "results": []
}

Changes

No recorded changes to this operation across all 1 revision of this API.