Skip to main content
Retrieve all folders belonging to the authenticated user. You can filter by parent folder or get only root-level folders.

Endpoint

GET /api/user/folders

Authentication

Requires authentication via API token in the Authorization header.

Query Parameters

noincl
boolean
default:"false"
When true, excludes files from the response. Only folder metadata and counts will be returned.
user
string
User ID to filter folders by. Only works for admin users when querying other users’ folders.
parentId
string
Filter folders by parent folder ID. Returns only folders that are children of the specified parent.
root
boolean
default:"false"
When true, returns only root-level folders (folders without a parent).

Response

Returns an array of folder objects ordered by creation date (newest first).
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. Only included when noincl is not set.
_count
object
Counts of related entities
parent
object | null
Parent folder information, or null if this is a root folder

Example Request

cURL
curl -X GET "https://your-zipline-instance.com/api/user/folders" \
  -H "Authorization: your-api-token"
Get root folders only
curl -X GET "https://your-zipline-instance.com/api/user/folders?root=true" \
  -H "Authorization: your-api-token"
Get folders without files
curl -X GET "https://your-zipline-instance.com/api/user/folders?noincl=true" \
  -H "Authorization: your-api-token"
Get children of a specific folder
curl -X GET "https://your-zipline-instance.com/api/user/folders?parentId=abc123" \
  -H "Authorization: your-api-token"

Example Response

200 OK
[
  {
    "id": "clx1234567890",
    "name": "Screenshots",
    "public": false,
    "allowUploads": false,
    "createdAt": "2024-03-01T10:30:00.000Z",
    "updatedAt": "2024-03-01T10:30:00.000Z",
    "userId": "user123",
    "parentId": null,
    "files": [
      {
        "id": "file123",
        "name": "abc123.png",
        "originalName": "screenshot.png",
        "type": "image/png",
        "size": 1048576,
        "views": 42,
        "maxViews": null,
        "favorite": false,
        "password": false
      }
    ],
    "_count": {
      "children": 2,
      "files": 1
    },
    "parent": null
  },
  {
    "id": "clx0987654321",
    "name": "Documents",
    "public": true,
    "allowUploads": true,
    "createdAt": "2024-02-28T15:20:00.000Z",
    "updatedAt": "2024-02-28T15:20:00.000Z",
    "userId": "user123",
    "parentId": null,
    "files": [],
    "_count": {
      "children": 0,
      "files": 0
    },
    "parent": null
  }
]
401 Unauthorized
{
  "error": "Unauthorized",
  "message": "Invalid authorization token",
  "statusCode": 401
}

Build docs developers (and LLMs) love