Vector Store

Add Document

POST/api/v1/vector-stores/{id}/documents

Adds one document to the store. Send exactly one of:

  • mediaFileId: a file you uploaded with Media Manager → Upload File (multipart) (up to 25 MB). Supported formats include PDF, DOCX, PPTX, XLSX, TXT, MD, CSV, JSON and HTML; images, audio and video are rejected with 422.
  • text with name: plain text, saved as a Markdown file (<name>.md) in your media manager and then added. Use this for FAQs, policies and price lists. Limited to the 1 MB request size.

The response returns once the document is uploaded; indexing continues in the background. Poll Detail until documents.inProgress is 0 before relying on it.

Changing a document means removing it and adding the new version.

Request

Authorization

Bearer Token

Provide your API token in the Authorization header. See Authentication to issue one.

Example:Authorization: Bearer ********************

Path Params
  • idstringrequired

    Vector store ID (vs_...).

    Example:vs_6ae7fb336d6c8191842d074ec05637f1

Body Paramsapplication/json
  • mediaFileIdstring<uuid>optional

    ID of a media-manager file in your workspace.

  • namestringoptional

    Document name, 1-200 characters. Required with text. With mediaFileId it is optional and defaults to the file's name; the file extension is kept.

  • textstringoptional

    Plain text or Markdown content.

Responses

201

Created

  • requestIdstringrequired

    Unique ID for this request. Quote it when reporting a problem.

  • dataobjectrequired
    Child attributes
    • idstringrequired

      Document ID (file-...). Use it to remove the document.

    • namestringrequired

      File name, including extension.

    • createdAtstring | nullrequired

      ISO 8601.

    • mediaFileIdstringrequired

      The media-manager file the document was created from. For text documents this is the new Markdown file in your media manager.

400

Neither or both of mediaFileId and text were sent, or text was sent without name.

  • messagestringrequired
401

API key missing, invalid, revoked or expired.

  • messagestringrequired
404

No vector store with this ID, or no media file with this mediaFileId, in your workspace.

  • messagestringrequired
413

The file is too large to index.

  • messagestringrequired
422

The media file's format cannot be searched.

  • messagestringrequired
429

Rate limit reached. Retry after a short pause.

  • messagestringrequired
502

The AI agent service is temporarily unavailable. Retry shortly.

  • messagestringrequired