POST
/
v1
/
document
curl --request POST \
  --url https://api.personal.ai/v1/document \
  --header 'Content-Type: <content-type>' \
  --header 'size: <size>' \
  --header 'x-api-key: <x-api-key>' \
  --data '{
  "DomainName": "<string>",
  "Text": "<string>"
}'
{
  "array": [
    {}
  ]
}

Overview

API endpoint for retrieving a specific document or list of documents from a persona. This endpoint allows you to access any document by name or pulling a series of documents using the query parameters for response size.

Headers

Content-Type
string
required

Must be set to application/json

x-api-key
string
required

Your Personal AI API key

Query Parameters

size
integer
required

Your desired number of documents to be returned.

Body

DomainName
string

The domain part of the AI profile url

Example Request
"DomainName": "paidevelopers-python"
Text
string

Document name to retrieve a specific document. Leave blank if you want to retrieve mulitple documents.

Example Request
"Text": "Python Reflection"

Example Request

array
array

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

Example Request
{
  "Text": "Python Reflection",
  "DomainName": "paidevelopers-python"
}

Example Response

Example Success Response
[
    {
        "id": "66c6706fe6fffd040957a7a3",
        "title": " Python Reflection",
        "text": "**Title: Reflecting on Python: My Journey Through a Language Revolution** When I first encountered Python, it was like meeting an old friend who instantly felt familiar and welcoming. I remember divin",
        "type": "Document",
        "timestamp": "2025-03-17T17:24:44.874+00:00"
    }
]

Example cURL

cURL
curl --location 'https://api.personal.ai/v1/document?size=5' \
--header 'x-api-key: <your-api-key>' \
--header 'Content-Type: application/json' \
--data '{
    "Text": "Python Reflection",
    "DomainName": "paidevelopers-python"
}''

Error Codes

CodeDescription
503Authorization Failure - API key is invalid
Example Error Response
{
    "detail": "AI conversation api unauthorized."
}