curl -X POST "https://api.memanto.ai/agents/my-agent/files" \
-H "x-api-key: $MEMANTO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"file_name": "handbook.pdf",
"size_bytes": 482133
}'
{
"agent_id": "my-agent",
"file_id": "file_…",
"job_id": "job_…",
"file_name": "handbook.pdf",
"content_type": "application/pdf",
"status": "queued",
"tags": [],
"upload_url": "https://storage.googleapis.com/…",
"storage_key": "…",
"method": "PUT",
"expires_in_seconds": 900,
"hint": "Upload with PUT <upload_url>, header Content-Type: application/pdf, body = file bytes. Then poll GET .../file-jobs/job_…."
}
Files
Upload File
Start a file upload; Memanto turns the file into memories.
POST
/
agents
/
{agent_id}
/
files
curl -X POST "https://api.memanto.ai/agents/my-agent/files" \
-H "x-api-key: $MEMANTO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"file_name": "handbook.pdf",
"size_bytes": 482133
}'
{
"agent_id": "my-agent",
"file_id": "file_…",
"job_id": "job_…",
"file_name": "handbook.pdf",
"content_type": "application/pdf",
"status": "queued",
"tags": [],
"upload_url": "https://storage.googleapis.com/…",
"storage_key": "…",
"method": "PUT",
"expires_in_seconds": 900,
"hint": "Upload with PUT <upload_url>, header Content-Type: application/pdf, body = file bytes. Then poll GET .../file-jobs/job_…."
}
Overview
Uploading takes three steps:- Call this endpoint with the file’s name. It returns a signed
upload_url(valid for 15 minutes) and ajob_id. PUTthe file’s bytes toupload_urlwith the returnedcontent_typeas theContent-Typeheader. No API key on this request.- Poll Get File Job until
statusiscomplete(orfailed).
.pdf, .docx, .xlsx, .json, .txt, .csv and .md.
Authentication
Your Memanto Cloud API key (
mk_...). See Authentication.Path Parameters
Body
Then upload the bytes:curl -X PUT "$UPLOAD_URL" -H "Content-Type: application/pdf" --data-binary @handbook.pdf
curl -X POST "https://api.memanto.ai/agents/my-agent/files" \
-H "x-api-key: $MEMANTO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"file_name": "handbook.pdf",
"size_bytes": 482133
}'
{
"agent_id": "my-agent",
"file_id": "file_…",
"job_id": "job_…",
"file_name": "handbook.pdf",
"content_type": "application/pdf",
"status": "queued",
"tags": [],
"upload_url": "https://storage.googleapis.com/…",
"storage_key": "…",
"method": "PUT",
"expires_in_seconds": 900,
"hint": "Upload with PUT <upload_url>, header Content-Type: application/pdf, body = file bytes. Then poll GET .../file-jobs/job_…."
}