Skip to content

Create a folder

createFolder

POST /api/v1/shares/{share_id}/folders

Scope: files.writeRate cost: 2

Create a folder

The folder it goes in must exist; the new name follows the name rules (one name, no ”/”, no spaces at either end). Something already called that is never replaced: on_conflict “fail” answers 409, “rename” picks the first free name, so read the answer’s path. Send an Idempotency-Key: sending the same request again with the same key answers the first answer again and creates nothing more.

Terminal window
curl -X POST "$FOLDR/api/v1/shares/$SHARE_ID/folders" \
-H "Authorization: Bearer $TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"path":"string"}'

$FOLDR is your site’s address (for example https://files.example.com) and $TOKEN is an access token. See Getting access.

NameInTypeRequiredDescription
share_idpathstringYesThe share’s id.
Idempotency-KeyheaderstringYesA value of your own, 1 to 255 visible ASCII characters (a UUID, say), new for each new request. The same key with the same request within 24 hours answers the first answer again (with Idempotent-Replayed: true) and changes nothing; with a different request it is refused (422). Your app’s keys are its own, for each person.

application/json, required: CreateFolderBody

FieldTypeDescription
pathstringRequired. The new folder’s full path in the share, its name last: “/Reports/2027”. The folder it goes in must exist. The leading ”/” is optional.
on_conflictstring, one of fail, renameWhat to do when something is already called that: “fail” (the default) answers 409 conflict; “rename” creates it under the first free name in Foldr’s style (“2027 copy”). Nothing is ever replaced.

Example:

{
"path": "string"
}
StatusMeaningBody
201The folder, at its canonical path.application/json: Item
HeaderDescription
ETagThe entity tag of what was answered. Send it back as If-None-Match for a 304 while it is unchanged, or as If-Match to change it only while it is unchanged.
LocationWhere to read what was made.

Item:

FieldTypeDescription
share_idstring (uuid)Required. The id of the share the item is in.
pathstringRequired. The canonical path: as the storage holds it (its case), Unicode NFC, always starting with ”/”. ”/” is the top of the share. Send this form back in later calls.
namestringRequired. The item’s name (the last segment of its path; the share’s name for the top).
kindstring, one of file, folderRequired. file or folder.
sizeinteger or nullRequired. Size in bytes; null for a folder, and null when the item has no fixed byte size (a native Google document, exported on download: see export).
modifiedstring or null (date-time)Required. Last modified (RFC 3339, UTC), where the storage reports it.
mime_typestring or nullRequired. The item’s own media type, as the storage reports it or guessed from the name; null for a folder. A native Google document has Google’s own type here (application/vnd.google-apps.document for a Doc); export says what it downloads as.
exportExport or nullRequired. For a native Google document that can be downloaded, what content delivers: its media type and the extension the download is named with. Null for everything else, including a native Google type that cannot be downloaded (a Form: content answers 409 not-downloadable).
etagstring or nullRequired. The item’s entity tag: the storage’s own where it has one, else a weak tag over size and modified time (over modified time alone for a native Google document, whose export is made afresh each time). Null on a search hit, which comes from the index; GET …/item for the live one.
read_onlybooleanRequired. True when the person cannot change things in this share.
checked_outCheckout or nullRequired. Who has the item checked out, or null. Null on a search hit.

Example:

{
"share_id": "0191f2c4-8a1e-7b52-9d3a-5c1e0b7a4d21",
"path": "string",
"name": "string",
"kind": "file",
"size": 1,
"modified": "2026-11-04T09:30:00Z",
"mime_type": "string",
"export": {
"mime_type": "string",
"extension": "string"
},
"etag": "string",
"read_only": false,
"checked_out": {
"by": {},
"since": "2026-11-04T09:30:00Z"
}
}

Every error is an application/problem+json document (ProblemDetails); branch on its type or code. See Errors.

StatusProblem typesWhen
400invalid-path
invalid-request
One of: Invalid path (invalid-path); Invalid request (invalid-request).
401invalid-tokenInvalid token (invalid-token).
403insufficient-scope
write-not-allowed
One of: Insufficient scope (insufficient-scope); Not allowed for this app (write-not-allowed).
404not-foundNot found (not-found).
409ambiguous-path
conflict
not-a-folder
storage-account-not-connected
One of: Ambiguous path (ambiguous-path); Conflict (conflict); Not a folder (not-a-folder); Storage account not connected (storage-account-not-connected).
413too-largeToo large (too-large).
422idempotency-key-reusedIdempotency key reused (idempotency-key-reused).
429daily-write-limit
rate-limited
One of: Daily write limit reached (daily-write-limit); Too many requests (rate-limited).
500internal-errorInternal error (internal-error).
503share-unavailable
share-unreachable
write-failed
One of: Share unavailable (share-unavailable); Share unreachable (share-unreachable); Write failed (write-failed).