POST
/
v1
/
message
AI Message
curl --request POST \
  --url https://api.personal.ai/v1/message \
  --header 'Content-Type: <content-type>' \
  --header 'x-api-key: <x-api-key>' \
  --data '{
  "Text": "<string>",
  "Context": "<string>",
  "DomainName": "<string>",
  "UserName": "<string>",
  "SessionId": "<string>",
  "Events": "<string>",
  "SourceName": "<string>",
  "is_stack": true,
  "is_draft": true
}'
{
  "ai_message": "<string>",
  "ai_score": 123,
  "SessionId": "<string>"
}

Overview

API endpoint for interacting with your AI through messages. This endpoint allows you to have conversations with your AI and receive responses based on your AI’s training.

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
Message to send to your AI for a response
Example
"What is an SLM?"
Context
string
Message to add additional context to the AI for a response (Similar to Reply function)
Example
"Context": "Reply in one sentence."
DomainName
string
required
The hyphenated text below the AI’s name when clicked into a Persona.DomainName
Example
"DomainName": "product-demo-jebzrhw"
UserName
string
Name of the user sending the request
Example
"UserName": "Leila"
SessionId
string
Use the same sessionId to continue conversation on that session
Example
"SessionId": "d5e9f208-937c-4a9c-92bf-5fb90ce68ff6"
Events
string
Name of the document you want to refer to in your AI’s Upload Library. This functions in the same way as the colon function does in the Personal AI platform.
Example
"Event": "How to train your AI"
SourceName
string
Name of the source app of the inbound message, required if using with triggers
Example
"SourceName": "slack"
is_stack
boolean
Flag to also add the user message (Text) to memory. Defaults to false if nothing is entered.
Example
"is_stack": true
is_draft
boolean
Flag to create a copilot message for the AI. Defaults to false if nothing is entered.
Example
"is_draft": true
Example
{
    "Text": "What is an SLM?",
    "Context": "Reply in one sentence.",
    "DomainName": "product-demo-jebzrhw",
    "UserName": "Leila",
    "SessionId": "d5e9f208-937c-4a9c-92bf-5fb90ce68ff6",
    "Events": "How to train your AI",
    "SourceName": "slack",
    "is_draft": true,
    "is_stack": true,
    "Metadata": {
        "key": "value"
    }
}

Example Responses

ai_message
string
The AI’s response message
ai_score
number
Confidence score of the AI’s response
SessionId
string
Session identifier for the conversation
Example Success Response
{
    "ai_message": "SLMs or PLMS PLMs are artificial intelligence (AI) models capable of understanding and generating information within the domain of an individual user. ",
    "ai_score": 47.18898852308854,
    "ai_name": "AI Name",
    "ai_picture": "https://example.com/picture.jpg",
    "SessionId": "d5e9f208-937c-4a9c-92bf-5fb90ce68ff6",
    "source_app": "api"
}
Example Error Response
{
    "detail": "AI message api unauthorized."
}

Examlpe cURL

cURL
curl --location 'https://api.personal.ai/v1/message' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <your-api-key>' \
--data '{
    "Text": "What is an SLM?",
    "DomainName": "product-demo-jebzrhw",
    "UserName": "Leila",
    "SourceName": "slack",
    "is_draft": true,
    "SessionId": "d5e9f208-937c-4a9c-92bf-5fb90ce68ff6",
    "Events": "How to train your AI"
}'

Error Codes

CodeDescription
403Forbidden - Check that API key is invalid
503Threshold Failure - Generated AI message is below user threshold