Batch add documents
client.documents.batchAdd(DocumentBatchAddParams { documents, containerTag, containerTags, 6 more } body, RequestOptionsoptions?): DocumentBatchAddResponse { failed, results, success }
POST/v3/documents/batch
Add multiple documents in a single request. Each document can have any content type (text, url, file, etc.) and metadata
Batch add documents
import Supermemory from 'supermemory';
const client = new Supermemory({
apiKey: process.env['SUPERMEMORY_API_KEY'], // This is the default and can be omitted
});
const response = await client.documents.batchAdd({
documents: [
{
content:
'Our API rate limits are 100 req/min on free and 1000 on pro. Clients should use exponential backoff on 429s.',
},
],
});
console.log(response.failed);{
"failed": 0,
"results": [
{
"id": "id",
"status": "status",
"details": "details",
"error": "error"
}
],
"success": 0
}Returns Examples
{
"failed": 0,
"results": [
{
"id": "id",
"status": "status",
"details": "details",
"error": "error"
}
],
"success": 0
}