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.
Path Parameters
Parent folder. Pass MY_SPACE for your workspace root, or any folder’s item_id to list its contents.
Query Parameters
Items per page, 1–50. Defaults to 50 when omitted.
Token returned by the previous call. Omit on the first request.
curl -X GET 'https://app.memorylake.ai/openapi/memorylake/api/v1/drives/items/MY_SPACE/children?page_size=50' \
-H 'Authorization: Bearer sk_xxxxxx'
Response
Show Paginated library items
Array of library items Item type: file or directory
File size in bytes (files only)
Extended attributes (string → string map)
Token for the next page. Absent or null when this is the last page.
{
"success" : true ,
"data" : {
"items" : [
{
"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" : {}
},
{
"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"
}
}
Iterating every page
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