Skip to main content
POST
/
v1
/
upload-text
Upload Document
curl --request POST \
  --url https://api.personal.ai/v1/upload-text \
  --header 'Content-Type: <content-type>' \
  --header 'x-api-key: <x-api-key>' \
  --data '
{
  "Text": "<string>",
  "Title": "<string>",
  "DomainName": "<string>",
  "Starttime": "<string>",
  "EndTime": "<string>",
  "Tags": "<string>",
  "is_stack": true
}
'
{
  "message": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://docs.personal.ai/llms.txt

Use this file to discover all available pages before exploring further.

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.

Authorization

x-api-key
string
required
Your Personal AI API key

Headers

Content-Type
string
required
Must be set to application/json

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
required
The hyphenated text below the AI’s name when clicked into a Persona.DomainName
Example Request
"DomainName": "product-demo-jebzrhw"
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": "product-demo-jebzrhw",
    "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": "product-demo-jebzrhw",
    "Tags": "documents,blog,draft",
    "is_stack": true
}'

Error Codes

CodeDescription
403Forbidden - Check that API key is invalid
400Invalid Request - Missing required fields or invalid format