POST
/
v1
/
upload-file

Overview

API endpoint for uploading files (PDF, DOCX, etc.) to your Personal AI memory.

Headers

Content-Type
string
required

Must be set to multipart/form-data

x-api-key
string
required

Your Personal AI API key

File

file
File
required

The file to be uploaded

message_request
JSON
required

A JSON-encoded string containing additional request parameters

Example message_request
{
  "DomainName": "ai",
  "Title": "Uploaded Files", 
  "Tags": "document,file",
  "is_stack": true
}

Body

Title
string

Title of the uploaded document

Example Request
"Title": "My Document"
DomainName
string

Domain name of AI Persona to upload to (e.g., “paidevelopers-python” from paidevelopers-python.personal.ai)

Example Request
"DomainName": "paidevelopers-python"
StartTime
string

ISO timestamp string indicating start time (UTC). Defaults to current time.

Example Request
"StartTime": "2024-10-09T10:00:00.000Z"
EndTime
string

ISO timestamp string indicating end time (UTC). Defaults to current time.

Example Request
"EndTime": "2024-10-10T10:00:00.000Z"
Tags
string

Comma delimited list of tags for context and reference

Example Request
"Tags": "documents,developers,coding"
is_stack
boolean

Boolean to specify whether to add the document to memory. If false, upload shows up as draft in Documents. Defaults to true.

Example Request
"is_stack": true

Example Responses

message
string

Success or error message

Example Success Response
{
  "message": "file accepted and processing"
}
Example Error Response
{
  "detail": "AI memory api unauthorized."
}

Example cURL

cURL
curl --location 'https://api.personal.ai/v1/upload-file' \
--header 'x-api-key: <your-api-key>' \
--form 'file=@"/path/to/file.pdf"' \
--form 'message_request="{\"DomainName\": \"paidevelopers-python\", \"Title\": \"My Document\"}"'