> ## Documentation Index
> Fetch the complete documentation index at: https://docs.personal.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Document

> Retrieve a list or specific documents from a persona. Works in conjunction with the Update Document endpoint.

## 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

<ParamField header="x-api-key" type="string" required>
  Your Personal AI API key
</ParamField>

## Headers

<ParamField header="Content-Type" type="string" required>
  Must be set to application/json
</ParamField>

## Query Parameters

<ParamField query="size" type="integer" required>
  Your desired number of documents to be returned.
</ParamField>

## Body

<ParamField body="DomainName" type="string" required>
  The hyphenated text below the AI's name when clicked into a Persona.

  <img alt="DomainName" classname="block dark:hidden" src="https://mintcdn.com/personalai/kGsTZefXJjPC-_P1/images/domainname.png?fit=max&auto=format&n=kGsTZefXJjPC-_P1&q=85&s=36b7c320c44dba9f962cdb342de41f3a" width="1140" height="416" data-path="images/domainname.png" />

  ```json Example Request theme={null}
  "DomainName": "product-demo-jebzrhw"
  ```
</ParamField>

<ParamField body="Text" type="string" optional>
  Document name to retrieve a specific document. Leave blank if you want to retrieve mulitple documents.

  ```json Example Request theme={null}
  "Text": "Python Reflection"
  ```
</ParamField>

## Example Request

<ResponseField name="array" type="array">
  Array of conversation messages, including both user messages and AI responses
</ResponseField>

```json Example Request theme={null}
{
  "Text": "Python Reflection",
  "DomainName": "product-demo-jebzrhw"
}
```

## Example Response

```json Example Success Response theme={null}
[
    {
        "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

```bash cURL theme={null}
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": "product-demo-jebzrhw"
}''
```

## Error Codes

| Code | Description                               |
| ---- | ----------------------------------------- |
| 403  | Forbidden - Check that API key is invalid |
