Skip to main content
POST
Upload a document
Use this endpoint to give EDN a document to answer from, such as a policy, a plan or meeting notes. EDN reads the file, splits it into sections, and saves each section as a DOCUMENT_VERIFIED memory that SIPs can use and cite.

What EDN does

  1. Reads the text from the file: PDF, DOCX, Markdown or plain text, up to 10 MB.
  2. Splits the text into sections and saves each as a DOCUMENT_VERIFIED memory.
  3. With project_id, adds the file to the project as a source.

Required headers

Request

Response

200 OK

Important behavior

  • Each file counts once toward your daily limit on saving memory. It isn’t counted if no text could be saved.
  • Chat never overwrites a document. If a user later says something different, EDN keeps both.
  • To remove a project document, and everything EDN saved from it, use Remove a project document with the source_id.

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

multipart/form-data
file
file
required

The file to upload: PDF, Markdown, DOCX or TXT, up to 10 MB.

session_id
string
required

The session to file the upload under.

Required string length: 1 - 128
domain
string
default:technical

The category to save the records under: technical (default), professional-context, communication-style or factual.

project_id
string | null

Add the file to this project as a source, instead of general memory.

Response

Successful Response

chunks_stored
integer
required

How many DOCUMENT_VERIFIED memory records EDN made from the file.

domain
enum<string>
required

The category the records were saved under.

Available options:
technical,
professional-context,
communication-style,
factual
file_type
enum<string>
required

The file's extension.

Available options:
.pdf,
.md,
.docx,
.txt
filename
string
required

The uploaded file's name.

session_id
string
required

The session you sent.

source_id
string | null

The project source created for the file when you sent project_id, otherwise null. Remove it with DELETE /api/v1/projects/{project_id}/sources/{source_id}.