Add document
JavaScript
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({content: '<string>'})
};
fetch('https://api.supermemory.ai/v3/documents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
Response
{
"id": "<string>",
"status": "<string>"
}
Authorizations
Authorizationstringheader
required
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
contentstring
required
The content to extract and process into a document. This can be a URL to a website, a PDF, an image, or a video.
containerTagstring
Optional tag this document should be containerized by. Max 100 characters, alphanumeric with hyphens, underscores, and dots only.
entityContextstring
Optional entity context for this container tag. Max 1500 characters. Used during document processing to guide memory extraction.
customIdstring
Optional custom ID of the document. Max 100 characters, alphanumeric with hyphens, underscores, and dots only.
metadataobject
Optional metadata for the document.
taskTypeenum<string>
Task type: "memory" (default) for full context layer with SuperRAG built in, "superrag" for managed RAG as a service.
Available options: memory, superrag
Response
200
application/json
Document added successfully
idstring
required
Unique identifier of the document
statusstring
required
Status of the document
Documentation Index
Fetch the complete documentation index at: https://supermemory.ai/docs/llms.txt
Use this file to discover all available pages before exploring further.