TypeScript SDK
import Supermemory from "supermemory";
const client = new Supermemory({
apiKey: process.env.SUPERMEMORY_API_KEY,
});
// Prefer client.add with a conversation transcript for most apps.
// Use /v4/conversations when you have structured turns:
const res = await fetch("https://api.supermemory.ai/v4/conversations", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SUPERMEMORY_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
messages: [
{ role: "user", content: "Sarah is being promoted to VP of Product." },
],
containerTag: "user_123",
customId: "chat_offsite_2026",
}),
});import requests
url = "https://api.supermemory.ai/v4/conversations"
payload = {
"conversationId": "<string>",
"messages": [
{
"content": "<string>",
"name": "<string>",
"tool_calls": ["<unknown>"],
"tool_call_id": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl -X POST "https://api.supermemory.ai/v4/conversations" \
-H "Authorization: Bearer $SUPERMEMORY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{ "role": "user", "content": "Just got back from Tokyo." },
{ "role": "assistant", "content": "Glad it went well!" },
{ "role": "user", "content": "Sarah is being promoted to VP of Product." }
],
"containerTag": "user_123",
"customId": "chat_offsite_2026"
}'Ingest or update conversation
Ingest or update a conversation
POST
/
v4
/
conversations
TypeScript SDK
import Supermemory from "supermemory";
const client = new Supermemory({
apiKey: process.env.SUPERMEMORY_API_KEY,
});
// Prefer client.add with a conversation transcript for most apps.
// Use /v4/conversations when you have structured turns:
const res = await fetch("https://api.supermemory.ai/v4/conversations", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SUPERMEMORY_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
messages: [
{ role: "user", content: "Sarah is being promoted to VP of Product." },
],
containerTag: "user_123",
customId: "chat_offsite_2026",
}),
});import requests
url = "https://api.supermemory.ai/v4/conversations"
payload = {
"conversationId": "<string>",
"messages": [
{
"content": "<string>",
"name": "<string>",
"tool_calls": ["<unknown>"],
"tool_call_id": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl -X POST "https://api.supermemory.ai/v4/conversations" \
-H "Authorization: Bearer $SUPERMEMORY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{ "role": "user", "content": "Just got back from Tokyo." },
{ "role": "assistant", "content": "Glad it went well!" },
{ "role": "user", "content": "Sarah is being promoted to VP of Product." }
],
"containerTag": "user_123",
"customId": "chat_offsite_2026"
}'Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Response
Conversation ingested/updated successfully
Was this page helpful?
⌘I