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

# List Documents

> This endpoint gets a list of documents for a given index.

### Auth Headers

<ParamField required header="x-metal-api-key" type="string">
  An API key for your org.
</ParamField>

<ParamField required header="x-metal-client-id" type="string">
  A Client ID for your org.
</ParamField>

### Params

<ParamField required path="indexId" type="string">
  The Index ID
</ParamField>

### Query Params

<ParamField optional query="limit" type="number">
  The number of documents to fetch. Defaults to 10.
</ParamField>

<ParamField optional query="page" type="number">
  The page number to fetch. Defaults to 1.
</ParamField>

### Response

<ResponseField name="data" type="Document Array">
  <Expandable title="properties">
    <ResponseField name="id" type="string">
      Id of the document
    </ResponseField>

    <ResponseField name="imageUrl" type="string">
      If set, Image URL for the document
    </ResponseField>

    <ResponseField name="text" type="string">
      If set, Text for the document
    </ResponseField>

    <ResponseField name="createdAt" type="string">
      The created at date of the document
    </ResponseField>

    <ResponseField name="metadata" type="object">
      The metadata of the document
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="lastSeenObjectId" type="String">
  The last object id seen in the result set. This can be used for deep pagination.
</ResponseField>

<RequestExample>
  ```bash Example Request theme={null}
  curl --location --request GET 'https://api.getmetal.io/v1/indexes/{indexId}/documents' \
  --header 'Content-Type: application/json' \
  --header 'x-metal-api-key: <api-key>' \
  --header 'x-metal-client-id: <client-id>' \
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "data": [
      {
        "id": "1",
        "text": "My text 1",
        "createdAt": "2023-07-03T14:27:02.413Z",
        "metadata": {}
      },
      {
        "id": "2",
        "text": "My text 2",
        "createdAt": "2023-07-03T14:27:02.418Z",
        "metadata": {}
      }
    ],
    "lastSeenObjectId": "64d529f3bd43b75ce5e020f9"
  }
  ```
</ResponseExample>
