Add a knowledge-base document
import MoreVoice from "@morevoice/sdk";
const mv = new MoreVoice(); // MOREVOICE_API_KEY from the environment
const kbDocument = await mv.kbDocuments.create({ text: "# Opening hours\nSunday–Thursday 08:00–18:00, Friday 08:00–13:00.", title: "Opening hours",});console.log(kbDocument);from morevoice import MoreVoice
client = MoreVoice() # MOREVOICE_API_KEY from the environment
kb_document = client.kb_documents.create({ "text": "# Opening hours\nSunday–Thursday 08:00–18:00, Friday 08:00–13:00.", "title": "Opening hours",})print(kb_document)curl -X POST https://api.morevoice.ai/v1/kb/documents \ -H "Authorization: Bearer $MOREVOICE_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "text": "# Opening hours\nSunday–Thursday 08:00–18:00, Friday 08:00–13:00.", "title": "Opening hours"}'Adds a document from a file (JSON with base64, or multipart/form-data with a file part, ≤ 25 MB), a public URL, or text, and indexes it in the background: answers 202 with the document pending. Poll it until status is ready (searchable) or error. Beyond the plan’s knowledge-base storage: 402 plan_limit.
Try it in the API playground with a test-mode key.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”The API version to use for this request. Defaults to the version the API key is pinned to.
Example
2026-11-01A unique key (for example a UUID) that makes this request safe to retry: for 24 hours, a retry with the same key and parameters returns the first response instead of acting twice.
Example
5f0c1e8a-7b2d-4c3e-9f1a-2b6d8e4c0a17Request Bodyrequired
Section titled “Request Bodyrequired”A document to add: exactly one of file, url and text. It is indexed in the background (202): poll it until status is ready.
object
A file to upload. Or send the request as multipart/form-data with a file part.
object
The file, base64-encoded (≤ 25 MB decoded).
Its name; the extension picks the format (.pdf, .docx, .xlsx, .csv, .md, .txt, .html).
With text: how to read it (default md).
Text to index as it is.
Default: the file’s name, the page’s title, or (text) “Document”.
A public web page or file (http/https) to fetch and index. It is fetched again on reingest.
Example
{ "text": "# Opening hours\nSunday–Thursday 08:00–18:00, Friday 08:00–13:00.", "title": "Opening hours"}A file upload as multipart/form-data.
object
The file (up to 25 MB): PDF, DOCX, XLSX, CSV, Markdown, text or HTML.
Default: the file’s name.
Responses
Section titled “Responses”Accepted: the document is indexed in the background.
A document in your knowledge base: assistants and the agent copilot answer from it.
object
Searchable passages the document was split into.
An ISO-8601 timestamp in UTC.
Why ingestion failed (status error).
The document’s ID.
The format it was read as; url for a web page.
true in live mode, false in test mode.
The original file is kept (encrypted): GET …/content downloads it and reingest re-reads it.
The uploaded file’s name, or the URL.
Pending → processing → ready (searchable) | error. Poll the document, or follow kb.document.* events.
An ISO-8601 timestamp in UTC.
Example
{ "bytes": 184320, "chunk_count": 42, "created": "2026-11-03T09:14:22.000Z", "error": null, "id": "kbd_6Nq0Sv3Xa5Cf8Hk1Mp4Rt7", "kind": "pdf", "livemode": true, "object": "kb_document", "original_stored": true, "source": "price-list-2026.pdf", "status": "ready", "title": "Price list 2026", "updated": "2026-11-03T09:14:31.000Z"}The request is invalid: a parameter is missing, malformed or unknown, or the version header is unknown.
Every /v1 error.
object
object
A stable, machine-readable code from the error-code catalogue.
Structured context, e.g. required_scope or the compliance verdict.
object
A link to the documentation of this code.
A human-readable explanation. Do not parse it.
The request parameter the error relates to, e.g. to or metadata[order_id].
The X-Request-Id of this request. Quote it when you contact support.
The category of the error.
Example
{ "error": { "code": "parameter_missing", "doc_url": "https://docs.morevoice.ai/api/errors#parameter-missing", "message": "Missing required parameter: to.", "param": "to", "request_id": "req_7Hk2LmN9pQ4rS6tV8wX0yZ", "type": "invalid_request_error" }}Headers
Section titled “Headers”The request’s ID (req_…). Quote it when you contact support.
No valid API key was sent.
Every /v1 error.
object
object
A stable, machine-readable code from the error-code catalogue.
Structured context, e.g. required_scope or the compliance verdict.
object
A link to the documentation of this code.
A human-readable explanation. Do not parse it.
The request parameter the error relates to, e.g. to or metadata[order_id].
The X-Request-Id of this request. Quote it when you contact support.
The category of the error.
Example
{ "error": { "code": "invalid_api_key", "doc_url": "https://docs.morevoice.ai/api/errors#invalid-api-key", "message": "Invalid API key.", "request_id": "req_7Hk2LmN9pQ4rS6tV8wX0yZ", "type": "authentication_error" }}Headers
Section titled “Headers”The request’s ID (req_…). Quote it when you contact support.
The key may not do this (a missing scope, a plan limit, or a compliance block).
Every /v1 error.
object
object
A stable, machine-readable code from the error-code catalogue.
Structured context, e.g. required_scope or the compliance verdict.
object
A link to the documentation of this code.
A human-readable explanation. Do not parse it.
The request parameter the error relates to, e.g. to or metadata[order_id].
The X-Request-Id of this request. Quote it when you contact support.
The category of the error.
Example
{ "error": { "code": "missing_scope", "doc_url": "https://docs.morevoice.ai/api/errors#missing-scope", "message": "This API key lacks the calls:write scope.", "request_id": "req_7Hk2LmN9pQ4rS6tV8wX0yZ", "type": "permission_error" }}Headers
Section titled “Headers”The request’s ID (req_…). Quote it when you contact support.
The request conflicts with the object’s state, or the Idempotency-Key was reused with other parameters.
Every /v1 error.
object
object
A stable, machine-readable code from the error-code catalogue.
Structured context, e.g. required_scope or the compliance verdict.
object
A link to the documentation of this code.
A human-readable explanation. Do not parse it.
The request parameter the error relates to, e.g. to or metadata[order_id].
The X-Request-Id of this request. Quote it when you contact support.
The category of the error.
Example
{ "error": { "code": "idempotency_mismatch", "doc_url": "https://docs.morevoice.ai/api/errors#idempotency-mismatch", "message": "This Idempotency-Key was already used with different parameters.", "request_id": "req_7Hk2LmN9pQ4rS6tV8wX0yZ", "type": "idempotency_error" }}Headers
Section titled “Headers”The request’s ID (req_…). Quote it when you contact support.
Too many requests, or no call capacity right now. Retry after the Retry-After delay.
Every /v1 error.
object
object
A stable, machine-readable code from the error-code catalogue.
Structured context, e.g. required_scope or the compliance verdict.
object
A link to the documentation of this code.
A human-readable explanation. Do not parse it.
The request parameter the error relates to, e.g. to or metadata[order_id].
The X-Request-Id of this request. Quote it when you contact support.
The category of the error.
Example
{ "error": { "code": "rate_limited", "doc_url": "https://docs.morevoice.ai/api/errors#rate-limited", "message": "Too many requests. Retry after 1 second.", "request_id": "req_7Hk2LmN9pQ4rS6tV8wX0yZ", "type": "rate_limit_error" }}Headers
Section titled “Headers”Seconds to wait before retrying.
The request’s ID (req_…). Quote it when you contact support.
Something went wrong on MoreVoice’s side. Retry with the same Idempotency-Key.
Every /v1 error.
object
object
A stable, machine-readable code from the error-code catalogue.
Structured context, e.g. required_scope or the compliance verdict.
object
A link to the documentation of this code.
A human-readable explanation. Do not parse it.
The request parameter the error relates to, e.g. to or metadata[order_id].
The X-Request-Id of this request. Quote it when you contact support.
The category of the error.
Example
{ "error": { "code": "internal_error", "doc_url": "https://docs.morevoice.ai/api/errors#internal-error", "message": "Something went wrong on MoreVoice's side.", "request_id": "req_7Hk2LmN9pQ4rS6tV8wX0yZ", "type": "api_error" }}Headers
Section titled “Headers”The request’s ID (req_…). Quote it when you contact support.