Skip to main content
POST
/
v3
/
documents
/
batch
Batch add documents
const url = 'https://api.supermemory.ai/v3/documents/batch';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"documents":[{"containerTag":"user_123","containerTags":["user_123","project_123"],"content":"This is a detailed article about machine learning concepts...","customId":"mem_abc123","metadata":{"category":"technology","isPublic":true,"readingTime":5,"source":"web","tag_1":"ai","tag_2":"machine-learning"}}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
[
  {
    "id": "<string>",
    "status": "<string>"
  }
]

Authorizations

Authorization
string
header
required

Body

application/json
documents
required
Required array length: 1 - 100 elements
containerTag
string
Example:
containerTags
string[]
deprecated
Example:
metadata
object
Example:
content
null

Response

id
string
required
status
string
required