POST
/
v1
/
document
curl --request POST \
  --url https://api.personal.ai/v1/document \
  --header 'Content-Type: <content-type>' \
  --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.

Authorization

x-api-key
string
required

Your Personal AI API key

Headers

Content-Type
string
required

Must be set to application/json

Query Parameters

size
integer
required

Your desired number of documents to be returned.

Body

DomainName
string
required

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
403Forbidden - Check that API key is invalid