https://back.leap.onclarity.com with Authorization: Bearer $CLARITY_API_KEY (see Authentication).
The article object
Articles accept other fields too (for example
tags, confidence, criticality); Clarity stores whatever you send with the article.
Create an article
string
The article title.
string
The article body in Markdown.
string
The collection to file it in.
string
default:"draft"
draft or published.boolean
default:"false"
Show the article on the public help page.
string
default:"manually"
Where the article came from.
string
When the article becomes valid.
string
When the article stops being valid.
kb_article_created webhook.
Update an article
PATCH /api/kb/articles/update?article_id=… takes the same body as create.
Read, list, and delete
Read one article
404 article_not_found.
List articles
POST /api/kb/articles/list returns {"list": [...], "total": N}. Listed articles do not include content; read an article to get it.
string
Text to search for in titles and content.
object
Field filters. A list matches any of its values. The keys Clarity’s own Knowledge Base page uses are
status, collection, source, tags, updated_at ({"gte": "...", "lte": "..."}), and validity_status (any of active, scheduled, expired).object
{"key": "updated_at", "direction": "desc"}. direction is asc or desc.integer
default:"1000"
How many articles to return.
integer[]
Ids you already have. They are excluded, so sending the ids of the previous pages returns the next page.
boolean
default:"false"
Order by collection name first, then by
sort within each collection.Delete an article
status and an optional message.
Upload a file
POST /api/kb/articles/upload takes a file as multipart form data, creates an article with status: "processing", and converts the file to Markdown in the background. Poll the article with GET /api/kb/articles/detail until its status leaves processing. A converted PDF lands as a draft, or error if the conversion failed; publish it with an update.
file
required
A PDF, or one of
.docx, .pptx, .xlsx, .xls, .csv, .tsv, .txt, .html.string
required
The collection for the new article.
qdrant_article_id is the new article’s id. The request body can be up to 150 MB.
Collections and values in use
GET /api/kb/meta returns: