Knowledge bases
Knowledge bases and the documents inside them — what your assistants can search during a call.
A knowledge base is a named collection of documents. Attach it to an assistant with connectKnowledgeIds, and the assistant searches it when a caller asks something the prompt does not cover. Each document is indexed (chunked and embedded) when it is added, and again when its text changes. Only indexStatus: "INDEXED" means its current text is searchable.
Beta. This API is documented but not yet frozen. Response fields and error codes may change without a version bump. Pin your integration to the fields you use, and expect additions.
Two levels
- Knowledge bases —
/api/knowledgeand/api/knowledge/{knowledgeId}. A base'spromptis its usage note: one sentence telling the assistant when to look here. The list returns every base in your token's workspace, whoever created it, one page at a time (limit,cursor). - Documents —
/api/knowledge/{knowledgeId}/documents/…. A document belongs to exactly one base and is addressed through it; a valid document id under the wrong base is a not-found.
Ownership
Any member can read every base and document in the workspace. Changing or deleting a base, and changing, deleting or re-indexing a document, is gated by ownership — a MEMBER acts only on rows they created; ADMIN and OWNER on any. Any member can add a document to any base. Deleting a base deletes every document in it, including documents other members added.
Indexing
Adding a document indexes it before the response returns. A 201 means the document is saved and its search entries are written; they are usually searchable within seconds. If indexing fails you get DOCUMENT_INDEXING_FAILED, and the document is usually rolled back, so send the create again. In rare cases the document stays, and the list shows it as FAILED. It keeps its name and counts toward the cap, so a second create with that name answers RESOURCE_CONFLICT. Re-index that document instead.
Replacing a document's text saves first and re-indexes in the background. The response says indexStatus: "PENDING". The status then moves to INDEXING, then to INDEXED, or to FAILED if indexing fails. Until it reads INDEXED, the assistant can still answer from the previous text. The background job is best-effort. If it is lost, a daily job at 07:00 UTC re-indexes the document. That job takes 20 documents per run across all workspaces, oldest first, so the wait can be longer than a day. It tries one document at most 5 times; after that, only the re-index endpoint retries it. To retry sooner, call the re-index endpoint; it queues nothing while the document still reads INDEXING.
GET /api/knowledge/index-status counts, per base, the documents that are FAILED, or PENDING or INDEXING for more than ten minutes. It does not count a document that is re-indexing normally. To follow one document, read its indexStatus.
Plan caps
The workspace owner's plan sets three caps: bases per workspace, documents per workspace (all bases together), and extracted characters per document. Hypergrowth has no base or document cap. Over a cap answers SUBSCRIPTION_LIMIT_EXCEEDED with the cap in detail. Replacing a document's text is checked against the character cap too. A request body over 4.5 MB is refused before dBel reads it, so split a very large document into several.
Example — add a text document
curl -X POST https://dbel.ai/api/knowledge/clx…/documents \
-H "Authorization: Bearer $DBEL_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"type": "PLAIN_TEXT",
"name": "Opening hours",
"text": "We are open Monday to Friday, 9am to 5pm."
}'To store a web page's content, send "type": "URL" with url, name and text. dBel does not fetch the page: it indexes only the text you send, and stores the url with it. PDFs are uploaded from the dashboard. A token can download a stored PDF's original file with the PDF download endpoint below.
Endpoints
GET/api/knowledge
List the workspace's knowledge bases.
Every base in the token's workspace, whoever created it — the same set the dashboard shows.
Auth: Bearer token · any workspace member
Query parameters
| Field | Type | Notes |
|---|---|---|
| limit | integer 1–100 | Rows per page. Default 20. |
| cursor | string | The nextCursor from the previous page. |
Responses
200 JSON body:
| Field | Type | Notes |
|---|---|---|
| bases | object[] | |
| bases[].id | string | |
| bases[].name | string | |
| bases[].prompt | string | |
| bases[].createdAt | datetime | |
| bases[].updatedAt | datetime | |
| hasMore | boolean | |
| nextCursor | string | null |
Errors
Problem Details (RFC 9457). Each code links to its reference page.
- 400 INVALID_REQUEST_QUERY — The request query is invalid.
- 400 INVALID_WORKSPACE_ID — The workspace is missing or invalid.
- 500 UNKNOWN_ERROR — An unexpected server error occurred. Please try again later.
Plus the auth-layer codes every endpoint can return
- 401 UNAUTHENTICATED — Authentication required.
- 403 EMAIL_NOT_VERIFIED — Your email address is not verified.
- 401 INVALID_USER — The authenticated user is invalid or missing.
- 400 INVALID_WORKSPACE_ID — The workspace is missing or invalid.
- 404 WORKSPACE_NOT_FOUND_OR_UNAUTHORIZED — Workspace not found or you do not have access.
- 403 FORBIDDEN — You do not have permission to access this resource.
- 429 RATE_LIMIT_EXCEEDED — Too many requests. Please wait.
POST/api/knowledge
Create a knowledge base.
Auth: Bearer token · any workspace member
Request body
application/json
| Field | Type | Notes |
|---|---|---|
| name * | string | min 1, matches ^[A-Za-z0-9_]+$, max 64 |
| prompt * | string | min 1, max 512 |
Responses
201 JSON body:
| Field | Type | Notes |
|---|---|---|
| base | object | |
| base.id | string | |
| base.name | string | |
| base.prompt | string | |
| base.createdAt | datetime | |
| base.updatedAt | datetime |
Errors
Problem Details (RFC 9457). Each code links to its reference page.
- 400 INVALID_REQUEST_BODY — The request body is invalid.
- 400 INVALID_WORKSPACE_ID — The workspace is missing or invalid.
- 409 RESOURCE_CONFLICT — The request conflicts with the current state of the target resource.
- 402 SUBSCRIPTION_LIMIT_EXCEEDED — You have reached the maximum limit for this action based on your subscription plan.
- 500 UNKNOWN_ERROR — An unexpected server error occurred. Please try again later.
Plus the auth-layer codes every endpoint can return
- 401 UNAUTHENTICATED — Authentication required.
- 403 EMAIL_NOT_VERIFIED — Your email address is not verified.
- 401 INVALID_USER — The authenticated user is invalid or missing.
- 400 INVALID_WORKSPACE_ID — The workspace is missing or invalid.
- 404 WORKSPACE_NOT_FOUND_OR_UNAUTHORIZED — Workspace not found or you do not have access.
- 403 FORBIDDEN — You do not have permission to access this resource.
- 429 RATE_LIMIT_EXCEEDED — Too many requests. Please wait.
GET/api/knowledge/{knowledgeId}
Fetch one knowledge base and the ids of the assistants using it.
Auth: Bearer token · any workspace member
Responses
200 JSON body:
| Field | Type | Notes |
|---|---|---|
| base | object | |
| base.id | string | |
| base.name | string | |
| base.prompt | string | |
| base.createdAt | datetime | |
| base.updatedAt | datetime | |
| base.assistantIds | string[] |
Errors
Problem Details (RFC 9457). Each code links to its reference page.
- 400 INVALID_KNOWLEDGE_ID — The knowledgeId is missing or invalid.
- 400 INVALID_WORKSPACE_ID — The workspace is missing or invalid.
- 404 KNOWLEDGE_NOT_FOUND_OR_UNAUTHORIZED — Knowledge base not found or you do not have access.
- 500 UNKNOWN_ERROR — An unexpected server error occurred. Please try again later.
Plus the auth-layer codes every endpoint can return
- 401 UNAUTHENTICATED — Authentication required.
- 403 EMAIL_NOT_VERIFIED — Your email address is not verified.
- 401 INVALID_USER — The authenticated user is invalid or missing.
- 400 INVALID_WORKSPACE_ID — The workspace is missing or invalid.
- 404 WORKSPACE_NOT_FOUND_OR_UNAUTHORIZED — Workspace not found or you do not have access.
- 403 FORBIDDEN — You do not have permission to access this resource.
- 429 RATE_LIMIT_EXCEEDED — Too many requests. Please wait.
PATCH/api/knowledge/{knowledgeId}
Rename a knowledge base or change its usage note.
RESOURCE_CONFLICT means another knowledge base in the workspace has that name, ignoring case.
Auth: Bearer token · any workspace member · a MEMBER may act only on rows they created (ADMIN/OWNER on any)
Request body
application/json
| Field | Type | Notes |
|---|---|---|
| name | string | min 1, matches ^[A-Za-z0-9_]+$, max 64 |
| prompt | string | min 1, max 512 |
Responses
200 JSON body:
| Field | Type | Notes |
|---|---|---|
| base | object | |
| base.id | string | |
| base.name | string | |
| base.prompt | string | |
| base.createdAt | datetime | |
| base.updatedAt | datetime |
Errors
Problem Details (RFC 9457). Each code links to its reference page.
- 403 INSUFFICIENT_PRIVILEGES — You do not have sufficient privileges to edit this resource.
- 400 INVALID_KNOWLEDGE_ID — The knowledgeId is missing or invalid.
- 400 INVALID_REQUEST_BODY — The request body is invalid.
- 400 INVALID_WORKSPACE_ID — The workspace is missing or invalid.
- 404 KNOWLEDGE_NOT_FOUND_OR_UNAUTHORIZED — Knowledge base not found or you do not have access.
- 409 RESOURCE_CONFLICT — The request conflicts with the current state of the target resource.
- 500 UNKNOWN_ERROR — An unexpected server error occurred. Please try again later.
Plus the auth-layer codes every endpoint can return
- 401 UNAUTHENTICATED — Authentication required.
- 403 EMAIL_NOT_VERIFIED — Your email address is not verified.
- 401 INVALID_USER — The authenticated user is invalid or missing.
- 400 INVALID_WORKSPACE_ID — The workspace is missing or invalid.
- 404 WORKSPACE_NOT_FOUND_OR_UNAUTHORIZED — Workspace not found or you do not have access.
- 403 FORBIDDEN — You do not have permission to access this resource.
- 429 RATE_LIMIT_EXCEEDED — Too many requests. Please wait.
DELETE/api/knowledge/{knowledgeId}
Delete a knowledge base and every document in it.
Auth: Bearer token · any workspace member · a MEMBER may act only on rows they created (ADMIN/OWNER on any)
Responses
204 No body.
Errors
Problem Details (RFC 9457). Each code links to its reference page.
- 403 INSUFFICIENT_PRIVILEGES — You do not have sufficient privileges to edit this resource.
- 400 INVALID_KNOWLEDGE_ID — The knowledgeId is missing or invalid.
- 400 INVALID_WORKSPACE_ID — The workspace is missing or invalid.
- 404 KNOWLEDGE_NOT_FOUND_OR_UNAUTHORIZED — Knowledge base not found or you do not have access.
- 500 UNKNOWN_ERROR — An unexpected server error occurred. Please try again later.
Plus the auth-layer codes every endpoint can return
- 401 UNAUTHENTICATED — Authentication required.
- 403 EMAIL_NOT_VERIFIED — Your email address is not verified.
- 401 INVALID_USER — The authenticated user is invalid or missing.
- 400 INVALID_WORKSPACE_ID — The workspace is missing or invalid.
- 404 WORKSPACE_NOT_FOUND_OR_UNAUTHORIZED — Workspace not found or you do not have access.
- 403 FORBIDDEN — You do not have permission to access this resource.
- 429 RATE_LIMIT_EXCEEDED — Too many requests. Please wait.
GET/api/knowledge/index-status
Count the workspace's documents that failed to index, or are stuck for more than ten minutes.
Auth: Bearer token · any workspace member
Responses
200 JSON body:
| Field | Type | Notes |
|---|---|---|
| notSearchable | number | |
| bases | object[] | |
| bases[].baseId | string | |
| bases[].baseName | string | |
| bases[].count | number |
bases lists only bases with at least one counted document, highest count first. An empty array means no document needs attention.
Errors
Problem Details (RFC 9457). Each code links to its reference page.
- 400 INVALID_WORKSPACE_ID — The workspace is missing or invalid.
- 500 UNKNOWN_ERROR — An unexpected server error occurred. Please try again later.
Plus the auth-layer codes every endpoint can return
- 401 UNAUTHENTICATED — Authentication required.
- 403 EMAIL_NOT_VERIFIED — Your email address is not verified.
- 401 INVALID_USER — The authenticated user is invalid or missing.
- 400 INVALID_WORKSPACE_ID — The workspace is missing or invalid.
- 404 WORKSPACE_NOT_FOUND_OR_UNAUTHORIZED — Workspace not found or you do not have access.
- 403 FORBIDDEN — You do not have permission to access this resource.
- 429 RATE_LIMIT_EXCEEDED — Too many requests. Please wait.
GET/api/knowledge/{knowledgeId}/documents
List a knowledge base's documents, newest first.
Document reads share one per-workspace rate limit across list, detail and PDF.
Auth: Bearer token · any workspace member
Query parameters
| Field | Type | Notes |
|---|---|---|
| limit | integer 1–100 | Rows per page. Default 20. |
| cursor | string | The nextCursor from the previous page. |
Responses
200 JSON body:
| Field | Type | Notes |
|---|---|---|
| documents | object[] | |
| documents[].id | string | |
| documents[].name | string | |
| documents[].mime_type | enum: PDF | JPEG_IMAGE | PNG_IMAGE | MP3_AUDIO | MP4_VIDEO | JSON | CSV | PLAIN_TEXT | URL | null | |
| documents[].url | string | null | |
| documents[].indexStatus | enum: PENDING | INDEXING | INDEXED | FAILED | |
| documents[].indexedAt | datetime | null | |
| documents[].indexAttempts | number | |
| documents[].deleteRequestedAt | datetime | null | |
| documents[].createdAt | datetime | |
| documents[].updatedAt | datetime | |
| hasMore | boolean | |
| nextCursor | string | null |
Errors
Problem Details (RFC 9457). Each code links to its reference page.
- 400 INVALID_KNOWLEDGE_ID — The knowledgeId is missing or invalid.
- 400 INVALID_REQUEST_QUERY — The request query is invalid.
- 400 INVALID_WORKSPACE_ID — The workspace is missing or invalid.
- 404 KNOWLEDGE_NOT_FOUND_OR_UNAUTHORIZED — Knowledge base not found or you do not have access.
- 429 RATE_LIMIT_EXCEEDED — Too many requests. Please wait.
- 500 UNKNOWN_ERROR — An unexpected server error occurred. Please try again later.
Plus the auth-layer codes every endpoint can return
- 401 UNAUTHENTICATED — Authentication required.
- 403 EMAIL_NOT_VERIFIED — Your email address is not verified.
- 401 INVALID_USER — The authenticated user is invalid or missing.
- 400 INVALID_WORKSPACE_ID — The workspace is missing or invalid.
- 404 WORKSPACE_NOT_FOUND_OR_UNAUTHORIZED — Workspace not found or you do not have access.
- 403 FORBIDDEN — You do not have permission to access this resource.
- 429 RATE_LIMIT_EXCEEDED — Too many requests. Please wait.
POST/api/knowledge/{knowledgeId}/documents
Add a document from text you send (type PLAIN_TEXT or URL) and index it.
Auth: Bearer token · any workspace member
Request body
application/json
Over JSON only the PLAIN_TEXT and URL variants are usable; the PDF variant needs a binary fileBuffer, which JSON cannot carry (the dashboard uploads PDFs through a session-only route).
When type = "PDF":
| Field | Type | Notes |
|---|---|---|
| type * | "PDF" | |
| name * | string | min 1, max 96 |
| fileBuffer * | any | |
| text * | string | min 1 |
When type = "PLAIN_TEXT":
| Field | Type | Notes |
|---|---|---|
| type * | "PLAIN_TEXT" | |
| name * | string | min 1, max 96 |
| text * | string | min 1 |
When type = "URL":
| Field | Type | Notes |
|---|---|---|
| type * | "URL" | |
| url * | string | URL |
| name * | string | min 1, max 96 |
| text * | string | min 1 |
Responses
201 JSON body:
| Field | Type | Notes |
|---|---|---|
| documentId | string | |
| documentName | string | |
| mimeType | enum: PDF | JPEG_IMAGE | PNG_IMAGE | MP3_AUDIO | MP4_VIDEO | JSON | CSV | PLAIN_TEXT | URL | null |
Errors
Problem Details (RFC 9457). Each code links to its reference page.
- 502 DOCUMENT_INDEXING_FAILED — The search index could not be updated. Please try again.
- 400 INVALID_KNOWLEDGE_ID — The knowledgeId is missing or invalid.
- 400 INVALID_REQUEST_BODY — The request body is invalid.
- 400 INVALID_WORKSPACE_ID — The workspace is missing or invalid.
- 404 KNOWLEDGE_NOT_FOUND_OR_UNAUTHORIZED — Knowledge base not found or you do not have access.
- 409 RESOURCE_CONFLICT — The request conflicts with the current state of the target resource.
- 402 SUBSCRIPTION_LIMIT_EXCEEDED — You have reached the maximum limit for this action based on your subscription plan.
- 500 UNKNOWN_ERROR — An unexpected server error occurred. Please try again later.
Plus the auth-layer codes every endpoint can return
- 401 UNAUTHENTICATED — Authentication required.
- 403 EMAIL_NOT_VERIFIED — Your email address is not verified.
- 401 INVALID_USER — The authenticated user is invalid or missing.
- 400 INVALID_WORKSPACE_ID — The workspace is missing or invalid.
- 404 WORKSPACE_NOT_FOUND_OR_UNAUTHORIZED — Workspace not found or you do not have access.
- 403 FORBIDDEN — You do not have permission to access this resource.
- 429 RATE_LIMIT_EXCEEDED — Too many requests. Please wait.
GET/api/knowledge/{knowledgeId}/documents/{documentId}
Fetch one document, including its extracted text.
Auth: Bearer token · any workspace member
Responses
200 JSON body:
| Field | Type | Notes |
|---|---|---|
| document | object | content is the extracted text. The raw PDF bytes are never returned here. |
| document.id | string | |
| document.baseId | string | |
| document.name | string | |
| document.mime_type | enum: PDF | JPEG_IMAGE | PNG_IMAGE | MP3_AUDIO | MP4_VIDEO | JSON | CSV | PLAIN_TEXT | URL | null | |
| document.content | string | null | |
| document.createdAt | datetime | |
| document.updatedAt | datetime | |
| document.url | string | null | |
| document.indexStatus | enum: PENDING | INDEXING | INDEXED | FAILED | |
| document.indexedAt | datetime | null | |
| document.indexAttempts | number | |
| document.deleteRequestedAt | datetime | null | |
| document.lastReconciledAt | datetime | null |
Errors
Problem Details (RFC 9457). Each code links to its reference page.
- 404 DOCUMENT_NOT_FOUND_OR_UNAUTHORIZED — Document not found or you do not have access.
- 400 INVALID_DOCUMENT_ID — The documentId is missing or invalid.
- 400 INVALID_KNOWLEDGE_ID — The knowledgeId is missing or invalid.
- 400 INVALID_WORKSPACE_ID — The workspace is missing or invalid.
- 404 KNOWLEDGE_NOT_FOUND_OR_UNAUTHORIZED — Knowledge base not found or you do not have access.
- 429 RATE_LIMIT_EXCEEDED — Too many requests. Please wait.
- 500 UNKNOWN_ERROR — An unexpected server error occurred. Please try again later.
Plus the auth-layer codes every endpoint can return
- 401 UNAUTHENTICATED — Authentication required.
- 403 EMAIL_NOT_VERIFIED — Your email address is not verified.
- 401 INVALID_USER — The authenticated user is invalid or missing.
- 400 INVALID_WORKSPACE_ID — The workspace is missing or invalid.
- 404 WORKSPACE_NOT_FOUND_OR_UNAUTHORIZED — Workspace not found or you do not have access.
- 403 FORBIDDEN — You do not have permission to access this resource.
- 429 RATE_LIMIT_EXCEEDED — Too many requests. Please wait.
GET/api/knowledge/{knowledgeId}/documents/pdf
Download a PDF document's original file.
A document that is not a PDF, or has no stored file, answers DOCUMENT_NOT_FOUND_OR_UNAUTHORIZED. Shares the document-read rate limit with the list and detail.
Auth: Bearer token · any workspace member
Query parameters
| Field | Type | Notes |
|---|---|---|
| documentId * | string | The PDF document to download. |
Responses
200 application/pdf The file's bytes, with Cache-Control: private, no-store.
Errors
Problem Details (RFC 9457). Each code links to its reference page.
- 404 DOCUMENT_NOT_FOUND_OR_UNAUTHORIZED — Document not found or you do not have access.
- 400 INVALID_DOCUMENT_ID — The documentId is missing or invalid.
- 400 INVALID_KNOWLEDGE_ID — The knowledgeId is missing or invalid.
- 400 INVALID_WORKSPACE_ID — The workspace is missing or invalid.
- 404 KNOWLEDGE_NOT_FOUND_OR_UNAUTHORIZED — Knowledge base not found or you do not have access.
- 429 RATE_LIMIT_EXCEEDED — Too many requests. Please wait.
- 500 UNKNOWN_ERROR — An unexpected server error occurred. Please try again later.
Plus the auth-layer codes every endpoint can return
- 401 UNAUTHENTICATED — Authentication required.
- 403 EMAIL_NOT_VERIFIED — Your email address is not verified.
- 401 INVALID_USER — The authenticated user is invalid or missing.
- 400 INVALID_WORKSPACE_ID — The workspace is missing or invalid.
- 404 WORKSPACE_NOT_FOUND_OR_UNAUTHORIZED — Workspace not found or you do not have access.
- 403 FORBIDDEN — You do not have permission to access this resource.
- 429 RATE_LIMIT_EXCEEDED — Too many requests. Please wait.
PATCH/api/knowledge/{knowledgeId}/documents/{documentId}
Rename a document, or replace its text and re-index it.
RESOURCE_CONFLICT means another document in the knowledge base has that name, ignoring case.
Auth: Bearer token · any workspace member · a MEMBER may act only on rows they created (ADMIN/OWNER on any)
Request body
application/json
Send name, text or both; other keys are ignored, and a body with neither answers INVALID_REQUEST_BODY. A name-only body renames in place (indexStatus unchanged); a body with text saves and answers indexStatus: PENDING while re-indexing runs.
| Field | Type | Notes |
|---|---|---|
| name | string | min 1, max 96 |
| text | string | min 1 |
Responses
200 JSON body:
| Field | Type | Notes |
|---|---|---|
| documentId | string | |
| documentName | string | |
| type | enum: PDF | JPEG_IMAGE | PNG_IMAGE | MP3_AUDIO | MP4_VIDEO | JSON | CSV | PLAIN_TEXT | URL | null | |
| indexStatus | enum: PENDING | INDEXING | INDEXED | FAILED |
Errors
Problem Details (RFC 9457). Each code links to its reference page.
- 502 DOCUMENT_INDEXING_FAILED — The search index could not be updated. Please try again.
- 404 DOCUMENT_NOT_FOUND_OR_UNAUTHORIZED — Document not found or you do not have access.
- 403 INSUFFICIENT_PRIVILEGES — You do not have sufficient privileges to edit this resource.
- 400 INVALID_DOCUMENT_ID — The documentId is missing or invalid.
- 400 INVALID_KNOWLEDGE_ID — The knowledgeId is missing or invalid.
- 400 INVALID_REQUEST_BODY — The request body is invalid.
- 400 INVALID_WORKSPACE_ID — The workspace is missing or invalid.
- 404 KNOWLEDGE_NOT_FOUND_OR_UNAUTHORIZED — Knowledge base not found or you do not have access.
- 409 RESOURCE_CONFLICT — The request conflicts with the current state of the target resource.
- 402 SUBSCRIPTION_LIMIT_EXCEEDED — You have reached the maximum limit for this action based on your subscription plan.
- 500 UNKNOWN_ERROR — An unexpected server error occurred. Please try again later.
Plus the auth-layer codes every endpoint can return
- 401 UNAUTHENTICATED — Authentication required.
- 403 EMAIL_NOT_VERIFIED — Your email address is not verified.
- 401 INVALID_USER — The authenticated user is invalid or missing.
- 400 INVALID_WORKSPACE_ID — The workspace is missing or invalid.
- 404 WORKSPACE_NOT_FOUND_OR_UNAUTHORIZED — Workspace not found or you do not have access.
- 403 FORBIDDEN — You do not have permission to access this resource.
- 429 RATE_LIMIT_EXCEEDED — Too many requests. Please wait.
DELETE/api/knowledge/{knowledgeId}/documents/{documentId}
Delete a document and its search vectors.
Auth: Bearer token · any workspace member · a MEMBER may act only on rows they created (ADMIN/OWNER on any)
Responses
204 No body.
Errors
Problem Details (RFC 9457). Each code links to its reference page.
- 502 DOCUMENT_DELETE_FAILED — The document could not be removed from the search index. Please try again.
- 404 DOCUMENT_NOT_FOUND_OR_UNAUTHORIZED — Document not found or you do not have access.
- 403 INSUFFICIENT_PRIVILEGES — You do not have sufficient privileges to edit this resource.
- 400 INVALID_DOCUMENT_ID — The documentId is missing or invalid.
- 400 INVALID_KNOWLEDGE_ID — The knowledgeId is missing or invalid.
- 400 INVALID_WORKSPACE_ID — The workspace is missing or invalid.
- 404 KNOWLEDGE_NOT_FOUND_OR_UNAUTHORIZED — Knowledge base not found or you do not have access.
- 500 UNKNOWN_ERROR — An unexpected server error occurred. Please try again later.
Plus the auth-layer codes every endpoint can return
- 401 UNAUTHENTICATED — Authentication required.
- 403 EMAIL_NOT_VERIFIED — Your email address is not verified.
- 401 INVALID_USER — The authenticated user is invalid or missing.
- 400 INVALID_WORKSPACE_ID — The workspace is missing or invalid.
- 404 WORKSPACE_NOT_FOUND_OR_UNAUTHORIZED — Workspace not found or you do not have access.
- 403 FORBIDDEN — You do not have permission to access this resource.
- 429 RATE_LIMIT_EXCEEDED — Too many requests. Please wait.
POST/api/knowledge/{knowledgeId}/documents/{documentId}/reindex
Queue a document for re-indexing.
No request body. The work runs after the response; poll the document's indexStatus. queued: false means the document was already INDEXING, so nothing new was queued. A claim from a lost job stays INDEXING until the daily sweep marks it FAILED.
Auth: Bearer token · any workspace member · a MEMBER may act only on rows they created (ADMIN/OWNER on any)
Responses
200 JSON body:
| Field | Type | Notes |
|---|---|---|
| documentId | string | |
| indexStatus | "PENDING" | "INDEXING" | |
| queued | boolean |
Errors
Problem Details (RFC 9457). Each code links to its reference page.
- 404 DOCUMENT_NOT_FOUND_OR_UNAUTHORIZED — Document not found or you do not have access.
- 403 INSUFFICIENT_PRIVILEGES — You do not have sufficient privileges to edit this resource.
- 400 INVALID_DOCUMENT_ID — The documentId is missing or invalid.
- 400 INVALID_KNOWLEDGE_ID — The knowledgeId is missing or invalid.
- 400 INVALID_WORKSPACE_ID — The workspace is missing or invalid.
- 404 KNOWLEDGE_NOT_FOUND_OR_UNAUTHORIZED — Knowledge base not found or you do not have access.
- 500 UNKNOWN_ERROR — An unexpected server error occurred. Please try again later.
Plus the auth-layer codes every endpoint can return
- 401 UNAUTHENTICATED — Authentication required.
- 403 EMAIL_NOT_VERIFIED — Your email address is not verified.
- 401 INVALID_USER — The authenticated user is invalid or missing.
- 400 INVALID_WORKSPACE_ID — The workspace is missing or invalid.
- 404 WORKSPACE_NOT_FOUND_OR_UNAUTHORIZED — Workspace not found or you do not have access.
- 403 FORBIDDEN — You do not have permission to access this resource.
- 429 RATE_LIMIT_EXCEEDED — Too many requests. Please wait.