# Media folders API reference

Base URL `https://api.beplan.io/v1`. Every operation is listed with its scope, permission, inputs, answers, errors and an example. Conventions: https://beplan.io/docs/api.md. OpenAPI document: https://beplan.io/docs/api/openapi.json.

## List folders

`GET /organizations/{organizationId}/workspaces/{workspaceId}/media-library/folders` · operationId `media.folders.list`

- Scope: `media:read`
- Role permission: Any of: Upload media (`media:create`), Edit media (`media:update`), Delete media (`media:delete`), Review media (`media:review`)
- Effect (`read`): Changes nothing.
- Stability: Beta (May still change before it is marked stable.) Since 2026-11-19.

Lists the direct subfolders of `parentId` (omitted: the root), by name, with how many media and subfolders each holds and up to three cover images (signed URLs, about an hour). With `search`, every folder below `parentId` whose name contains the text.

**Parameters**

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `organizationId` | path | string | yes | 1–128 characters |
| `workspaceId` | path | string (uuid) | yes |  |
| `parentId` | query | string (uuid) | no |  |
| `search` | query | string | no | at most 200 characters |

**200 OK**

- `data` (array of object, required)
  - `id` (string, required)
  - `parentId` (string, required, nullable)
  - `name` (string, required)
  - `color` (string, required): one of `gray`, `red`, `orange`, `yellow`, `green`, `blue`, `purple`, `pink`.
  - `icon` (string, required, nullable)
  - `mediaCount` (number, required)
  - `subfolderCount` (number, required)
  - `covers` (array of object, required): at most 3 items; default [].
    - `id` (string, required)
    - `previewUrl` (string, required)

**Errors**

| Status | Code | Message |
|---|---|---|
| 400 | `VALIDATION_FAILED` | Some of the information sent is invalid. |
| 403 | `MISSING_PERMISSION` | You don't have permission to do this. |
| 404 | `ORGANIZATION_NOT_FOUND` | This organization doesn't exist or you're not a member of it. |
| 404 | `WORKSPACE_NOT_FOUND` | This workspace doesn't exist or you don't have access to it. |

Also, like every operation: `APP_SUSPENDED` (401), `TOKEN_EXPIRED` (401), `TOKEN_REVOKED` (401), `UNAUTHENTICATED` (401), `INSUFFICIENT_SCOPE` (403), `INTEGRATION_BLOCKED_BY_ORGANIZATION` (403), `INTEGRATION_PENDING_APPROVAL` (403), `RATE_LIMITED` (429), `INTERNAL_ERROR` (500).

**Example: Folders at the root**

```bash
curl -X GET "https://api.beplan.io/v1/organizations/ORGANIZATION_ID/workspaces/WORKSPACE_ID/media-library/folders" \
  -H "Authorization: Bearer beplan_pat_…"
```

Answers 200:

```json
{
  "data": [
    {
      "id": "6d1c2b7a-1f2e-4b8c-9a3d-5e6f7a8b9c0d",
      "parentId": null,
      "name": "Launch",
      "color": "blue",
      "icon": null,
      "mediaCount": 4,
      "subfolderCount": 0,
      "covers": []
    }
  ]
}
```


## Create a folder

`POST /organizations/{organizationId}/workspaces/{workspaceId}/media-library/folders` · operationId `media.folders.create`

- Scope: `media:write`
- Role permission: Upload media (`media:create`)
- Effect (`write`): Changes data in Beplan.
- Idempotency: Send an `Idempotency-Key` to retry safely: the same key with the same body within 24 hours returns the stored response.
- Stability: Beta (May still change before it is marked stable.) Since 2026-11-19.

Creates a folder in `parentId` (`null`: the root) with a `name`, a `color` (`gray`, `red`, `orange`, `yellow`, `green`, `blue`, `purple`, `pink`) and an optional emoji `icon`. Answers `201` with the folder.

**Parameters**

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `organizationId` | path | string | yes | 1–128 characters |
| `workspaceId` | path | string (uuid) | yes |  |

**Request body** (JSON, required)

- `name` (string, required): 1–255 characters.
- `parentId` (string (uuid), required, nullable)
- `color` (string, required): one of `gray`, `red`, `orange`, `yellow`, `green`, `blue`, `purple`, `pink`.
- `icon` (string, optional, nullable): at most 16 characters.

**201 Created**

- `data` (object, required, MediaFolder)
  - `id` (string, required)
  - `parentId` (string, required, nullable)
  - `name` (string, required)
  - `color` (string, required): one of `gray`, `red`, `orange`, `yellow`, `green`, `blue`, `purple`, `pink`.
  - `icon` (string, required, nullable)
  - `mediaCount` (number, required)
  - `subfolderCount` (number, required)

**Errors**

| Status | Code | Message |
|---|---|---|
| 400 | `VALIDATION_FAILED` | Some of the information sent is invalid. |
| 403 | `MISSING_PERMISSION` | You don't have permission to do this. |
| 404 | `FOLDER_NOT_FOUND` | This folder doesn't exist in this workspace. |
| 404 | `ORGANIZATION_NOT_FOUND` | This organization doesn't exist or you're not a member of it. |
| 404 | `WORKSPACE_NOT_FOUND` | This workspace doesn't exist or you don't have access to it. |

Also, like every operation: `APP_SUSPENDED` (401), `TOKEN_EXPIRED` (401), `TOKEN_REVOKED` (401), `UNAUTHENTICATED` (401), `INSUFFICIENT_SCOPE` (403), `INTEGRATION_BLOCKED_BY_ORGANIZATION` (403), `INTEGRATION_PENDING_APPROVAL` (403), `CONFLICT` (409), `IDEMPOTENCY_KEY_REUSED` (409), `PAYLOAD_TOO_LARGE` (413), `UNSUPPORTED_MEDIA_TYPE` (415), `RATE_LIMITED` (429), `INTERNAL_ERROR` (500).

**Example: A folder at the root**

```bash
curl -X POST "https://api.beplan.io/v1/organizations/ORGANIZATION_ID/workspaces/WORKSPACE_ID/media-library/folders" \
  -H "Authorization: Bearer beplan_pat_…" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Launch",
  "parentId": null,
  "color": "blue"
}'
```

Answers 201:

```json
{
  "data": {
    "id": "6d1c2b7a-1f2e-4b8c-9a3d-5e6f7a8b9c0d",
    "parentId": null,
    "name": "Launch",
    "color": "blue",
    "icon": null,
    "mediaCount": 0,
    "subfolderCount": 0
  }
}
```


## Get a folder

`GET /organizations/{organizationId}/workspaces/{workspaceId}/media-library/folders/{folderId}` · operationId `media.folders.get`

- Scope: `media:read`
- Role permission: Any of: Upload media (`media:create`), Edit media (`media:update`), Delete media (`media:delete`), Review media (`media:review`)
- Effect (`read`): Changes nothing.
- Stability: Beta (May still change before it is marked stable.) Since 2026-11-19.

Returns a folder with its counts and its `breadcrumb`: the folders above it, root first.

**Parameters**

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `organizationId` | path | string | yes | 1–128 characters |
| `workspaceId` | path | string (uuid) | yes |  |
| `folderId` | path | string (uuid) | yes |  |

**200 OK**

- `data` (object, required)
  - `id` (string, required)
  - `parentId` (string, required, nullable)
  - `name` (string, required)
  - `color` (string, required): one of `gray`, `red`, `orange`, `yellow`, `green`, `blue`, `purple`, `pink`.
  - `icon` (string, required, nullable)
  - `mediaCount` (number, required)
  - `subfolderCount` (number, required)
  - `breadcrumb` (array of object, required)
    - `id` (string, required)
    - `name` (string, required)

**Errors**

| Status | Code | Message |
|---|---|---|
| 403 | `MISSING_PERMISSION` | You don't have permission to do this. |
| 404 | `FOLDER_NOT_FOUND` | This folder doesn't exist in this workspace. |
| 404 | `ORGANIZATION_NOT_FOUND` | This organization doesn't exist or you're not a member of it. |
| 404 | `WORKSPACE_NOT_FOUND` | This workspace doesn't exist or you don't have access to it. |

Also, like every operation: `VALIDATION_FAILED` (400), `APP_SUSPENDED` (401), `TOKEN_EXPIRED` (401), `TOKEN_REVOKED` (401), `UNAUTHENTICATED` (401), `INSUFFICIENT_SCOPE` (403), `INTEGRATION_BLOCKED_BY_ORGANIZATION` (403), `INTEGRATION_PENDING_APPROVAL` (403), `RATE_LIMITED` (429), `INTERNAL_ERROR` (500).

**Example: A folder at the root**

```bash
curl -X GET "https://api.beplan.io/v1/organizations/ORGANIZATION_ID/workspaces/WORKSPACE_ID/media-library/folders/6d1c2b7a-1f2e-4b8c-9a3d-5e6f7a8b9c0d" \
  -H "Authorization: Bearer beplan_pat_…"
```

Answers 200:

```json
{
  "data": {
    "id": "6d1c2b7a-1f2e-4b8c-9a3d-5e6f7a8b9c0d",
    "parentId": null,
    "name": "Launch",
    "color": "blue",
    "icon": null,
    "mediaCount": 4,
    "subfolderCount": 0,
    "breadcrumb": []
  }
}
```


## Rename, recolor or move a folder

`PATCH /organizations/{organizationId}/workspaces/{workspaceId}/media-library/folders/{folderId}` · operationId `media.folders.update`

- Scope: `media:write`
- Role permission: Edit media (`media:update`)
- Effect (`write`): Changes data in Beplan.
- Stability: Beta (May still change before it is marked stable.) Since 2026-11-19.

Changes a folder's `name`, `color` or `icon`, or moves it under `parentId` (`null`: the root; not into itself or one of its subfolders). Fields left out are kept. Returns the folder.

**Parameters**

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `organizationId` | path | string | yes | 1–128 characters |
| `workspaceId` | path | string (uuid) | yes |  |
| `folderId` | path | string (uuid) | yes |  |

**Request body** (JSON, required)

- `name` (string, optional): 1–255 characters.
- `parentId` (string (uuid), optional, nullable)
- `color` (string, optional): one of `gray`, `red`, `orange`, `yellow`, `green`, `blue`, `purple`, `pink`.
- `icon` (string, optional, nullable): at most 16 characters.

**200 OK**

- `data` (object, required, MediaFolder)
  - `id` (string, required)
  - `parentId` (string, required, nullable)
  - `name` (string, required)
  - `color` (string, required): one of `gray`, `red`, `orange`, `yellow`, `green`, `blue`, `purple`, `pink`.
  - `icon` (string, required, nullable)
  - `mediaCount` (number, required)
  - `subfolderCount` (number, required)

**Errors**

| Status | Code | Message |
|---|---|---|
| 400 | `VALIDATION_FAILED` | Some of the information sent is invalid. |
| 403 | `MISSING_PERMISSION` | You don't have permission to do this. |
| 404 | `FOLDER_NOT_FOUND` | This folder doesn't exist in this workspace. |
| 404 | `ORGANIZATION_NOT_FOUND` | This organization doesn't exist or you're not a member of it. |
| 404 | `WORKSPACE_NOT_FOUND` | This workspace doesn't exist or you don't have access to it. |

Also, like every operation: `APP_SUSPENDED` (401), `TOKEN_EXPIRED` (401), `TOKEN_REVOKED` (401), `UNAUTHENTICATED` (401), `INSUFFICIENT_SCOPE` (403), `INTEGRATION_BLOCKED_BY_ORGANIZATION` (403), `INTEGRATION_PENDING_APPROVAL` (403), `PAYLOAD_TOO_LARGE` (413), `UNSUPPORTED_MEDIA_TYPE` (415), `RATE_LIMITED` (429), `INTERNAL_ERROR` (500).

**Example: Rename a folder**

```bash
curl -X PATCH "https://api.beplan.io/v1/organizations/ORGANIZATION_ID/workspaces/WORKSPACE_ID/media-library/folders/6d1c2b7a-1f2e-4b8c-9a3d-5e6f7a8b9c0d" \
  -H "Authorization: Bearer beplan_pat_…" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Launch week"
}'
```

Answers 200:

```json
{
  "data": {
    "id": "6d1c2b7a-1f2e-4b8c-9a3d-5e6f7a8b9c0d",
    "parentId": null,
    "name": "Launch week",
    "color": "blue",
    "icon": null,
    "mediaCount": 4,
    "subfolderCount": 0
  }
}
```


## Delete an empty folder

`DELETE /organizations/{organizationId}/workspaces/{workspaceId}/media-library/folders/{folderId}` · operationId `media.folders.delete`

- Scope: `media:write`
- Role permission: Edit media (`media:update`)
- Effect (`destructive`): Deletes data or cannot be undone.
- Stability: Beta (May still change before it is marked stable.) Since 2026-11-19.

Deletes a folder that holds no media and no subfolder (`409 FOLDER_NOT_EMPTY` otherwise: move or delete what it holds first). Answers `204`.

**Parameters**

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `organizationId` | path | string | yes | 1–128 characters |
| `workspaceId` | path | string (uuid) | yes |  |
| `folderId` | path | string (uuid) | yes |  |

**204 No content**

No content.

**Errors**

| Status | Code | Message |
|---|---|---|
| 403 | `MISSING_PERMISSION` | You don't have permission to do this. |
| 404 | `FOLDER_NOT_FOUND` | This folder doesn't exist in this workspace. |
| 404 | `ORGANIZATION_NOT_FOUND` | This organization doesn't exist or you're not a member of it. |
| 404 | `WORKSPACE_NOT_FOUND` | This workspace doesn't exist or you don't have access to it. |
| 409 | `FOLDER_NOT_EMPTY` | This folder isn't empty. Move or delete what's inside first. |

Also, like every operation: `VALIDATION_FAILED` (400), `APP_SUSPENDED` (401), `TOKEN_EXPIRED` (401), `TOKEN_REVOKED` (401), `UNAUTHENTICATED` (401), `INSUFFICIENT_SCOPE` (403), `INTEGRATION_BLOCKED_BY_ORGANIZATION` (403), `INTEGRATION_PENDING_APPROVAL` (403), `RATE_LIMITED` (429), `INTERNAL_ERROR` (500).

**Example: Delete an empty folder**

```bash
curl -X DELETE "https://api.beplan.io/v1/organizations/ORGANIZATION_ID/workspaces/WORKSPACE_ID/media-library/folders/6d1c2b7a-1f2e-4b8c-9a3d-5e6f7a8b9c0d" \
  -H "Authorization: Bearer beplan_pat_…"
```

Answers 204 with no content.


---
HTML version: https://beplan.io/docs/api/media-folders/
