Skip to main content
POST /openapi/memorylake/api/v1/drives/items
One endpoint, two modes — the item_type field selects which:
  • Folder (item_type: "folder") — creates an empty folder in the Library.
  • File (item_type: "file") — registers a file whose bytes are already in storage from a completed chunked upload. You must have called Create Upload first and collected every chunk’s ETag.
Pick the tab below that matches the item type you’re creating. Required fields differ by mode.
parent_item_id accepts the alias MY_SPACE (your workspace root). Pass it directly instead of looking up the root ID. You can also pass any folder’s item_id to nest deeper.

Request Body

item_type
string
required
Must be "folder".
parent_item_id
string
required
Parent folder — MY_SPACE or any folder’s item_id.
name
string
required
Folder name, e.g. Q2 Reports.
name_conflict_strategy
string
default:"rename"
Behavior if the name already exists in parent_item_id:
  • rename (default) — append a numeric suffix (Q2 Reports_1).
  • deny — fail with 409 DRIVE_ITEM_CONFLICT.
x_attrs
object
Extended attributes — a string → string map for caller-defined metadata.
curl -X POST 'https://app.memorylake.ai/openapi/memorylake/api/v1/drives/items' \
  -H 'Authorization: Bearer sk_xxxxxx' \
  -H 'Content-Type: application/json' \
  -d '{
    "item_type": "folder",
    "parent_item_id": "MY_SPACE",
    "name": "Q2 Reports"
  }'

Response

The response shape is the same for folders and files.
data
object
{
  "success": true,
  "data": {
    "item_id": "sc-5c6bf0f82d624a20a6fa4696997bdd46:7d8cf1e93f634b31b5",
    "name": "report.pdf"
  }
}
Always read name from the response. With the default rename strategy, the server may have appended a suffix — the returned name is what you should display and store.