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’sETag.
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.Permission required:
drive:item_add · serviceWorkflow note (file mode): Calling this in item_type: "file" mode is step 2 of the Library upload flow; step 1 is Create Upload (same permission). If you then need the file to appear inside a project, call Import Documents — that additionally requires project:doc_add.Request Body
- Create folder
- Create file
string
required
Must be
"folder".string
required
Parent folder —
MY_SPACE or any folder’s item_id.string
required
Folder name, e.g.
Q2 Reports.string
default:"rename"
Behavior if the name already exists in
parent_item_id:rename(default) — append a numeric suffix (Q2 Reports_1).deny— fail with409 DRIVE_ITEM_CONFLICT.
object
Extended attributes — a
string → string map for caller-defined metadata.Response
The response shape is the same for folders and files.object