POST
/
v1
/
conversation

Overview

API endpoint for retrieving conversation history from a channel or session. This endpoint allows you to access previous interactions with your AI.

Headers

Content-Type
string
required

Must be set to application/json

x-api-key
string
required

Your Personal AI API key

Body

DomainName
string

The domain part of the AI profile url

Example Request
"DomainName": "labs"
SessionId
string

Session identifier to retrieve specific conversation history

Example Request
"SessionId": "dd3ec564-5948-4da0-8ab6-94b23f92705b"

Example Request

array
array

Array of conversation messages, including both user messages and AI responses

Example Request
{
  "SessionId": "dd3ec564-5948-4da0-8ab6-94b23f92705b",
  "DomainName": "labs"
}

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": "labs"
}'

Error Codes

CodeDescription
503Authorization Failure - API key is invalid
404Not Found - Conversation or session not found
Example Error Response
{
    "detail": "AI conversation api unauthorized."
}