POST
/
v1
/
upload-text

Overview

API endpoint for uploading text documents to your memory. This allows you to add longer form content directly to your AI’s knowledge base.

Headers

Content-Type
string
required

Must be set to application/json

x-api-key
string
required

Your Personal AI API key

Body

Text
string
required

Body of text to upload to the memory. This should be as clean as possible.

Example Request
"Text": "This is a long document that is consumed into the document view!"
Title
string

Title of the uploaded document

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

Domain name of AI Persona to upload to

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

ISO timestamp string indicating start time (UTC)

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

ISO timestamp string indicating end time (UTC)

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

Comma delimited list of tags for context and reference

Example Request
"Tags": "documents,blog,draft"
is_stack
boolean

Boolean to specify whether to add the document to memory. Defaults to true.

Example Request
"is_stack": true
Example
{
    "Text": "This is a long document that is consumed into the document view.",
    "Title": "Personal AI",
    "DomainName": "ai",
    "Tags": "#doc1",
    "is_stack": false,
    "StartTime": "2023-07-09T10:00:00.000Z",
    "EndTime": "2023-07-09T10:00:00.000Z"
}

Exmaple Responses

message
string

Success or error message

Example Success Response
{
    "message": "doc accepted and processing"
}
Example Error Response
{
    "detail": "AI document upload unauthorized."
}

Example cURL

cURL
curl --location 'https://api.personal.ai/v1/upload-text' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <your-api-key>' \
--data '{
    "Text": "This is a long document that is consumed into the document view.",
    "Title": "New Document",
    "DomainName": "paidevelopers-comapany",
    "Tags": "documents,blog,draft",
    "is_stack": true
}'

Error Codes

CodeDescription
503Authorization Failure - API key is invalid
400Invalid Request - Missing required fields or invalid format