Skip to main content
POST
Save a conversation turn
Use this endpoint to save a conversation to EDN, one turn at a time. A turn is one message from the user and your assistant’s reply to it. Call it once after each reply. EDN saves the turn, and if the user said something worth remembering, such as “Sara manages the website project”, EDN remembers that fact for future conversations.

What EDN does

  1. Saves the exchange as a ROUND memory.
  2. Checks the user’s message for a new fact or a correction.
  3. Saves a USER_STATED memory when it finds one. If the message mixes a fact with a question, only the fact is saved.
  4. If the message corrects an earlier fact, replaces that fact. See Important behavior for when this happens.
  5. Creates the session if the session_id is new.
Each call counts toward your daily limit on saving memory.

Required headers

Request

Response

200 OK

Important behavior

  • fact: null means EDN saved the conversation turn, but did not create a separate factual memory from the user’s message. This is normal for questions, small talk, or messages that do not contain a fact worth remembering. Fact detection never fails the request: if it can’t complete, the turn is still saved and fact is null.
  • fact.replaces contains the ID of an earlier fact when EDN detects that the user corrected it. The new fact is used in future SIPs, while the earlier version remains available in the record history.
  • When a correction doesn’t replace anything. EDN replaces an earlier fact only when it’s clear the new statement is about the same thing, and only if the earlier fact came from the user (USER_STATED) or from an AI answer (AI_INFERRED). Facts from documents, and facts the user confirmed, are never replaced from chat; EDN keeps both. In these cases fact.replaces is null.
  • Store the transcript for better corrections. To recognise a correction, EDN compares the user’s message with the assistant’s previous reply stored in the session. If you also save messages with Add a message to a session, corrections are detected more reliably.
  • Send each conversation turn once. EDN does not currently deduplicate repeated ingest requests, so sending the same turn twice creates duplicate records.
  • Importing older conversations: set timestamp to the time the conversation originally happened so EDN stores the correct date.

Errors

See Error handling.

Authorizations

Authorization
string
header
required

Your EDN API key, sent as Bearer YOUR_API_KEY. Create keys in the Console.

Body

application/json
assistant_message
string
required

Your assistant's reply. Saved with the exchange; citation markers such as [1] are removed first.

Minimum string length: 1
Example:

"Thanks, I will remember that."

session_id
string
required

The conversation this turn belongs to. 1 to 128 characters: letters, digits, period, underscore, colon and hyphen. EDN creates the session if it's new.

Required string length: 1 - 128
Example:

"chat-42"

user_message
string
required

What the user said. EDN checks this message for new facts and corrections.

Minimum string length: 1
Example:

"Sara manages the website project."

project_id
string | null

Save the turn into this project instead of your general memory. Must be one of your projects.

timestamp
string | null

When the exchange happened, as ISO 8601. Defaults to now. Use it when importing past conversations.

Example:

"2026-11-10T04:43:25Z"

Response

Successful Response

fact
SavedFact · object | null
required

The fact EDN saved from the user's message, when the message stated something worth remembering or corrected an earlier fact. Null when nothing was saved.

record_id
string
required

The ID of the saved conversation turn (a ROUND memory).