AI Conversation
curl --request POST \
--url https://api.personal.ai/v1/conversation \
--header 'Content-Type: <content-type>' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"DomainName": "<string>",
"SessionId": "<string>"
}
'import requests
url = "https://api.personal.ai/v1/conversation"
payload = {
"DomainName": "<string>",
"SessionId": "<string>"
}
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({DomainName: '<string>', SessionId: '<string>'})
};
fetch('https://api.personal.ai/v1/conversation', 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/conversation",
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([
'DomainName' => '<string>',
'SessionId' => '<string>'
]),
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/conversation"
payload := strings.NewReader("{\n \"DomainName\": \"<string>\",\n \"SessionId\": \"<string>\"\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/conversation")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "<content-type>")
.body("{\n \"DomainName\": \"<string>\",\n \"SessionId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.personal.ai/v1/conversation")
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 \"DomainName\": \"<string>\",\n \"SessionId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"array": [
{}
]
}Personal AI APIs
AI Conversation
Retrieve conversation history from a channel
POST
/
v1
/
conversation
AI Conversation
curl --request POST \
--url https://api.personal.ai/v1/conversation \
--header 'Content-Type: <content-type>' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"DomainName": "<string>",
"SessionId": "<string>"
}
'import requests
url = "https://api.personal.ai/v1/conversation"
payload = {
"DomainName": "<string>",
"SessionId": "<string>"
}
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({DomainName: '<string>', SessionId: '<string>'})
};
fetch('https://api.personal.ai/v1/conversation', 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/conversation",
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([
'DomainName' => '<string>',
'SessionId' => '<string>'
]),
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/conversation"
payload := strings.NewReader("{\n \"DomainName\": \"<string>\",\n \"SessionId\": \"<string>\"\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/conversation")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "<content-type>")
.body("{\n \"DomainName\": \"<string>\",\n \"SessionId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.personal.ai/v1/conversation")
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 \"DomainName\": \"<string>\",\n \"SessionId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"array": [
{}
]
}Overview
API endpoint for retrieving conversation history from a channel or session. This endpoint allows you to access previous interactions with your AI.Authorization
Your Personal AI API key
Headers
Must be set to application/json
Body
The hyphenated text below the AI’s name when clicked into a Persona.

Example Request
"DomainName": "product-demo-jebzrhw"
Session identifier to retrieve specific conversation history
Example Request
"SessionId": "dd3ec564-5948-4da0-8ab6-94b23f92705b"
Example Request
Array of conversation messages, including both user messages and AI responses
Example Request
{
"SessionId": "dd3ec564-5948-4da0-8ab6-94b23f92705b",
"DomainName": "product-demo-jebzrhw"
}
Example Response
Example Success Response
[
{
"ai_message": "what is a personal AI",
"ai_score": 0.0,
"ai_name": "AI Name",
"ai_picture": null,
"raw_message": "what is a personal AI",
"timestamp": "2024-09-16T03:52:40.821Z",
"SessionId": "98bf4dd5-5ab0-4d28-a439-d2f2d18d5443",
"Metadata": {}
},
{
"ai_message": "A personal AI is a digital extension of your mind...",
"ai_score": 0.0,
"ai_name": "AI Name",
"ai_picture": null,
"raw_message": "A personal AI is a digital extension of your mind...",
"timestamp": "2024-09-16T03:52:40.822Z",
"SessionId": "98bf4dd5-5ab0-4d28-a439-d2f2d18d5443",
"Metadata": {}
}
]
Example cURL
cURL
curl --location 'https://api.personal.ai/v1/conversation' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <your-api-key>' \
--data '{
"SessionId": "dd3ec564-5948-4da0-8ab6-94b23f92705b",
"DomainName": "product-demo-jebzrhw"
}'
Error Codes
| Code | Description |
|---|---|
| 403 | Forbidden - Check that API key is invalid |
| 404 | Not Found - Conversation or session not found |
⌘I