Skip to main content
Knowledge is what your agents know about your business. It has four parts:
  • Documents: files and websites that ImpelLabs reads into searchable parts.
  • Groups: sets of documents and facts. An agent reads the groups you connect to it.
  • Facts: short values such as an address or an opening time.
  • Conflicts: two claims about the same fact that disagree. A person decides which is right.
All routes are under https://api.impellabs.tech/api/v1. Send Authorization: Bearer imp_... on each request. See Authentication and Conventions. The API reference lists every field.

Who can do what

A token acts as the person who made it. A group that a person may not see answers 404 with This knowledge group does not exist. A group has a visibility: An agent that is connected to a group reads it even when its owner cannot see the group.

Add a file

  1. POST /files with a multipart file. The reply is 201 with the file: id, name, content_type, size, status.
  2. POST /knowledge/documents with { "file_id": "<id>" }. ImpelLabs reads the text and splits it into parts. The reply is 201 with the document.
GET /files lists the file library (q, status, kind, sort, order, page, page_size). GET /files/{file_id}/info adds a text preview. POST /files/{file_id}/retry reads a failed file again; any other file answers 409. A file that cannot be read is rejected with 400 and a reason.

Documents

  • GET /knowledge/documents lists the documents you may see. kind is file or website.
  • PATCH /knowledge/documents/{document_id} with { "tags": [...] } sets the sensitive-data tags of the source. The tags are personal, health and payment.
  • DELETE /knowledge/documents/{document_id} archives the document and answers 204.

Add a website

  1. POST /knowledge/sites/discover with { "url": "<address>" } finds the pages of the site.
  2. POST /knowledge/sites/read with { "url", "pages": [...], "group_id"? } reads the pages you choose. The reading runs in the background. Use group_id to file the result in a group you may change.
  3. GET /knowledge/sites shows each site (id, site, title, pages, blocks, groups) and reading, the reads that are not done.
An address that ImpelLabs may not read answers 400 with This address cannot be read.
POST /knowledge/groups/{group_id}/deep-scan with { "url": "<one page>" } reads one page for facts and files them in the group. GET /knowledge/groups/{group_id}/sources lists what the group was built from.

Groups

GET /knowledge/groups lists the groups you see. archived=1 lists archived groups. POST /knowledge/groups makes a group.
The reply is 201:
  • GET, PATCH and DELETE /knowledge/groups/{group_id}. DELETE archives the group and its items.
  • POST /knowledge/groups/{group_id}/restore brings an archived group back with its items.
  • POST /knowledge/groups/{group_id}/items with { "document_id" } or { "fact_key" } files an item in the group. The reply is 201 with the group.
  • DELETE /knowledge/groups/{group_id}/items/{item_id} takes an item out. The reply is 204.
To let an agent read a group, put the group id in the agent’s knowledge_groups. See Agents.

Facts

A fact has a key, a value and a source.
  • PATCH /knowledge/facts/{key} with { "value": "<text>" } sets a new value. It has 2000 characters at most.
  • DELETE /knowledge/facts/{key} archives the fact.

Conflicts and published facts

  • GET /knowledge/conflicts lists open conflicts. status shows others. Each conflict has id, status, fact, key and claims; each claim has id, value, said_by, confidence, when and quote.
  • POST /knowledge/conflicts/{conflict_id}/resolve with { "action", "claim_id"?, "text"? }. action is select (the default; use claim_id), edit (use text), delete or keep_both. An owner or an admin only.
  • GET /knowledge/published-facts lists published facts. status filters them.
  • POST /knowledge/published-facts with { "claim_id" } publishes a claim. An owner or an admin only.
  • POST /knowledge/published-facts/{fact_id}/retract with { "note"? } retracts a published fact.

Questions your agents could not answer

GET /knowledge/unanswered lists the questions that agents could not answer. status is open (the default), resolved or dismissed. agent filters by agent. The reply is { "questions": [...], "open": <number> }.
  • POST /knowledge/unanswered/{question_id}/draft drafts an answer from your knowledge. Nothing is saved.
  • POST /knowledge/unanswered/{question_id}/answer with { "text", "group_ids"? } saves the answer as a fact and files it in the groups.
  • POST /knowledge/unanswered/{question_id}/dismiss closes the question.
GET /search searches across what the person may see.
The reply is { "q": "...", "groups": [ { "kind", "label", "items": [ ... ] } ] }. With fewer than two characters, groups is empty.

Memories

A memory is a short line that someone keeps, of 300 characters at most. GET and POST /memories are your own and private. PATCH and DELETE /memories/{memory_id} change one. PUT /memories/settings with { "on": true } or false turns your memories on or off. GET and POST /contacts/{contact_id}/memories, and DELETE /contacts/{contact_id}/memories/{memory_id}, hold what your agents remember about a customer. Memories of an agent are on Agents.