Folders

Folders organize assets hierarchically within a project without changing asset IDs or CDN URLs. Folders and assets are always addressed by ID; names are display values, unique among siblings.

Guide: Organising assets.

Endpoints

EndpointDescription
GET /projects/:projectId/foldersList all asset folders in a project
POST /projects/:projectId/foldersCreate an asset folder with an optional parent folder ID
GET /folders/:folderIdGet an asset folder by ID
PATCH /folders/:folderIdRename an asset folder
DELETE /folders/:folderIdDelete an empty asset folder by ID
POST /folders/:folderId/moveMove a folder under another folder, or to the project root
POST /assets/:assetId/moveMove an asset into a folder, or to the project root

The folder object

FieldTypePresenceDescription
idstringRequiredUnique folder ID
projectIdstringRequiredID of the project that owns the folder
parentIdstringOptional, nullableID of the parent folder; null for folders at the project root
namestringRequiredDisplay name, unique among folders with the same parent. 1 to 100 characters, without slashes.
createdAtintegerRequiredWhen the folder was created, in milliseconds since the Unix epoch
updatedAtintegerOptionalWhen the folder was last updated, in milliseconds since the Unix epoch

Endpoint details

List Folders

List all asset folders in a project

OpenAPI YAML
GET
https://api.calmlens.com/v1/projects/
/folders
import { CalmLensClient } from "@calmlens/sdk";

const client = new CalmLensClient({
  apiKey: "your-api-key",
  projectId: "your-project-id"
});

const response = await client.folders.list();

Response

Error Codes

401auth/missing-token
Authentication required. Send your project API key in the X-Api-Key header.
401auth/invalid-api-key
The API key is invalid, revoked or expired. Create a key under Developer → API Keys.
403auth/project-mismatch
This API key belongs to a different project. Use a key created for the project that owns this resource.
404project/not-found
Project not found

Create Folder

Create an asset folder with an optional parent folder ID

OpenAPI YAML
POST
https://api.calmlens.com/v1/projects/
/folders
import { CalmLensClient } from "@calmlens/sdk";

const client = new CalmLensClient({
  apiKey: "your-api-key",
  projectId: "your-project-id"
});

const response = await client.folders.create({});

Request Body

Edit any value to update the generated request examples.

stringRequired
string (optional)Optional

Response

Error Codes

401auth/missing-token
Authentication required. Send your project API key in the X-Api-Key header.
401auth/invalid-api-key
The API key is invalid, revoked or expired. Create a key under Developer → API Keys.
403auth/project-mismatch
This API key belongs to a different project. Use a key created for the project that owns this resource.
404project/not-found
Project not found
404folder/not-found
Folder not found
409folder/duplicate-name
A folder with this name already exists in this location.

Get Folder

Get an asset folder by ID

OpenAPI YAML
GET
https://api.calmlens.com/v1/folders/
import { CalmLensClient } from "@calmlens/sdk";

const client = new CalmLensClient({
  apiKey: "your-api-key",
  projectId: "your-project-id"
});

const response = await client.folders.retrieve({});

Response

Error Codes

401auth/missing-token
Authentication required. Send your project API key in the X-Api-Key header.
401auth/invalid-api-key
The API key is invalid, revoked or expired. Create a key under Developer → API Keys.
403auth/project-mismatch
This API key belongs to a different project. Use a key created for the project that owns this resource.
404project/not-found
Project not found
404folder/not-found
Folder not found

Update Folder

Rename an asset folder

OpenAPI YAML
PATCH
https://api.calmlens.com/v1/folders/
import { CalmLensClient } from "@calmlens/sdk";

const client = new CalmLensClient({
  apiKey: "your-api-key",
  projectId: "your-project-id"
});

const response = await client.folders.update({});

Request Body

Edit any value to update the generated request examples.

string (optional)Optional

Response

Error Codes

401auth/missing-token
Authentication required. Send your project API key in the X-Api-Key header.
401auth/invalid-api-key
The API key is invalid, revoked or expired. Create a key under Developer → API Keys.
403auth/project-mismatch
This API key belongs to a different project. Use a key created for the project that owns this resource.
404project/not-found
Project not found
404folder/not-found
Folder not found
409folder/duplicate-name
A folder with this name already exists in this location.

Delete Folder

Delete an empty asset folder by ID

OpenAPI YAML
DELETE
https://api.calmlens.com/v1/folders/
import { CalmLensClient } from "@calmlens/sdk";

const client = new CalmLensClient({
  apiKey: "your-api-key",
  projectId: "your-project-id"
});

const response = await client.folders.delete({});

Error Codes

401auth/missing-token
Authentication required. Send your project API key in the X-Api-Key header.
401auth/invalid-api-key
The API key is invalid, revoked or expired. Create a key under Developer → API Keys.
403auth/project-mismatch
This API key belongs to a different project. Use a key created for the project that owns this resource.
404project/not-found
Project not found
404folder/not-found
Folder not found
409folder/not-empty
Folder must be empty before it can be deleted.

Move Folder

Move a folder under another folder, or to the project root

OpenAPI YAML
POST
https://api.calmlens.com/v1/folders/
/move
import { CalmLensClient } from "@calmlens/sdk";

const client = new CalmLensClient({
  apiKey: "your-api-key",
  projectId: "your-project-id"
});

const response = await client.folders.move({});

Request Body

Edit any value to update the generated request examples.

string (optional)Required

Response

Error Codes

401auth/missing-token
Authentication required. Send your project API key in the X-Api-Key header.
401auth/invalid-api-key
The API key is invalid, revoked or expired. Create a key under Developer → API Keys.
403auth/project-mismatch
This API key belongs to a different project. Use a key created for the project that owns this resource.
404folder/not-found
Folder not found
409folder/duplicate-name
A folder with this name already exists in this location.
409folder/parent-cycle
A folder cannot be moved inside itself or one of its descendants.

Move Asset

Move an asset into a folder, or to the project root

OpenAPI YAML
POST
https://api.calmlens.com/v1/assets/
/move
import { CalmLensClient } from "@calmlens/sdk";

const client = new CalmLensClient({
  apiKey: "your-api-key",
  projectId: "your-project-id"
});

const response = await client.assets.move({});

Request Body

Edit any value to update the generated request examples.

string (optional)Required

Response

Error Codes

401auth/missing-token
Authentication required. Send your project API key in the X-Api-Key header.
401auth/invalid-api-key
The API key is invalid, revoked or expired. Create a key under Developer → API Keys.
403auth/project-mismatch
This API key belongs to a different project. Use a key created for the project that owns this resource.
404asset/not-found
Asset not found
500asset/update-failed
Failed to update asset
423asset/safety-held
Asset access is restricted by a safety hold.
404folder/not-found
Folder not found

Signing in

Signing out

Cookies on CalmLens

We use essential cookies to keep you signed in and the site secure. With your permission, we'll also use functional cookies to remember preferences such as your layout and documentation language, and to offer Google One Tap sign-in. We don't use analytics or advertising cookies. Manage cookies