const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
memories: [
{
content: 'John prefers dark mode',
isStatic: false,
metadata: {},
forgetAfter: '2026-06-01T00:00:00Z',
forgetReason: 'temporary project deadline',
temporalContext: {documentDate: '<string>', eventDate: ['<string>']}
}
],
containerTag: 'user_123'
})
};
fetch('https://api.supermemory.ai/v4/memories', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));