Add Document
/api/v1/vector-stores/{id}/documentsAdds 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 with422.textwithname: 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 ********************
idstringrequiredVector store ID (
vs_...).Example:vs_6ae7fb336d6c8191842d074ec05637f1
mediaFileIdstring<uuid>optionalID of a media-manager file in your workspace.
namestringoptionalDocument name, 1-200 characters. Required with
text. WithmediaFileIdit is optional and defaults to the file's name; the file extension is kept.textstringoptionalPlain text or Markdown content.
Responses
201Created
Created
requestIdstringrequiredUnique ID for this request. Quote it when reporting a problem.
dataobjectrequiredChild attributes
idstringrequiredDocument ID (
file-...). Use it to remove the document.namestringrequiredFile name, including extension.
createdAtstring | nullrequiredISO 8601.
mediaFileIdstringrequiredThe media-manager file the document was created from. For
textdocuments this is the new Markdown file in your media manager.
400Neither or both of mediaFileId and text were sent, or text was sent without name.
Neither or both of mediaFileId and text were sent, or text was sent without name.
messagestringrequired
401API key missing, invalid, revoked or expired.
API key missing, invalid, revoked or expired.
messagestringrequired
404No vector store with this ID, or no media file with this mediaFileId, in your workspace.
No vector store with this ID, or no media file with this mediaFileId, in your workspace.
messagestringrequired
413The file is too large to index.
The file is too large to index.
messagestringrequired
422The media file's format cannot be searched.
The media file's format cannot be searched.
messagestringrequired
429Rate limit reached. Retry after a short pause.
Rate limit reached. Retry after a short pause.
messagestringrequired
502The AI agent service is temporarily unavailable. Retry shortly.
The AI agent service is temporarily unavailable. Retry shortly.
messagestringrequired