Skip to main content
A namespace is a named set of documents, like docs or user-42. Every write names one, and the first write creates it. Give each of your users their own namespace to keep their data apart.

List namespaces

GET /namespaces Returns the namespaces that hold documents, in name order.
Response

Request

  • prefix (string): Only namespaces whose names start with this.

Create a namespace

POST /namespaces Only needed for a namespace with a sparse index. Create it before its first write.
Response

Request

  • name (string, required): 1-64 characters of a-z 0-9 _ -, starting with a letter or digit.
  • sparse (boolean, default false): Give the namespace a sparse index.

Sparse index

A sparse index lets queries use the sparse retriever, which also matches words related to the query’s. Writes to a sparse namespace are slower. A namespace’s index is fixed: creating an existing namespace with the other setting returns 409 conflict. To switch, create a new namespace with the other setting and write your documents to it.

Delete a namespace

DELETE /namespaces/:namespace Deletes the namespace and all its documents. This can’t be undone. The name can be used again right away.
Response
  • Deleting it again also returns {"deleted": true}. A name that was never written returns 404 namespace_not_found.
  • Delete its sources first, or their next sync writes the namespace again.