Skip to content

Create a KB entry

POST
/api/workspaces/{workspaceId}/kb-entries

Creates a new knowledge base entry in the specified workspace. Manually created entries are immediately set to ‘approved’ status and become available to the AI. Provide a clear question-answer pair and relevant topic tags to help the AI match this entry to customer inquiries.

workspaceId
required
string format: uuid

The workspace to create the entry in.

object
question
required

The question or topic this entry addresses.

string
>= 1 characters
Example
What are your delivery times to Germany?
answer
required

The answer to the question.

string
>= 1 characters
Example
Standard delivery to Germany takes 3-5 business days. Express delivery (next business day) is available for EUR 12.50.
sourceType
required

How this entry was created. Use ‘manual’ for human-authored entries, ‘import’ for API-imported entries.

string
>= 1 characters
Example
manual
topics

Tags that categorize this entry. Helps the AI match relevant entries to conversations.

Array<string>
Example
[
"shipping",
"delivery",
"germany"
]
sourceConversationId

Optional reference to the conversation that inspired this entry.

string
Example
c1a2b3c4-5678-9abc-def0-1234567890ab
confidence

Confidence score between 0 and 1. Typically set by the learning loop, not manually.

number
<= 1
Example
1

The entry was created.

A knowledge base (KB) entry is a question-answer pair that the AI uses to respond to customer inquiries. Entries can be created manually, imported via the API, or proposed automatically by the learning loop after resolved conversations. Proposed entries require human approval before the AI can use them.

object
id
required

Unique identifier for the KB entry.

string format: uuid
Example
kb1a2b3c-5678-9abc-def0-1234567890ab
tenantId
required

The tenant this entry belongs to.

string format: uuid
Example
a0b1c2d3-4567-89ab-cdef-0123456789ab
workspaceId
required

The workspace this entry is scoped to. The AI only uses entries from the workspace that matches the conversation.

string format: uuid
Example
w1a2b3c4-5678-9abc-def0-1234567890ab
question
required

The question or topic this entry addresses. This is what the AI matches against when a customer asks something.

string
Example
What are your delivery times to Germany?
answer
required

The answer the AI should use when this entry is matched. Can include specific details, links, and instructions.

string
Example
Standard delivery to Germany takes 3-5 business days. Express delivery (next business day) is available for an additional fee of EUR 12.50.
topics
required

Tags that categorize this entry. Used for filtering and to help the AI determine relevance.

Array<string>
Example
[
"shipping",
"delivery",
"germany"
]
sourceType
required

How the entry came to be. manual is an entry written by a person, approved when it is created. extracted is a proposal the learning loop drafted from a resolved conversation. The API stores the value sent, and an entry created with a value other than manual starts as pending_review.

string
Example
manual
confidence

Confidence score between 0 and 1, set by the learning loop when proposing entries. Higher values indicate the AI is more confident the entry is accurate. Null for manually created entries.

number | null
Example
0.92
status
required

Where the entry stands. approved: in use, the assistant draws on it. pending_review: created for review, through the API with a sourceType other than manual; it is not used until it is approved. proposed: drafted by oHallo, for example by the learning loop from a resolved conversation; it is not used until it is approved, and a proposal that changes an existing entry is applied to that entry when it is approved. rejected: declined in review. archived: no longer in use, kept for the record.

string
Allowed values: pending_review approved rejected archived proposed
Example
approved
usageCount
required

Number of times this entry has been referenced by the AI when responding to conversations.

integer
Example
47
lastUsedAt

Timestamp of the last time the AI referenced this entry. Null if never used.

string | null format: date-time
Example
2026-03-25T14:20:00.000Z
createdAt
required

Timestamp when the entry was created.

string format: date-time
Example
2026-02-01T12:00:00.000Z
updatedAt
required

Timestamp when the entry was last updated.

string format: date-time
Example
2026-03-15T10:30:00.000Z

The workspace already has an entry with this question. Each question is held by one entry of the workspace, compared without case or surrounding spaces; a rejected entry holds none. code is duplicate_question and entryId names the entry that holds it.

Standard error response returned by all endpoints on failure.

object
error
required

A human-readable error message describing what went wrong.

string
Example
Conversation not found
code

A machine-readable reason on some refusals, for example ‘key_lock’ when an API key’s brand or workspace restriction does not cover the action.

string
Example
key_lock
missing_scopes

On a 403 for an API key without a scope the endpoint requires: the scopes the key lacks.

Array<string>
Example
[
"mcp:write"
]
entryId

On a 409 with code duplicate_question or duplicate_rule_text: the knowledge base entry or policy that already holds the question or rule text.

string format: uuid
Example
11223344-5566-4788-99aa-bbccddeeff00
connectionId

On a 422 about one MCP connection a request names, from an assignment or an agent create or update (a connection that does not exist, one listed twice, or one that does not declare a tool named): the connection, as the request named it.

string
undeclaredTools

On the same 422: the tool names the connection does not declare.

Array<string>
Example
[
"get_orders"
]
declaredTools

On the same 422: the tools the connection declares.

Array<string>
Example
[
"get_order",
"search_orders"
]

Validation error. One or more required fields are missing or invalid.

Standard error response returned by all endpoints on failure.

object
error
required

A human-readable error message describing what went wrong.

string
Example
Conversation not found
code

A machine-readable reason on some refusals, for example ‘key_lock’ when an API key’s brand or workspace restriction does not cover the action.

string
Example
key_lock
missing_scopes

On a 403 for an API key without a scope the endpoint requires: the scopes the key lacks.

Array<string>
Example
[
"mcp:write"
]
entryId

On a 409 with code duplicate_question or duplicate_rule_text: the knowledge base entry or policy that already holds the question or rule text.

string format: uuid
Example
11223344-5566-4788-99aa-bbccddeeff00
connectionId

On a 422 about one MCP connection a request names, from an assignment or an agent create or update (a connection that does not exist, one listed twice, or one that does not declare a tool named): the connection, as the request named it.

string
undeclaredTools

On the same 422: the tool names the connection does not declare.

Array<string>
Example
[
"get_orders"
]
declaredTools

On the same 422: the tools the connection declares.

Array<string>
Example
[
"get_order",
"search_orders"
]