Skip to main content
POST
https://api.memcontext.in
/
api
/
company-brain
/
documents
Ingest context vault document
curl --request POST \
  --url https://api.memcontext.in/api/company-brain/documents \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "title": "<string>"
}
'
{
  "document": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "sourceType": "<string>",
    "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,
  "message": "<string>"
}

Authorizations

X-API-Key
string
header
required

API key created from the MemContext dashboard. Keys are prefixed with mc_.

Body

application/json
workspaceId
string<uuid>
required
title
string
required
Maximum string length: 200
content
string

Extracted text/Markdown for v1 JSON ingestion. Required unless uri is provided.

Maximum string length: 250000
sourceType
enum<string>
Available options:
pdf,
markdown,
text,
docx,
html,
url,
csv,
png,
jpg,
jpeg,
webp,
tiff
scope
string
Maximum string length: 200
project
string
Maximum string length: 100
mimeType
string
originalFilename
string
uri
string<uri>

Public documentation/web URL or public file URL. Set sourceType for file URLs such as pdf, docx, markdown, text, csv, or an image type.

crawlSubpages
boolean
default:true

Crawl linked subpages from a documentation/web URL. For docs sites with llms.txt, MemContext discovers canonical pages first and ingests only priority pages. Ignored for remote file URL ingestion.

priorityPageLimit
integer
default:15

Maximum priority pages to fetch from a discovered docs index such as llms.txt.

Required range: 1 <= x <= 25
subpageTarget
string[]

Terms to prioritize when crawling subpages.

Maximum array length: 8
Maximum string length: 100
category
enum<string>
  • preference - User likes or dislikes (e.g. "prefers dark mode").
  • fact - Objective information (e.g. "uses macOS").
  • decision - Choices made (e.g. "chose the new billing provider").
  • context - Background information (e.g. "working on e-commerce app").
Available options:
preference,
fact,
decision,
context

Response

202 - application/json

Document accepted and added to the workspace document list.

document
object
required
chunkCount
integer
required
extractedCount
integer
required
status
enum<string>
required
Available options:
accepted
message
string
required