For engineers
Keeplore API docs
Last updated
The API has two endpoints. POST /api/v1/query takes a question and returns an answer plus the approved rules behind it. GET /api/v1/export returns every approved rule. Both use JSON over HTTPS and one API key.
Only rules a manager has approved are ever returned. If no approved rule applies, the answer is empty. When a rule does apply, a model writes a short answer from the approved rules, and the rules it used come back with it.
Base URL: https://keeplore.dev/api/v1.
Authentication
Send an API key in the Authorization header. Keys start with lore_. A company admin creates a key in the Keeplore dashboard under API keys: give it a name and copy it straight away. Keeplore stores only a hash of the key, so it cannot show it again. An admin can revoke a key from the same page, and a revoked key returns 401.
Authorization: Bearer lore_...POST /api/v1/query
Ask a question in plain language. Keeplore picks the approved rules that apply and writes a short answer from them.
Request
Send JSON with one field. question is a string of 3 to 2,000 characters after trimming.
curl https://keeplore.dev/api/v1/query \
-H "Authorization: Bearer $LORE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"question": "A customer disputed an invoice. What do we do?"}'const res = await fetch("https://keeplore.dev/api/v1/query", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.LORE_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ question: "A customer disputed an invoice. What do we do?" }),
});
const { answer, rules } = await res.json();Response: 200
{
"answer": "Issue the credit, then close the ticket.",
"rules": [
{
"id": "0b6f3c1e-0000-4000-8000-000000000001",
"topic": "Billing",
"condition": "A customer disputes an invoice",
"rule": "Issue the credit note before closing the ticket",
"reason": "Closed tickets cannot be reopened by the billing system",
"source": "Maya Chen, Billing lead",
"confidence": 0.9
}
]
}| Field | Type | Meaning |
|---|---|---|
answer | string | A short answer built only from the rules returned. Empty when no approved rule applies. |
rules | array | The approved rules the answer used. Empty when answer is empty. |
rules[].id | string | The rule's id. |
rules[].topic | string | The topic the rule was filed under. |
rules[].condition | string | When the rule applies. |
rules[].rule | string | What to do. This is the rule's action. |
rules[].reason | string or null | Why the rule applies. Can be null. |
rules[].source | string | The person it came from, as "Name, role". |
rules[].confidence | number | 0 to 1, rounded to two decimals: how certain the employee sounded in the interview. It is not an accuracy score. |
When no approved rule applies
The request still succeeds. You get an empty answer and no rules, so your agent can tell "no rule" apart from an error and treat it as "hand over to a person".
{ "answer": "", "rules": [] }GET /api/v1/export
Returns every approved rule in your company, ordered by topic and then by when it was created. Use it to load the knowledge into your own system prompt or retrieval setup.
curl https://keeplore.dev/api/v1/export -H "Authorization: Bearer $LORE_API_KEY"
curl "https://keeplore.dev/api/v1/export?format=md" -H "Authorization: Bearer $LORE_API_KEY"format=md returns Markdown. Any other value, or none, returns JSON.
JSON response: 200
{
"rules": [
{
"id": "0b6f3c1e-0000-4000-8000-000000000001",
"topic": "Billing",
"condition": "A customer disputes an invoice",
"action": "Issue the credit note before closing the ticket",
"reason": "Closed tickets cannot be reopened by the billing system",
"confidence": 0.9,
"source": "Maya Chen",
"role": "Billing lead",
"updatedAt": "2026-10-24T09:00:00.000Z"
}
]
}The export uses action where the query response uses rule, and it splits the person into source (name) and role. confidence is not rounded. reason can be null.
Markdown response: 200
The content type is text/markdown. Rules are grouped under a heading per topic.
# Company knowledge
## Billing
- **When** A customer disputes an invoice: Issue the credit note before closing the ticket *Because Closed tickets cannot be reopened by the billing system.* (Source: Maya Chen, Billing lead)Errors
Errors are JSON with one field: { "error": "..." }.
| Status | Endpoint | When | Message |
|---|---|---|---|
| 400 | query | The body is not JSON, or question is missing or not 3 to 2,000 characters | Send JSON with a "question" string. |
| 401 | both | No Bearer key, a key that doesn't start with lore_, an unknown key or a revoked key | Missing or invalid API key. |
| 402 | query | The workspace has used its monthly AI allowance. Queries count toward it, along with interviews and rule extraction | This workspace has reached its monthly AI limit. |
| 403 | query | The workspace has not been activated, for example a signup with a personal email address | This workspace isn't active yet. Email hello@keeplore.dev to get access. |
| 429 | both | The key has made too many queries in the last minute | Rate limit reached. Try again in a minute. |
Rate limits
Each API key can make 60 queries per minute. Once a key has made 60 queries in the last minute, requests to either endpoint return 429 until older queries fall out of that minute. Export requests are not counted. There are no other per-request limits in the API today. Each workspace also has a monthly AI allowance (the 402 error), which Keeplore staff can change.
What the API does not do
- It does not return the exact quote a rule came from. The quote is checked when the rule is extracted and is shown to the reviewer in Keeplore.
- It does not return rules that are pending or rejected.
- It does not write: there is no endpoint to create, edit or approve rules. That happens in the dashboard.
- It has no webhooks and no pagination. Export returns everything in one response.
Questions about the API? Email hello@keeplore.dev or book a demo.
Related
01How do I authenticate with the Keeplore API?
Send an API key in the Authorization header as Bearer lore_.... A company admin creates keys in the Keeplore dashboard under API keys and can revoke them there. A missing, wrong or revoked key returns 401.
02What does POST /api/v1/query return when Keeplore doesn't know?
An empty answer and no rules: {"answer": "", "rules": []} with status 200 when no approved rule applies. Your agent can treat that as "hand over to a person". Only rules a manager has approved are ever used.
03What is the Keeplore API rate limit?
60 queries per minute for each API key. After that, requests to either endpoint return 429 until the count for the last minute drops. Export requests are not counted. There is also a monthly AI limit for each workspace, which returns 402 on queries when reached.
04How do I get every approved rule out of Keeplore?
Call GET /api/v1/export with your API key. It returns JSON by default. Add ?format=md to get Markdown grouped by topic.
05Does the API return the exact quote behind a rule?
No. The API returns the condition, the action, the reason, a confidence between 0 and 1, and the name and role of the person the rule came from. The quote is checked when the rule is extracted and is shown to the reviewer in Keeplore, not in API responses.
Try it before you decide.
Pick one person whose knowledge your agent is missing. Send them the interview link. Read the rules that come back.