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

# List Items

> List the files and folders directly under a folder in the Library

```
GET /openapi/memorylake/api/v1/drives/items/{item_id}/children
```

Returns the items (files and folders) directly under a folder. Uses cursor pagination: if `continuation_token` is returned, pass it back on the next request to fetch the next page. When the token is absent from the response, you've reached the end.

<Note>
  **Permission required:** [`drive:item_read`](/features/team-collaboration/permission-reference#read-your-files) · `service`
</Note>

### Path Parameters

<ParamField path="item_id" type="string" required>
  Parent folder. Pass `MY_SPACE` for your workspace root, or any folder's `item_id` to list its contents.
</ParamField>

### Query Parameters

<ParamField query="page_size" type="integer" default="50">
  Items per page, 1–50. Defaults to 50 when omitted.
</ParamField>

<ParamField query="continuation_token" type="string">
  Token returned by the previous call. Omit on the first request.
</ParamField>

<RequestExample>
  ```bash First page theme={null}
  curl -X GET 'https://app.memorylake.ai/openapi/memorylake/api/v1/drives/items/MY_SPACE/children?page_size=50' \
    -H 'Authorization: Bearer sk_xxxxxx'
  ```

  ```bash Next page theme={null}
  curl -X GET 'https://app.memorylake.ai/openapi/memorylake/api/v1/drives/items/MY_SPACE/children?page_size=50&continuation_token=Y6Wa982_Jj_A9-Kw40' \
    -H 'Authorization: Bearer sk_xxxxxx'
  ```
</RequestExample>

### Response

<ResponseField name="data" type="object">
  <Expandable title="Paginated library items">
    <ResponseField name="items" type="array">
      Array of library items

      <Expandable title="Library item">
        <ResponseField name="uri" type="string">Drive resource URI</ResponseField>
        <ResponseField name="item_id" type="string">Item ID</ResponseField>
        <ResponseField name="name" type="string">Item name</ResponseField>
        <ResponseField name="type" type="string">Item type: `file` or `directory`</ResponseField>
        <ResponseField name="size" type="integer">File size in bytes (files only)</ResponseField>
        <ResponseField name="etag" type="string">ETag for the item</ResponseField>
        <ResponseField name="parent_item_id" type="string">Parent item ID</ResponseField>
        <ResponseField name="created_at" type="string">Creation timestamp</ResponseField>
        <ResponseField name="updated_at" type="string">Last update timestamp</ResponseField>
        <ResponseField name="x_attrs" type="object">Extended attributes (string → string map)</ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="continuation_token" type="string">Token for the next page. Absent or `null` when this is the last page.</ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json Success (200) theme={null}
  {
    "success": true,
    "data": {
      "items": [
        {
          "uri": "drive://items/sc-5c6bf0f82d624a20a6fa4696997bdd46:7d8cf1e93f634b31b5",
          "item_id": "sc-5c6bf0f82d624a20a6fa4696997bdd46:7d8cf1e93f634b31b5",
          "name": "Reports",
          "type": "directory",
          "parent_item_id": "sc-5c6bf0f82d624a20a6fa4696997bdd46:root",
          "created_at": "2024-01-15T10:30:00Z",
          "updated_at": "2024-01-15T10:30:00Z",
          "x_attrs": {}
        },
        {
          "uri": "drive://items/sc-5c6bf0f82d624a20a6fa4696997bdd46:2a8cf1e93f634b31b7",
          "item_id": "sc-5c6bf0f82d624a20a6fa4696997bdd46:2a8cf1e93f634b31b7",
          "name": "report.pdf",
          "type": "file",
          "size": 10485760,
          "etag": "d41d8cd98f00b204e9800998ecf8427e",
          "parent_item_id": "sc-5c6bf0f82d624a20a6fa4696997bdd46:root",
          "created_at": "2024-01-15T10:30:00Z",
          "updated_at": "2024-01-15T10:30:00Z",
          "x_attrs": {}
        }
      ],
      "continuation_token": "Y6Wa982_Jj_A9-Kw40"
    }
  }
  ```
</ResponseExample>

### Iterating every page

```python theme={null}
import requests

BASE = "https://app.memorylake.ai/openapi/memorylake/api/v1"
HEADERS = {"Authorization": "Bearer sk_xxxxxx"}

def list_all(parent_id: str):
    token = None
    while True:
        params = {"page_size": 50}
        if token:
            params["continuation_token"] = token
        resp = requests.get(
            f"{BASE}/drives/items/{parent_id}/children",
            headers=HEADERS, params=params,
        ).json()["data"]
        yield from resp["items"]
        token = resp.get("continuation_token")
        if not token:
            break
```
