# Media 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.

## Clean up old media

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

- Scope: `media:write`
- Role permission: Delete media (`media:delete`)
- Effect (`destructive`): Deletes data or cannot be undone.
- 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.

Deletes the media `media.clean.preview` counts for the same `olderThanMonths` and `excludedFolderIds`, and frees their storage; this cannot be undone (the published posts keep their history). Returns what was deleted. Preview first. Needs a plan with media clean-up (`402 PLAN_UPGRADE_REQUIRED`).

**Parameters**

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

**Request body** (JSON, required)

- `olderThanMonths` (integer, required): from 1 to 24.
- `excludedFolderIds` (array of string (uuid), required): at most 200 items.

**200 OK**

- `data` (object, required)
  - `mediaCount` (number, required)
  - `totalBytes` (number, required)

**Errors**

| Status | Code | Message |
|---|---|---|
| 400 | `VALIDATION_FAILED` | Some of the information sent is invalid. |
| 402 | `PLAN_UPGRADE_REQUIRED` | Your current plan doesn't include this feature. |
| 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), `CONFLICT` (409), `IDEMPOTENCY_KEY_REUSED` (409), `PAYLOAD_TOO_LARGE` (413), `UNSUPPORTED_MEDIA_TYPE` (415), `RATE_LIMITED` (429), `INTERNAL_ERROR` (500).

**Example: Media older than a year, everywhere**

```bash
curl -X POST "https://api.beplan.io/v1/organizations/ORGANIZATION_ID/workspaces/WORKSPACE_ID/media-library/clean" \
  -H "Authorization: Bearer beplan_pat_…" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "olderThanMonths": 12,
  "excludedFolderIds": []
}'
```

Answers 200:

```json
{
  "data": {
    "mediaCount": 0,
    "totalBytes": 0
  }
}
```


## Preview a clean-up

`GET /organizations/{organizationId}/workspaces/{workspaceId}/media-library/clean/preview` · operationId `media.clean.preview`

- Scope: `media:read`
- Role permission: Delete media (`media:delete`)
- Effect (`read`): Changes nothing.
- Stability: Beta (May still change before it is marked stable.) Since 2026-11-19.

Counts the media a clean-up would delete, and their size in bytes: media only used in posts published (or failed) more than `olderThanMonths` months ago (1–24), never versioned, outside `excludedFolderId` (repeat it; subfolders are excluded too). Nothing is deleted. Needs a plan with media clean-up (`402 PLAN_UPGRADE_REQUIRED`).

**Parameters**

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `organizationId` | path | string | yes | 1–128 characters |
| `workspaceId` | path | string (uuid) | yes |  |
| `olderThanMonths` | query | integer | yes | from 1 to 24 |
| `excludedFolderId` | query | one of | no |  |

**200 OK**

- `data` (object, required)
  - `mediaCount` (number, required)
  - `totalBytes` (number, required)

**Errors**

| Status | Code | Message |
|---|---|---|
| 400 | `VALIDATION_FAILED` | Some of the information sent is invalid. |
| 402 | `PLAN_UPGRADE_REQUIRED` | Your current plan doesn't include this feature. |
| 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: Media older than 6 months**

```bash
curl -X GET "https://api.beplan.io/v1/organizations/ORGANIZATION_ID/workspaces/WORKSPACE_ID/media-library/clean/preview?olderThanMonths=6" \
  -H "Authorization: Bearer beplan_pat_…"
```

Answers 200:

```json
{
  "data": {
    "mediaCount": 0,
    "totalBytes": 0
  }
}
```


## List media

`GET /organizations/{organizationId}/workspaces/{workspaceId}/media-library/items` · operationId `media.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 workspace's media library, newest first: images, videos and GIFs that finished uploading (media still in review or raw footage are listed by their own operations). Filter with `folderId` (a folder; with `search`, that folder and its subfolders), `search` (name or alt text contains; with transcripts on, also what is said in videos, and such items carry `transcriptMatch`), `type`, `usage` and `formatId` (repeat it; `none` for media without a format). Paginated with `limit` (1–100, default 25) and the opaque `cursor` of the previous page. URLs are signed and last about an hour: fetch them again rather than storing them. `playback` is always `null` through the API (video playback is for the Beplan app); use `mediaUrl` or the download URL to get the file.

**Parameters**

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `organizationId` | path | string | yes | 1–128 characters |
| `workspaceId` | path | string (uuid) | yes |  |
| `limit` | query | integer | no | from 1 to 100 |
| `cursor` | query | string | no | at most 512 characters |
| `folderId` | query | string (uuid) | no |  |
| `search` | query | string | no | at most 200 characters |
| `type` | query | string (all, image, video, picture, audio, visual) | no |  |
| `usage` | query | string (all, unused, used) | no |  |
| `formatId` | query | one of | no |  |
| `origin` | query | string (library, clipEditor) | no |  |

**200 OK**

- `data` (array of object, required)
  - `id` (string, required)
  - `folderId` (string, required, nullable): The folder holding the media; `null` at the root of the library.
  - `filename` (string, required)
  - `altText` (string, required, nullable)
  - `mediaType` (string, required): one of `image`, `video`, `gif`, `audio` (may gain values).
  - `mimeType` (string, required, nullable)
  - `size` (number, required, nullable): File size in bytes, when known.
  - `width` (number, required, nullable): Width in pixels, when known (images at upload, videos once processed); `null` for audio.
  - `height` (number, required, nullable): Height in pixels, when known (images at upload, videos once processed); `null` for audio.
  - `aspectRatio` (number, required): Display ratio (width / height) from the dimensions, clamped to [0.45, 2.4]; `1` when unknown and for audio.
  - `duration` (number, required, nullable): Length in seconds, for videos, GIFs and audio once known (`null` for images).
  - `waveform` (array of number, required, nullable): Audio only: up to 1000 peaks (integers 0–100, 100 = full scale) spread evenly over `duration`. `null` while processing, when processing failed, and for every other type.
  - `createdAt` (string (date-time), required)
  - `formats` (array of object, required)
    - `id` (string, required)
    - `name` (string, required)
    - `color` (string, required)
  - `usage` (string, required): Where the media is used: `unused`; `used` in a post still to publish; `published` only in posts already published (or failed). one of `unused`, `used`, `published`.
  - `processing` (object, required): Upload and processing state: `processing` (videos and audio are being processed), `ready`, or `failed` with a readable `error`. A media can be put in a post while processing.
    - `state` (string, required): one of `processing`, `ready`, `failed` (may gain values).
    - `error` (string, required, nullable)
  - `previewUrl` (string, required, nullable): Signed URL (valid about one hour) of the image itself or of the video's poster; `null` while there is none yet, and always for audio.
  - `mediaUrl` (string, required): Signed URL (valid about one hour) of the original file, served inline. To save the file under its name, use the media's `download-url`.
  - `playback` (object, required, nullable): HLS playback of a processed video (`manifestUrl`, loaded by the Beplan app's player with its session), else `null`. Always `null` through the public API (`/v1`) and MCP: use `mediaUrl`, or the media's `download-url`, to fetch the file.
    - `manifestUrl` (string, required)
  - `publishCopy` (object, required, nullable): The copy sent to platforms that cannot take the original (a JPEG for images, an H.264/AAC MP4 of at most 1080p for videos): its type, pixels and bytes. `null` when every platform takes the original, or while it is being made.
    - `mimeType` (string, required)
    - `width` (number, required)
    - `height` (number, required)
    - `size` (number, required)
  - `transcriptMatch` (object, optional, MediaTranscriptMatch)
    - `snippet` (string, required)
    - `startMs` (number, required)
    - `source` (string, optional): one of `speech`, `scene`.
- `page` (object, required)
  - `nextCursor` (string, required, nullable)
  - `hasMore` (boolean, 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: The first page of images**

```bash
curl -X GET "https://api.beplan.io/v1/organizations/ORGANIZATION_ID/workspaces/WORKSPACE_ID/media-library/items?type=image&limit=25" \
  -H "Authorization: Bearer beplan_pat_…"
```

Answers 200:

```json
{
  "data": [
    {
      "id": "0b6f5a52-7f4e-4c55-9d6f-2f0a6a1c3e11",
      "folderId": null,
      "filename": "launch-teaser.jpg",
      "altText": "Our new studio at sunrise",
      "mediaType": "image",
      "mimeType": "image/jpeg",
      "size": 482133,
      "width": 1080,
      "height": 1350,
      "aspectRatio": 0.8,
      "duration": null,
      "waveform": null,
      "createdAt": "2026-11-18T09:30:00.000Z",
      "formats": [],
      "usage": "unused",
      "processing": {
        "state": "ready",
        "error": null
      },
      "previewUrl": "https://storage.beplan.io/org-media/…/preview?X-Amz-Signature=…",
      "mediaUrl": "https://storage.beplan.io/org-media/…?X-Amz-Signature=…",
      "playback": null,
      "publishCopy": null
    }
  ],
  "page": {
    "nextCursor": null,
    "hasMore": false
  }
}
```


## Delete media

`POST /organizations/{organizationId}/workspaces/{workspaceId}/media-library/items/delete` · operationId `media.delete`

- Scope: `media:write`
- Role permission: Delete media (`media:delete`)
- Effect (`destructive`): Deletes data or cannot be undone.
- 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.

Deletes up to 500 library media. All or nothing. A media used in a post is hidden from the library but kept, so the post still publishes; the others are deleted with their files, which cannot be undone. Returns how many media were deleted. Media in review are removed with `media.review.remove`.

**Parameters**

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

**Request body** (JSON, required)

- `mediaIds` (array of string (uuid), required): 1–500 items.

**200 OK**

- `data` (object, required)
  - `count` (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 | `MEDIA_NOT_FOUND` | This media doesn't exist or was deleted. |
| 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: Delete one media**

```bash
curl -X POST "https://api.beplan.io/v1/organizations/ORGANIZATION_ID/workspaces/WORKSPACE_ID/media-library/items/delete" \
  -H "Authorization: Bearer beplan_pat_…" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "mediaIds": [
    "0b6f5a52-7f4e-4c55-9d6f-2f0a6a1c3e11"
  ]
}'
```

Answers 200:

```json
{
  "data": {
    "count": 1
  }
}
```


## Tag media with formats

`POST /organizations/{organizationId}/workspaces/{workspaceId}/media-library/items/formats` · operationId `media.formats.update`

- Scope: `media:write`
- Role permission: Edit media (`media:update`)
- 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.

Adds (`add`) and removes (`remove`) the workspace's formats (its content categories, e.g. "Tutorial") on up to 500 library media at once. All or nothing: an unknown media or format refuses the whole request. Returns how many media changed.

**Parameters**

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

**Request body** (JSON, required)

- `mediaIds` (array of string (uuid), required): 1–500 items.
- `add` (array of string (uuid), required): at most 50 items.
- `remove` (array of string (uuid), required): at most 50 items.

**200 OK**

- `data` (object, required)
  - `count` (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 | `FORMAT_NOT_FOUND` | One of the formats doesn't exist in this workspace. |
| 404 | `MEDIA_NOT_FOUND` | This media doesn't exist or was deleted. |
| 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: Remove nothing, add nothing (a no-op)**

```bash
curl -X POST "https://api.beplan.io/v1/organizations/ORGANIZATION_ID/workspaces/WORKSPACE_ID/media-library/items/formats" \
  -H "Authorization: Bearer beplan_pat_…" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "mediaIds": [
    "0b6f5a52-7f4e-4c55-9d6f-2f0a6a1c3e11"
  ],
  "add": [],
  "remove": []
}'
```

Answers 200:

```json
{
  "data": {
    "count": 1
  }
}
```


## Move media to a folder

`POST /organizations/{organizationId}/workspaces/{workspaceId}/media-library/items/move` · operationId `media.move`

- Scope: `media:write`
- Role permission: Edit media (`media:update`)
- 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.

Moves up to 500 library media into a folder (`folderId`, from `media.folders.list`), or to the root with `null`. All or nothing: one id that isn't a library media of the workspace refuses the whole request. Returns how many media moved.

**Parameters**

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

**Request body** (JSON, required)

- `mediaIds` (array of string (uuid), required): 1–500 items.
- `folderId` (string (uuid), required, nullable)

**200 OK**

- `data` (object, required)
  - `count` (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 | `MEDIA_NOT_FOUND` | This media doesn't exist or was deleted. |
| 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: Move two media into a folder**

```bash
curl -X POST "https://api.beplan.io/v1/organizations/ORGANIZATION_ID/workspaces/WORKSPACE_ID/media-library/items/move" \
  -H "Authorization: Bearer beplan_pat_…" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "mediaIds": [
    "0b6f5a52-7f4e-4c55-9d6f-2f0a6a1c3e11"
  ],
  "folderId": "6d1c2b7a-1f2e-4b8c-9a3d-5e6f7a8b9c0d"
}'
```

Answers 200:

```json
{
  "data": {
    "count": 1
  }
}
```


## Get a media

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

- Scope: `media:read`
- Role permission: Any member who can see it
- Effect (`read`): Changes nothing.
- Stability: Beta (May still change before it is marked stable.) Since 2026-11-19.

Returns one media of the workspace, whatever its review state (`reviewStatus`: `null` for a plain library media, else `pending_review`, `changes_requested`, `approved` or `raw_footage`). Use it to follow a video's processing after an upload (`processing.state`). URLs are signed and last about an hour: fetch them again rather than storing them. `playback` is always `null` through the API (video playback is for the Beplan app); use `mediaUrl` or the download URL to get the file.

**Parameters**

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

**200 OK**

- `data` (object, required, MediaDetail)
  - `id` (string, required)
  - `folderId` (string, required, nullable): The folder holding the media; `null` at the root of the library.
  - `filename` (string, required)
  - `altText` (string, required, nullable)
  - `mediaType` (string, required): one of `image`, `video`, `gif`, `audio` (may gain values).
  - `mimeType` (string, required, nullable)
  - `size` (number, required, nullable): File size in bytes, when known.
  - `width` (number, required, nullable): Width in pixels, when known (images at upload, videos once processed); `null` for audio.
  - `height` (number, required, nullable): Height in pixels, when known (images at upload, videos once processed); `null` for audio.
  - `aspectRatio` (number, required): Display ratio (width / height) from the dimensions, clamped to [0.45, 2.4]; `1` when unknown and for audio.
  - `duration` (number, required, nullable): Length in seconds, for videos, GIFs and audio once known (`null` for images).
  - `waveform` (array of number, required, nullable): Audio only: up to 1000 peaks (integers 0–100, 100 = full scale) spread evenly over `duration`. `null` while processing, when processing failed, and for every other type.
  - `createdAt` (string (date-time), required)
  - `formats` (array of object, required)
    - `id` (string, required)
    - `name` (string, required)
    - `color` (string, required)
  - `usage` (string, required): Where the media is used: `unused`; `used` in a post still to publish; `published` only in posts already published (or failed). one of `unused`, `used`, `published`.
  - `processing` (object, required): Upload and processing state: `processing` (videos and audio are being processed), `ready`, or `failed` with a readable `error`. A media can be put in a post while processing.
    - `state` (string, required): one of `processing`, `ready`, `failed` (may gain values).
    - `error` (string, required, nullable)
  - `previewUrl` (string, required, nullable): Signed URL (valid about one hour) of the image itself or of the video's poster; `null` while there is none yet, and always for audio.
  - `mediaUrl` (string, required): Signed URL (valid about one hour) of the original file, served inline. To save the file under its name, use the media's `download-url`.
  - `playback` (object, required, nullable): HLS playback of a processed video (`manifestUrl`, loaded by the Beplan app's player with its session), else `null`. Always `null` through the public API (`/v1`) and MCP: use `mediaUrl`, or the media's `download-url`, to fetch the file.
    - `manifestUrl` (string, required)
  - `publishCopy` (object, required, nullable): The copy sent to platforms that cannot take the original (a JPEG for images, an H.264/AAC MP4 of at most 1080p for videos): its type, pixels and bytes. `null` when every platform takes the original, or while it is being made.
    - `mimeType` (string, required)
    - `width` (number, required)
    - `height` (number, required)
    - `size` (number, required)
  - `transcriptMatch` (object, optional, MediaTranscriptMatch)
    - `snippet` (string, required)
    - `startMs` (number, required)
    - `source` (string, optional): one of `speech`, `scene`.
  - `reviewStatus` (string, required, nullable): one of `pending_review`, `changes_requested`, `approved`, `raw_footage` (may gain values).

**Errors**

| Status | Code | Message |
|---|---|---|
| 404 | `MEDIA_NOT_FOUND` | This media doesn't exist or was deleted. |
| 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 ready image**

```bash
curl -X GET "https://api.beplan.io/v1/organizations/ORGANIZATION_ID/workspaces/WORKSPACE_ID/media-library/items/0b6f5a52-7f4e-4c55-9d6f-2f0a6a1c3e11" \
  -H "Authorization: Bearer beplan_pat_…"
```

Answers 200:

```json
{
  "data": {
    "id": "0b6f5a52-7f4e-4c55-9d6f-2f0a6a1c3e11",
    "folderId": null,
    "filename": "launch-teaser.jpg",
    "altText": "Our new studio at sunrise",
    "mediaType": "image",
    "mimeType": "image/jpeg",
    "size": 482133,
    "width": 1080,
    "height": 1350,
    "aspectRatio": 0.8,
    "duration": null,
    "waveform": null,
    "createdAt": "2026-11-18T09:30:00.000Z",
    "formats": [],
    "usage": "unused",
    "processing": {
      "state": "ready",
      "error": null
    },
    "previewUrl": "https://storage.beplan.io/org-media/…/preview?X-Amz-Signature=…",
    "mediaUrl": "https://storage.beplan.io/org-media/…?X-Amz-Signature=…",
    "playback": null,
    "publishCopy": null,
    "reviewStatus": null
  }
}
```


## Rename a media or set its alt text

`PATCH /organizations/{organizationId}/workspaces/{workspaceId}/media-library/items/{mediaId}` · operationId `media.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 library media's `filename` and/or `altText` (`null` clears it; alt text is what screen readers say, and is sent to the platforms that take it). Fields left out are kept. Returns the media. When the organization requires approval for posts from integrations, changing `altText` of a media in posts that are scheduled or waiting for approval answers `422 MEDIA_IN_POSTS_UNDER_APPROVAL` (change it in Beplan).

**Parameters**

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

**Request body** (JSON, required)

- `filename` (string, optional): 1–255 characters.
- `altText` (string, optional, nullable): at most 1000 characters.

**200 OK**

- `data` (object, required, MediaItem)
  - `id` (string, required)
  - `folderId` (string, required, nullable): The folder holding the media; `null` at the root of the library.
  - `filename` (string, required)
  - `altText` (string, required, nullable)
  - `mediaType` (string, required): one of `image`, `video`, `gif`, `audio` (may gain values).
  - `mimeType` (string, required, nullable)
  - `size` (number, required, nullable): File size in bytes, when known.
  - `width` (number, required, nullable): Width in pixels, when known (images at upload, videos once processed); `null` for audio.
  - `height` (number, required, nullable): Height in pixels, when known (images at upload, videos once processed); `null` for audio.
  - `aspectRatio` (number, required): Display ratio (width / height) from the dimensions, clamped to [0.45, 2.4]; `1` when unknown and for audio.
  - `duration` (number, required, nullable): Length in seconds, for videos, GIFs and audio once known (`null` for images).
  - `waveform` (array of number, required, nullable): Audio only: up to 1000 peaks (integers 0–100, 100 = full scale) spread evenly over `duration`. `null` while processing, when processing failed, and for every other type.
  - `createdAt` (string (date-time), required)
  - `formats` (array of object, required)
    - `id` (string, required)
    - `name` (string, required)
    - `color` (string, required)
  - `usage` (string, required): Where the media is used: `unused`; `used` in a post still to publish; `published` only in posts already published (or failed). one of `unused`, `used`, `published`.
  - `processing` (object, required): Upload and processing state: `processing` (videos and audio are being processed), `ready`, or `failed` with a readable `error`. A media can be put in a post while processing.
    - `state` (string, required): one of `processing`, `ready`, `failed` (may gain values).
    - `error` (string, required, nullable)
  - `previewUrl` (string, required, nullable): Signed URL (valid about one hour) of the image itself or of the video's poster; `null` while there is none yet, and always for audio.
  - `mediaUrl` (string, required): Signed URL (valid about one hour) of the original file, served inline. To save the file under its name, use the media's `download-url`.
  - `playback` (object, required, nullable): HLS playback of a processed video (`manifestUrl`, loaded by the Beplan app's player with its session), else `null`. Always `null` through the public API (`/v1`) and MCP: use `mediaUrl`, or the media's `download-url`, to fetch the file.
    - `manifestUrl` (string, required)
  - `publishCopy` (object, required, nullable): The copy sent to platforms that cannot take the original (a JPEG for images, an H.264/AAC MP4 of at most 1080p for videos): its type, pixels and bytes. `null` when every platform takes the original, or while it is being made.
    - `mimeType` (string, required)
    - `width` (number, required)
    - `height` (number, required)
    - `size` (number, required)
  - `transcriptMatch` (object, optional, MediaTranscriptMatch)
    - `snippet` (string, required)
    - `startMs` (number, required)
    - `source` (string, optional): one of `speech`, `scene`.

**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 | `MEDIA_NOT_FOUND` | This media doesn't exist or was deleted. |
| 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. |
| 422 | `MEDIA_IN_POSTS_UNDER_APPROVAL` | This media is in posts that are scheduled or waiting for approval, and this organization requires approval for posts from integrations. Change it in Beplan, or take it out of those posts first. |

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: Set the alt text**

```bash
curl -X PATCH "https://api.beplan.io/v1/organizations/ORGANIZATION_ID/workspaces/WORKSPACE_ID/media-library/items/0b6f5a52-7f4e-4c55-9d6f-2f0a6a1c3e11" \
  -H "Authorization: Bearer beplan_pat_…" \
  -H "Content-Type: application/json" \
  -d '{
  "altText": "Our new studio at sunrise"
}'
```

Answers 200:

```json
{
  "data": {
    "id": "0b6f5a52-7f4e-4c55-9d6f-2f0a6a1c3e11",
    "folderId": null,
    "filename": "launch-teaser.jpg",
    "altText": "Our new studio at sunrise",
    "mediaType": "image",
    "mimeType": "image/jpeg",
    "size": 482133,
    "width": 1080,
    "height": 1350,
    "aspectRatio": 0.8,
    "duration": null,
    "waveform": null,
    "createdAt": "2026-11-18T09:30:00.000Z",
    "formats": [],
    "usage": "unused",
    "processing": {
      "state": "ready",
      "error": null
    },
    "previewUrl": "https://storage.beplan.io/org-media/…/preview?X-Amz-Signature=…",
    "mediaUrl": "https://storage.beplan.io/org-media/…?X-Amz-Signature=…",
    "playback": null,
    "publishCopy": null
  }
}
```


## Get a download URL

`GET /organizations/{organizationId}/workspaces/{workspaceId}/media-library/items/{mediaId}/download-url` · operationId `media.downloadUrl.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 signed URL (valid about one hour, no `Authorization` header needed) that downloads the media's original file under its name. Ask for a new one when it expires.

**Parameters**

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

**200 OK**

- `data` (object, required)
  - `url` (string, required)

**Errors**

| Status | Code | Message |
|---|---|---|
| 403 | `MISSING_PERMISSION` | You don't have permission to do this. |
| 404 | `MEDIA_NOT_FOUND` | This media doesn't exist or was deleted. |
| 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: The original file**

```bash
curl -X GET "https://api.beplan.io/v1/organizations/ORGANIZATION_ID/workspaces/WORKSPACE_ID/media-library/items/0b6f5a52-7f4e-4c55-9d6f-2f0a6a1c3e11/download-url" \
  -H "Authorization: Bearer beplan_pat_…"
```

Answers 200:

```json
{
  "data": {
    "url": "https://storage.beplan.io/org-media/…?X-Amz-Signature=…"
  }
}
```


## List the posts using a media

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

- Scope: `media:read`
- Role permission: Any member who can see it
- Effect (`read`): Changes nothing.
- Stability: Beta (May still change before it is marked stable.) Since 2026-11-19.

Lists up to 10 posts of the workspace that hold the media (posts still to publish first, then the latest), with their id, title, status and time (`scheduledAt`, `null` while unscheduled); `total` counts them all. Without `posts:read`, `status` and `scheduledAt` are `null`. Check it before deleting a media.

**Parameters**

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

**200 OK**

- `data` (object, required)
  - `posts` (array of object, required)
    - `id` (string, required)
    - `title` (string, required)
    - `status` (string, required, nullable): Where the post stands; `null` for an integration that does not hold `posts:read`. one of `idea`, `in_progress`, `in_review`, `ready`, `scheduled`, `in_process`, `posted`, `failed` (may gain values).
    - `scheduledAt` (string (date-time), required, nullable): When it goes (or went) out; `null` while unscheduled, and for an integration that does not hold `posts:read`.
  - `total` (integer, required): at least 0.

**Errors**

| Status | Code | Message |
|---|---|---|
| 404 | `MEDIA_NOT_FOUND` | This media doesn't exist or was deleted. |
| 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 media used nowhere**

```bash
curl -X GET "https://api.beplan.io/v1/organizations/ORGANIZATION_ID/workspaces/WORKSPACE_ID/media-library/items/0b6f5a52-7f4e-4c55-9d6f-2f0a6a1c3e11/posts" \
  -H "Authorization: Bearer beplan_pat_…"
```

Answers 200:

```json
{
  "data": {
    "posts": [],
    "total": 0
  }
}
```


## Get a video's transcript

`GET /organizations/{organizationId}/workspaces/{workspaceId}/media-library/items/{mediaId}/transcript` · operationId `media.transcript.get`

- Scope: `media:read`
- Role permission: Any member who can see it
- Effect (`read`): Changes nothing.
- Stability: Beta (May still change before it is marked stable.) Since 2026-11-19.

Returns what is said in a video (`text`, timed `segments` in milliseconds, its `language`) and what happens on screen (`understanding`: a summary, the key moment, scenes), once ready. `status` says where it stands: `none` (never queued: an image, or an old video), `pending`, `processing`, `ready`, `no_speech` or `failed`. Only for organizations with media transcripts turned on (`402 PLAN_UPGRADE_REQUIRED` otherwise).

**Parameters**

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

**200 OK**

- `data` (object, required, MediaTranscript)
  - `status` (string, required): one of `none`, `pending`, `processing`, `ready`, `no_speech`, `failed` (may gain values).
  - `language` (string, required, nullable)
  - `text` (string, required, nullable)
  - `segments` (array of object, required)
    - `startMs` (number, required)
    - `endMs` (number, required)
    - `text` (string, required)
  - `completedAt` (string, required, nullable)
  - `understanding` (object, required, MediaUnderstanding)
    - `status` (string, required): one of `none`, `pending`, `processing`, `ready`, `skipped`, `failed` (may gain values).
    - `contentType` (string, required, nullable)
    - `summary` (string, required, nullable)
    - `keyMoment` (object, required, nullable)
      - `startMs` (number, required)
      - `endMs` (number, required)
      - `description` (string, required)
    - `scenes` (array of object, required)
      - `startMs` (number, required)
      - `endMs` (number, required)
      - `description` (string, required)
      - `onScreenText` (string, optional)

**Errors**

| Status | Code | Message |
|---|---|---|
| 402 | `PLAN_UPGRADE_REQUIRED` | Your current plan doesn't include this feature. |
| 404 | `MEDIA_NOT_FOUND` | This media doesn't exist or was deleted. |
| 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: An image has no transcript**

```bash
curl -X GET "https://api.beplan.io/v1/organizations/ORGANIZATION_ID/workspaces/WORKSPACE_ID/media-library/items/0b6f5a52-7f4e-4c55-9d6f-2f0a6a1c3e11/transcript" \
  -H "Authorization: Bearer beplan_pat_…"
```

Answers 200:

```json
{
  "data": {
    "status": "none",
    "language": null,
    "text": null,
    "segments": [],
    "completedAt": null,
    "understanding": {
      "status": "none",
      "contentType": null,
      "summary": null,
      "keyMoment": null,
      "scenes": []
    }
  }
}
```


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