Skip to main content
Update an existing folder’s properties such as name, visibility, upload permissions, or parent folder.

Endpoint

PATCH /api/user/folders/:id

Authentication

Requires authentication via API token in the Authorization header.

Path Parameters

id
string
required
The ID of the folder to update

Request Body

All fields are optional. Only include the fields you want to update.
name
string
New name for the folder (will be trimmed of whitespace)
isPublic
boolean
Set folder visibility. When true, the folder is publicly accessible.
allowUploads
boolean
Whether to allow uploads to this folder
parentId
string | null
ID of the new parent folder. Set to null to make it a root folder. Cannot move a folder to itself or its descendants.

Response

Returns the updated folder object.
id
string
required
Unique identifier for the folder
name
string
required
The folder name
public
boolean
required
Whether the folder is publicly accessible
allowUploads
boolean
required
Whether uploads are allowed to this folder
createdAt
string
required
ISO 8601 timestamp of when the folder was created
updatedAt
string
required
ISO 8601 timestamp of when the folder was last updated
userId
string
required
ID of the user who owns this folder
parentId
string | null
ID of the parent folder, or null if this is a root folder
files
array
Array of file objects in this folder
_count
object
Counts of related entities
parent
object | null
Parent folder information

Example Request

Rename folder
curl -X PATCH "https://your-zipline-instance.com/api/user/folders/clx123" \
  -H "Authorization: your-api-token" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "New Folder Name"
  }'
Make folder public
curl -X PATCH "https://your-zipline-instance.com/api/user/folders/clx123" \
  -H "Authorization: your-api-token" \
  -H "Content-Type: application/json" \
  -d '{
    "isPublic": true
  }'
Allow uploads
curl -X PATCH "https://your-zipline-instance.com/api/user/folders/clx123" \
  -H "Authorization: your-api-token" \
  -H "Content-Type: application/json" \
  -d '{
    "allowUploads": true
  }'
Move to different parent
curl -X PATCH "https://your-zipline-instance.com/api/user/folders/clx123" \
  -H "Authorization: your-api-token" \
  -H "Content-Type: application/json" \
  -d '{
    "parentId": "parent_folder_id"
  }'
Move to root level
curl -X PATCH "https://your-zipline-instance.com/api/user/folders/clx123" \
  -H "Authorization: your-api-token" \
  -H "Content-Type: application/json" \
  -d '{
    "parentId": null
  }'
Update multiple properties
curl -X PATCH "https://your-zipline-instance.com/api/user/folders/clx123" \
  -H "Authorization: your-api-token" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Public Gallery",
    "isPublic": true,
    "allowUploads": true
  }'

Example Response

200 OK
{
  "id": "clx1234567890",
  "name": "New Folder Name",
  "public": false,
  "allowUploads": true,
  "createdAt": "2024-03-01T10:30:00.000Z",
  "updatedAt": "2024-03-01T14:45:00.000Z",
  "userId": "user123",
  "parentId": "parent123",
  "files": [],
  "_count": {
    "children": 2,
    "files": 5
  },
  "parent": {
    "id": "parent123",
    "name": "Parent Folder",
    "parentId": null
  }
}
400 Bad Request - Circular reference
{
  "error": "Bad Request",
  "message": "A folder cannot be its own parent",
  "statusCode": 400
}
400 Bad Request - Moving to descendant
{
  "error": "Bad Request",
  "message": "Cannot move folder into one of its descendants",
  "statusCode": 400
}
403 Forbidden
{
  "error": "Forbidden",
  "message": "Parent folder does not belong to you",
  "statusCode": 403
}
404 Not Found
{
  "error": "Not Found",
  "message": "Folder not found",
  "statusCode": 404
}

Notes

  • You can only update folders you own (unless you’re an admin)
  • The API prevents circular references - you cannot move a folder into itself or its descendants
  • Setting parentId to null moves the folder to the root level
  • All property updates are atomic - either all succeed or none do

Build docs developers (and LLMs) love