Upload and ingest context vault document
curl --request POST \
--url https://api.memcontext.in/api/context-vault/documents/upload \
--header 'Content-Type: multipart/form-data' \
--header 'X-API-Key: <api-key>' \
--form workspaceId=3c90c3cc-0d44-4b50-8888-8dd25736052a \
--form 'title=<string>' \
--form file='@example-file'const form = new FormData();
form.append('workspaceId', '3c90c3cc-0d44-4b50-8888-8dd25736052a');
form.append('title', '<string>');
form.append('file', '<string>');
const options = {method: 'POST', headers: {'X-API-Key': '<api-key>'}};
options.body = form;
fetch('https://api.memcontext.in/api/context-vault/documents/upload', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.memcontext.in/api/context-vault/documents/upload"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = {
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>"
}
headers = {"X-API-Key": "<api-key>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text){
"document": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sourceType": "<string>",
"status": "pending",
"chunkCount": 123,
"extractedCount": 123,
"totalChunks": 123,
"processedChunks": 123,
"createdAt": "2023-11-07T05:31:56Z",
"title": "<string>",
"processingPhase": "<string>",
"heartbeatAt": "2023-11-07T05:31:56Z",
"scope": "<string>",
"project": "<string>",
"completedAt": "2023-11-07T05:31:56Z",
"error": "<string>",
"publicUrl": "<string>"
},
"chunkCount": 123,
"extractedCount": 123,
"status": "accepted",
"message": "<string>"
}Context Vault
Upload and ingest context vault document
Uploads a local file and adds it to Context Vault. Supports PDFs, Markdown, TXT, DOCX, CSV, and image files. OCR is available for formats that need text extraction.
POST
https://api.memcontext.in
/
api
/
context-vault
/
documents
/
upload
Upload and ingest context vault document
curl --request POST \
--url https://api.memcontext.in/api/context-vault/documents/upload \
--header 'Content-Type: multipart/form-data' \
--header 'X-API-Key: <api-key>' \
--form workspaceId=3c90c3cc-0d44-4b50-8888-8dd25736052a \
--form 'title=<string>' \
--form file='@example-file'const form = new FormData();
form.append('workspaceId', '3c90c3cc-0d44-4b50-8888-8dd25736052a');
form.append('title', '<string>');
form.append('file', '<string>');
const options = {method: 'POST', headers: {'X-API-Key': '<api-key>'}};
options.body = form;
fetch('https://api.memcontext.in/api/context-vault/documents/upload', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.memcontext.in/api/context-vault/documents/upload"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = {
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>"
}
headers = {"X-API-Key": "<api-key>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text){
"document": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sourceType": "<string>",
"status": "pending",
"chunkCount": 123,
"extractedCount": 123,
"totalChunks": 123,
"processedChunks": 123,
"createdAt": "2023-11-07T05:31:56Z",
"title": "<string>",
"processingPhase": "<string>",
"heartbeatAt": "2023-11-07T05:31:56Z",
"scope": "<string>",
"project": "<string>",
"completedAt": "2023-11-07T05:31:56Z",
"error": "<string>",
"publicUrl": "<string>"
},
"chunkCount": 123,
"extractedCount": 123,
"status": "accepted",
"message": "<string>"
}Authorizations
ApiKeyAuthCookieAuth
API key created from the MemContext dashboard. Keys are prefixed with mc_, bound to one workspace, and API-key requests cannot override that workspace.
Body
multipart/form-data
Optional vault inside the workspace. Defaults to the workspace's default vault.
Available options:
pdf, markdown, text, docx, html, url, csv, png, jpg, jpeg, webp, tiff Optional extracted text override for binary files.
Response
202 - application/json
File uploaded and added to the workspace document list.
Hide child attributes
Hide child attributes
Available options:
pending, processing, retrying, completed, failed, cancelled Available options:
accepted 