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
}
'import requests
url = "https://api.personal.ai/v1/upload-text"
payload = {
"Text": "<string>",
"Title": "<string>",
"DomainName": "<string>",
"Starttime": "<string>",
"EndTime": "<string>",
"Tags": "<string>",
"is_stack": True
}
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': '<content-type>'},
body: JSON.stringify({
Text: '<string>',
Title: '<string>',
DomainName: '<string>',
Starttime: '<string>',
EndTime: '<string>',
Tags: '<string>',
is_stack: true
})
};
fetch('https://api.personal.ai/v1/upload-text', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.personal.ai/v1/upload-text",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'Text' => '<string>',
'Title' => '<string>',
'DomainName' => '<string>',
'Starttime' => '<string>',
'EndTime' => '<string>',
'Tags' => '<string>',
'is_stack' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: <content-type>",
"x-api-key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.personal.ai/v1/upload-text"
payload := strings.NewReader("{\n \"Text\": \"<string>\",\n \"Title\": \"<string>\",\n \"DomainName\": \"<string>\",\n \"Starttime\": \"<string>\",\n \"EndTime\": \"<string>\",\n \"Tags\": \"<string>\",\n \"is_stack\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-api-key>")
req.Header.Add("Content-Type", "<content-type>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.personal.ai/v1/upload-text")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "<content-type>")
.body("{\n \"Text\": \"<string>\",\n \"Title\": \"<string>\",\n \"DomainName\": \"<string>\",\n \"Starttime\": \"<string>\",\n \"EndTime\": \"<string>\",\n \"Tags\": \"<string>\",\n \"is_stack\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.personal.ai/v1/upload-text")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"Text\": \"<string>\",\n \"Title\": \"<string>\",\n \"DomainName\": \"<string>\",\n \"Starttime\": \"<string>\",\n \"EndTime\": \"<string>\",\n \"Tags\": \"<string>\",\n \"is_stack\": true\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>"
}Personal AI APIs
Upload Document
Upload a text document to your memory
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
}
'import requests
url = "https://api.personal.ai/v1/upload-text"
payload = {
"Text": "<string>",
"Title": "<string>",
"DomainName": "<string>",
"Starttime": "<string>",
"EndTime": "<string>",
"Tags": "<string>",
"is_stack": True
}
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': '<content-type>'},
body: JSON.stringify({
Text: '<string>',
Title: '<string>',
DomainName: '<string>',
Starttime: '<string>',
EndTime: '<string>',
Tags: '<string>',
is_stack: true
})
};
fetch('https://api.personal.ai/v1/upload-text', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.personal.ai/v1/upload-text",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'Text' => '<string>',
'Title' => '<string>',
'DomainName' => '<string>',
'Starttime' => '<string>',
'EndTime' => '<string>',
'Tags' => '<string>',
'is_stack' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: <content-type>",
"x-api-key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.personal.ai/v1/upload-text"
payload := strings.NewReader("{\n \"Text\": \"<string>\",\n \"Title\": \"<string>\",\n \"DomainName\": \"<string>\",\n \"Starttime\": \"<string>\",\n \"EndTime\": \"<string>\",\n \"Tags\": \"<string>\",\n \"is_stack\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-api-key>")
req.Header.Add("Content-Type", "<content-type>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.personal.ai/v1/upload-text")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "<content-type>")
.body("{\n \"Text\": \"<string>\",\n \"Title\": \"<string>\",\n \"DomainName\": \"<string>\",\n \"Starttime\": \"<string>\",\n \"EndTime\": \"<string>\",\n \"Tags\": \"<string>\",\n \"is_stack\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.personal.ai/v1/upload-text")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"Text\": \"<string>\",\n \"Title\": \"<string>\",\n \"DomainName\": \"<string>\",\n \"Starttime\": \"<string>\",\n \"EndTime\": \"<string>\",\n \"Tags\": \"<string>\",\n \"is_stack\": true\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>"
}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
Your Personal AI API key
Headers
Must be set to application/json
Body
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 of the uploaded document
Example Request
"Title": "New Document"
The hyphenated text below the AI’s name when clicked into a Persona.

Example Request
"DomainName": "product-demo-jebzrhw"
ISO timestamp string indicating start time (UTC)
Example Request
"Starttime": "2024-10-09T10:00:00.000Z"
ISO timestamp string indicating end time (UTC)
Example Request
"Endtime": "2024-10-10T10:00:00.000Z"
Comma delimited list of tags for context and reference
Example Request
"Tags": "documents,blog,draft"
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
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
| Code | Description |
|---|---|
| 403 | Forbidden - Check that API key is invalid |
| 400 | Invalid Request - Missing required fields or invalid format |
⌘I