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

## Import a media from a URL

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

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

Adds a file to the library from a public address, for callers that can't send the bytes themselves (assistants, no-code tools); otherwise prefer `media.uploads.create`. The address must be `https` on the default port, with no user or password in it, and not a local name (`localhost`, `.local`, `.internal`) or an IP address outside the public internet (private network, link-local, cloud metadata): otherwise `422 MEDIA_IMPORT_URL_INVALID` and nothing is created. A host name is resolved only when the file is fetched: one that resolves to a non-public address fails the import with `import_unreachable`. Redirects are followed, at most 3, and only to addresses that pass the same rules. The file must be one of the library's image or video types and really be of that type (`mimeType`, or guessed from the address's extension: an address without a known extension needs `mimeType`); an image is at most 20 MB, a video 10 GB, and never more than the organization's storage left. Folder, formats and review work like an upload. **Asynchronous**: answers `202` with `mediaId` at once and fetches the file in the background. Poll `media.get` with that id (every few seconds, then less often): `processing.state` is `processing` while the file is fetched and prepared (it has no file or download link yet, and is not in lists), then `ready`, or `failed` with `processing.error` saying why: `import_unreachable` (the server could not be reached, answered an error, or redirected too often or to an address that isn't allowed), `import_not_public` (the address itself is not a public `https` address), `import_too_large` (over the limit or the storage left), `import_wrong_type` (the file is not of the declared type, e.g. an HTML page), `import_timeout` (the server sent nothing for 30 s or was too slow overall), `import_failed` (our side; try again). A failed import stays in the library as a failed item: delete it with `media.delete`. Short outages are retried before the import fails.

**Parameters**

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

**Request body** (JSON, required)

- `url` (string, required): The file's public `https` address (default port, no user or password in it). Redirects are followed only to public `https` addresses. at most 2048 characters.
- `filename` (string, optional): The name shown in the library. Default: the last segment of the address's path. 1–255 characters.
- `mimeType` (string, optional): The file's type. Default: guessed from the address's extension; an address without a known extension needs it. The fetched file must be of this type. one of `image/jpeg`, `image/png`, `image/webp`, `image/gif`, `image/heic`, `image/heif`, `image/avif`, `image/tiff`, `image/bmp`, `video/mp4`, `video/quicktime`, `video/webm`, `video/x-matroska`, `video/x-msvideo`, `video/x-m4v`, `video/3gpp`, `video/mpeg`.
- `folderId` (string (uuid), optional, nullable): The folder to put it in (`null` or omitted: the root).
- `formatIds` (array of string (uuid), optional): Formats of the workspace to tag it with. at most 50 items.

**202 Accepted**

- `data` (object, required, MediaImport)
  - `mediaId` (string, required)
  - `versionId` (string, required, nullable)
  - `state` (string, required): one of `importing`.

**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 | `FORMAT_NOT_FOUND` | One of the formats 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. |
| 413 | `MEDIA_STORAGE_FULL` | Your media storage is full. Delete some media or add storage to your plan. |
| 422 | `MEDIA_IMPORT_URL_INVALID` | Use a public HTTPS address of the file, on the default port and without credentials. |

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: An image by its address**

```bash
curl -X POST "https://api.beplan.io/v1/organizations/ORGANIZATION_ID/workspaces/WORKSPACE_ID/media-library/imports" \
  -H "Authorization: Bearer beplan_pat_…" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "url": "https://cdn.example.com/campaign/launch-teaser.jpg"
}'
```

Answers 202:

```json
{
  "data": {
    "mediaId": "0b6f5a52-7f4e-4c55-9d6f-2f0a6a1c3e11",
    "versionId": null,
    "state": "importing"
  }
}
```

**Example: A video from an address without an extension, into a folder**

```bash
curl -X POST "https://api.beplan.io/v1/organizations/ORGANIZATION_ID/workspaces/WORKSPACE_ID/media-library/imports" \
  -H "Authorization: Bearer beplan_pat_…" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "url": "https://files.example.com/download?id=42",
  "filename": "Launch teaser.mp4",
  "mimeType": "video/mp4",
  "folderId": "6d1c2b7a-1f2e-4b8c-9a3d-5e6f7a8b9c0d"
}'
```

Answers 202:

```json
{
  "data": {
    "mediaId": "0b6f5a52-7f4e-4c55-9d6f-2f0a6a1c3e11",
    "versionId": null,
    "state": "importing"
  }
}
```


## Cancel an upload

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

- Scope: `media:write`
- Role permission: Any of: Upload media (`media:create`), Upload raw footage (`media:rawFootageUpload`), Manage raw footage (`media:rawFootageManage`), Review media (`media:review`)
- 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.

Cancels an upload in progress that this token started (see `media.uploads.create`) and removes what it created. `409 CONFLICT` once it is complete. Answers `204`; calling it again changes nothing.

**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)

- `versionId` (string (uuid), required, nullable): The ticket's `versionId`, as the upload returned it (`null` for a plain upload).

**204 No content**

No content.

**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. |
| 409 | `CONFLICT` | This changed in the meantime. Refresh and try again. |
| 502 | `UPSTREAM_FAILED` | A service we depend on didn't respond. Please try again. |

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), `IDEMPOTENCY_KEY_REUSED` (409), `PAYLOAD_TOO_LARGE` (413), `UNSUPPORTED_MEDIA_TYPE` (415), `RATE_LIMITED` (429), `INTERNAL_ERROR` (500).

**Example: Cancel a plain upload**

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

Answers 204 with no content.


## Complete an upload

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

- Scope: `media:write`
- Role permission: Any of: Upload media (`media:create`), Upload raw footage (`media:rawFootageUpload`), Manage raw footage (`media:rawFootageManage`), Review media (`media:review`)
- 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.

Last step of an upload (see `media.uploads.create`), by the token that started it: checks every byte reached storage (`409 MEDIA_UPLOAD_INCOMPLETE` otherwise: send the missing parts and call again), marks the file uploaded and queues its processing (videos are transcoded: follow `processing.state` with `media.get`). For a new version, it becomes the media's current one and the media goes back to review. Answers `204`; calling it again after success changes nothing. A new version of a media in posts that are scheduled or waiting for approval answers `422 MEDIA_IN_POSTS_UNDER_APPROVAL` when the organization requires approval for posts from integrations.

**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)

- `versionId` (string (uuid), required, nullable): The ticket's `versionId`, as the upload returned it (`null` for a plain upload).

**204 No content**

No content.

**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. |
| 409 | `CONFLICT` | This changed in the meantime. Refresh and try again. |
| 409 | `MEDIA_UPLOAD_INCOMPLETE` | Wait for the upload to finish before approving this media. |
| 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. |
| 502 | `UPSTREAM_FAILED` | A service we depend on didn't respond. Please try again. |

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), `IDEMPOTENCY_KEY_REUSED` (409), `PAYLOAD_TOO_LARGE` (413), `UNSUPPORTED_MEDIA_TYPE` (415), `RATE_LIMITED` (429), `INTERNAL_ERROR` (500).

**Example: Complete a plain upload**

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

Answers 204 with no content.


## Sign upload parts again

`POST /organizations/{organizationId}/workspaces/{workspaceId}/media-library/items/{mediaId}/upload/parts` · operationId `media.upload.parts.sign`

- Scope: `media:write`
- Role permission: Any of: Upload media (`media:create`), Upload raw footage (`media:rawFootageUpload`), Manage raw footage (`media:rawFootageManage`), Review media (`media:review`)
- Effect (`write`): Changes data in Beplan.
- Idempotency: Single-flight: an `Idempotency-Key` only stops a second run while the first is running. Its answer carries signed links and is never stored, so a repeat afterwards runs again with fresh links.
- Stability: Beta (May still change before it is marked stable.) Since 2026-11-19.

For a long multipart upload whose part URLs expired (they last an hour): signs up to 100 parts again (`partNumbers`, from 1). Only for an upload in progress that this token started (`409 CONFLICT` otherwise). Also keeps the upload from being cleaned up as abandoned.

**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)

- `versionId` (string (uuid), required, nullable)
- `partNumbers` (array of integer, required): 1–100 items; each from 1 to 10000.

**200 OK**

- `data` (array of object, required)
  - `partNumber` (number, required)
  - `url` (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 | `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. |
| 409 | `CONFLICT` | This changed in the meantime. Refresh and try again. |

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), `IDEMPOTENCY_KEY_REUSED` (409), `PAYLOAD_TOO_LARGE` (413), `UNSUPPORTED_MEDIA_TYPE` (415), `RATE_LIMITED` (429), `INTERNAL_ERROR` (500).

**Example: Re-sign the first two parts**

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

Answers 200:

```json
{
  "data": [
    {
      "partNumber": 1,
      "url": "https://storage.beplan.io/org-media/…?partNumber=1&X-Amz-Signature=…"
    },
    {
      "partNumber": 2,
      "url": "https://storage.beplan.io/org-media/…?partNumber=2&X-Amz-Signature=…"
    }
  ]
}
```


## Start uploading a new version

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

- Scope: `media:write`
- Role permission: Any of: Upload media (`media:create`), Review media (`media:review`), Manage raw footage (`media:rawFootageManage`)
- Effect (`write`): Changes data in Beplan.
- Idempotency: Single-flight: an `Idempotency-Key` only stops a second run while the first is running. Its answer carries signed links and is never stored, so a repeat afterwards runs again with fresh links.
- Stability: Beta (May still change before it is marked stable.) Since 2026-11-19.

Starts uploading a new version of a media in review: one sent back for changes (by its uploader or a reviewer), or an edited cut of raw footage (by someone who manages raw footage). Same three steps as `media.uploads.create` (send the ticket's `versionId` to complete). Nothing changes on the media until the upload completes. `409 MEDIA_REVIEW_STATE_CONFLICT` in any other state. `422 MEDIA_IN_POSTS_UNDER_APPROVAL` when the media is in posts that are scheduled or waiting for approval and the organization requires approval for posts from integrations. Needs the organization's Team Collaboration add-on (`402 PLAN_UPGRADE_REQUIRED` with `details.feature: "team_collaboration"` without it).

**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)

- `file` (object, required): The file to upload. `size` must be at most 20 MB (20,971,520 bytes) for images and GIFs, 50 MB (52,428,800 bytes) for audio and 10 GB (10,737,418,240 bytes) for videos, else `400 VALIDATION_FAILED` on `size`; an audio file's `duration`, when given, at most 900 seconds.
  - `filename` (string, required): The file's name, shown in the library. 1–255 characters.
  - `mimeType` (string, required): The file's type. The bytes you send must be of this type. one of `image/jpeg`, `image/png`, `image/webp`, `image/gif`, `image/heic`, `image/heif`, `image/avif`, `image/tiff`, `image/bmp`, `video/mp4`, `video/quicktime`, `video/webm`, `video/x-matroska`, `video/x-msvideo`, `video/x-m4v`, `video/3gpp`, `video/mpeg`, `audio/mpeg`, `audio/mp3`, `audio/mp4`, `audio/x-m4a`, `audio/m4a`, `audio/aac`, `audio/x-aac`, `audio/wav`, `audio/x-wav`, `audio/wave`, `audio/vnd.wave`, `audio/ogg`, `audio/opus`, `audio/flac`, `audio/x-flac`.
  - `size` (integer, required): The exact file size in bytes. greater than 0.
  - `width` (integer, optional): Width in pixels, if you know it. greater than 0.
  - `height` (integer, optional): Height in pixels, if you know it. greater than 0.
  - `duration` (number, optional): Length in seconds (videos and audio), if you know it. at least 0.

**201 Created**

- `data` (object, required, UploadTicket)
  - `mediaId` (string, required): The media the file fills (hidden from lists until the upload completes).
  - `versionId` (string, required, nullable): The version the file fills (raw footage and new versions), else `null`: send it back as is.
  - `plan` (object, required, UploadPlan): How to send the bytes to storage (signed URLs, valid one hour; send them without an `Authorization` header). `single`: one `PUT url` with the whole file and a `Content-Type` header equal to `file.mimeType`. `multipart`: `PUT` each part's bytes to its `url` (part `n` is bytes `[(n - 1) * partSize, n * partSize)`, the last one shorter), in any order, no `Content-Type` needed, ETags need not be kept. Then call `…/upload/complete`.
    - variant mode: "single":
      - `mode` (string, required): always `"single"`.
      - `url` (string, required)
    - variant mode: "multipart":
      - `mode` (string, required): always `"multipart"`.
      - `partSize` (number, required)
      - `parts` (array of object, required)
        - `partNumber` (number, required)
        - `url` (string, 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 | `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. |
| 409 | `CONFLICT` | This changed in the meantime. Refresh and try again. |
| 409 | `MEDIA_REVIEW_STATE_CONFLICT` | This media isn't at that step of the review anymore. |
| 413 | `MEDIA_STORAGE_FULL` | Your media storage is full. Delete some media or add storage to your plan. |
| 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. |
| 502 | `UPSTREAM_FAILED` | A service we depend on didn't respond. Please try again. |

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), `IDEMPOTENCY_KEY_REUSED` (409), `PAYLOAD_TOO_LARGE` (413), `UNSUPPORTED_MEDIA_TYPE` (415), `RATE_LIMITED` (429), `INTERNAL_ERROR` (500).

**Example: A new cut of a video**

```bash
curl -X POST "https://api.beplan.io/v1/organizations/ORGANIZATION_ID/workspaces/WORKSPACE_ID/media-library/items/0b6f5a52-7f4e-4c55-9d6f-2f0a6a1c3e11/versions" \
  -H "Authorization: Bearer beplan_pat_…" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "file": {
    "filename": "launch-teaser-v2.mp4",
    "mimeType": "video/mp4",
    "size": 52428800
  }
}'
```

Answers 201:

```json
{
  "data": {
    "mediaId": "0b6f5a52-7f4e-4c55-9d6f-2f0a6a1c3e11",
    "versionId": "1c2d3e4f-5a6b-4c7d-8e9f-0a1b2c3d4e5f",
    "plan": {
      "mode": "multipart",
      "partSize": 25165824,
      "parts": [
        {
          "partNumber": 1,
          "url": "https://storage.beplan.io/org-media/…?partNumber=1&X-Amz-Signature=…"
        },
        {
          "partNumber": 2,
          "url": "https://storage.beplan.io/org-media/…?partNumber=2&X-Amz-Signature=…"
        },
        {
          "partNumber": 3,
          "url": "https://storage.beplan.io/org-media/…?partNumber=3&X-Amz-Signature=…"
        }
      ]
    }
  }
}
```


## Start uploading raw footage

`POST /organizations/{organizationId}/workspaces/{workspaceId}/media-library/raw-footage/uploads` · operationId `media.rawFootage.uploads.create`

- Scope: `media:write`
- Role permission: Upload raw footage (`media:rawFootageUpload`)
- Effect (`write`): Changes data in Beplan.
- Idempotency: Single-flight: an `Idempotency-Key` only stops a second run while the first is running. Its answer carries signed links and is never stored, so a repeat afterwards runs again with fresh links.
- Stability: Beta (May still change before it is marked stable.) Since 2026-11-19.

Starts uploading a video as raw footage, for an editor to cut (it becomes version 0). Videos only. Same three steps as `media.uploads.create` (send the ticket's `versionId` to complete). Needs the organization's Team Collaboration add-on (`402 PLAN_UPGRADE_REQUIRED` with `details.feature: "team_collaboration"` without it).

**Parameters**

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

**Request body** (JSON, required)

- `file` (object, required): The file to upload. `size` must be at most 20 MB (20,971,520 bytes) for images and GIFs, 50 MB (52,428,800 bytes) for audio and 10 GB (10,737,418,240 bytes) for videos, else `400 VALIDATION_FAILED` on `size`; an audio file's `duration`, when given, at most 900 seconds.
  - `filename` (string, required): The file's name, shown in the library. 1–255 characters.
  - `mimeType` (string, required): The file's type. The bytes you send must be of this type. one of `image/jpeg`, `image/png`, `image/webp`, `image/gif`, `image/heic`, `image/heif`, `image/avif`, `image/tiff`, `image/bmp`, `video/mp4`, `video/quicktime`, `video/webm`, `video/x-matroska`, `video/x-msvideo`, `video/x-m4v`, `video/3gpp`, `video/mpeg`, `audio/mpeg`, `audio/mp3`, `audio/mp4`, `audio/x-m4a`, `audio/m4a`, `audio/aac`, `audio/x-aac`, `audio/wav`, `audio/x-wav`, `audio/wave`, `audio/vnd.wave`, `audio/ogg`, `audio/opus`, `audio/flac`, `audio/x-flac`.
  - `size` (integer, required): The exact file size in bytes. greater than 0.
  - `width` (integer, optional): Width in pixels, if you know it. greater than 0.
  - `height` (integer, optional): Height in pixels, if you know it. greater than 0.
  - `duration` (number, optional): Length in seconds (videos and audio), if you know it. at least 0.

**201 Created**

- `data` (object, required, UploadTicket)
  - `mediaId` (string, required): The media the file fills (hidden from lists until the upload completes).
  - `versionId` (string, required, nullable): The version the file fills (raw footage and new versions), else `null`: send it back as is.
  - `plan` (object, required, UploadPlan): How to send the bytes to storage (signed URLs, valid one hour; send them without an `Authorization` header). `single`: one `PUT url` with the whole file and a `Content-Type` header equal to `file.mimeType`. `multipart`: `PUT` each part's bytes to its `url` (part `n` is bytes `[(n - 1) * partSize, n * partSize)`, the last one shorter), in any order, no `Content-Type` needed, ETags need not be kept. Then call `…/upload/complete`.
    - variant mode: "single":
      - `mode` (string, required): always `"single"`.
      - `url` (string, required)
    - variant mode: "multipart":
      - `mode` (string, required): always `"multipart"`.
      - `partSize` (number, required)
      - `parts` (array of object, required)
        - `partNumber` (number, required)
        - `url` (string, 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. |
| 413 | `MEDIA_STORAGE_FULL` | Your media storage is full. Delete some media or add storage to your plan. |
| 502 | `UPSTREAM_FAILED` | A service we depend on didn't respond. Please try again. |

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 long video**

```bash
curl -X POST "https://api.beplan.io/v1/organizations/ORGANIZATION_ID/workspaces/WORKSPACE_ID/media-library/raw-footage/uploads" \
  -H "Authorization: Bearer beplan_pat_…" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "file": {
    "filename": "stream-2026-11-18.mp4",
    "mimeType": "video/mp4",
    "size": 1073741824
  }
}'
```

Answers 201:

```json
{
  "data": {
    "mediaId": "2d3e4f5a-6b7c-4d8e-9f0a-1b2c3d4e5f6a",
    "versionId": "3e4f5a6b-7c8d-4e9f-9a0b-1c2d3e4f5a6b",
    "plan": {
      "mode": "multipart",
      "partSize": 25165824,
      "parts": [
        {
          "partNumber": 1,
          "url": "https://storage.beplan.io/org-media/…?partNumber=1&X-Amz-Signature=…"
        },
        {
          "partNumber": 2,
          "url": "https://storage.beplan.io/org-media/…?partNumber=2&X-Amz-Signature=…"
        },
        {
          "partNumber": 3,
          "url": "https://storage.beplan.io/org-media/…?partNumber=3&X-Amz-Signature=…"
        },
        {
          "partNumber": 4,
          "url": "https://storage.beplan.io/org-media/…?partNumber=4&X-Amz-Signature=…"
        },
        {
          "partNumber": 5,
          "url": "https://storage.beplan.io/org-media/…?partNumber=5&X-Amz-Signature=…"
        },
        {
          "partNumber": 6,
          "url": "https://storage.beplan.io/org-media/…?partNumber=6&X-Amz-Signature=…"
        },
        {
          "partNumber": 7,
          "url": "https://storage.beplan.io/org-media/…?partNumber=7&X-Amz-Signature=…"
        },
        {
          "partNumber": 8,
          "url": "https://storage.beplan.io/org-media/…?partNumber=8&X-Amz-Signature=…"
        },
        {
          "partNumber": 9,
          "url": "https://storage.beplan.io/org-media/…?partNumber=9&X-Amz-Signature=…"
        },
        {
          "partNumber": 10,
          "url": "https://storage.beplan.io/org-media/…?partNumber=10&X-Amz-Signature=…"
        },
        {
          "partNumber": 11,
          "url": "https://storage.beplan.io/org-media/…?partNumber=11&X-Amz-Signature=…"
        },
        {
          "partNumber": 12,
          "url": "https://storage.beplan.io/org-media/…?partNumber=12&X-Amz-Signature=…"
        },
        {
          "partNumber": 13,
          "url": "https://storage.beplan.io/org-media/…?partNumber=13&X-Amz-Signature=…"
        },
        {
          "partNumber": 14,
          "url": "https://storage.beplan.io/org-media/…?partNumber=14&X-Amz-Signature=…"
        },
        {
          "partNumber": 15,
          "url": "https://storage.beplan.io/org-media/…?partNumber=15&X-Amz-Signature=…"
        },
        {
          "partNumber": 16,
          "url": "https://storage.beplan.io/org-media/…?partNumber=16&X-Amz-Signature=…"
        },
        {
          "partNumber": 17,
          "url": "https://storage.beplan.io/org-media/…?partNumber=17&X-Amz-Signature=…"
        },
        {
          "partNumber": 18,
          "url": "https://storage.beplan.io/org-media/…?partNumber=18&X-Amz-Signature=…"
        },
        {
          "partNumber": 19,
          "url": "https://storage.beplan.io/org-media/…?partNumber=19&X-Amz-Signature=…"
        },
        {
          "partNumber": 20,
          "url": "https://storage.beplan.io/org-media/…?partNumber=20&X-Amz-Signature=…"
        },
        {
          "partNumber": 21,
          "url": "https://storage.beplan.io/org-media/…?partNumber=21&X-Amz-Signature=…"
        },
        {
          "partNumber": 22,
          "url": "https://storage.beplan.io/org-media/…?partNumber=22&X-Amz-Signature=…"
        },
        {
          "partNumber": 23,
          "url": "https://storage.beplan.io/org-media/…?partNumber=23&X-Amz-Signature=…"
        },
        {
          "partNumber": 24,
          "url": "https://storage.beplan.io/org-media/…?partNumber=24&X-Amz-Signature=…"
        },
        {
          "partNumber": 25,
          "url": "https://storage.beplan.io/org-media/…?partNumber=25&X-Amz-Signature=…"
        },
        {
          "partNumber": 26,
          "url": "https://storage.beplan.io/org-media/…?partNumber=26&X-Amz-Signature=…"
        },
        {
          "partNumber": 27,
          "url": "https://storage.beplan.io/org-media/…?partNumber=27&X-Amz-Signature=…"
        },
        {
          "partNumber": 28,
          "url": "https://storage.beplan.io/org-media/…?partNumber=28&X-Amz-Signature=…"
        },
        {
          "partNumber": 29,
          "url": "https://storage.beplan.io/org-media/…?partNumber=29&X-Amz-Signature=…"
        },
        {
          "partNumber": 30,
          "url": "https://storage.beplan.io/org-media/…?partNumber=30&X-Amz-Signature=…"
        },
        {
          "partNumber": 31,
          "url": "https://storage.beplan.io/org-media/…?partNumber=31&X-Amz-Signature=…"
        },
        {
          "partNumber": 32,
          "url": "https://storage.beplan.io/org-media/…?partNumber=32&X-Amz-Signature=…"
        },
        {
          "partNumber": 33,
          "url": "https://storage.beplan.io/org-media/…?partNumber=33&X-Amz-Signature=…"
        },
        {
          "partNumber": 34,
          "url": "https://storage.beplan.io/org-media/…?partNumber=34&X-Amz-Signature=…"
        },
        {
          "partNumber": 35,
          "url": "https://storage.beplan.io/org-media/…?partNumber=35&X-Amz-Signature=…"
        },
        {
          "partNumber": 36,
          "url": "https://storage.beplan.io/org-media/…?partNumber=36&X-Amz-Signature=…"
        },
        {
          "partNumber": 37,
          "url": "https://storage.beplan.io/org-media/…?partNumber=37&X-Amz-Signature=…"
        },
        {
          "partNumber": 38,
          "url": "https://storage.beplan.io/org-media/…?partNumber=38&X-Amz-Signature=…"
        },
        {
          "partNumber": 39,
          "url": "https://storage.beplan.io/org-media/…?partNumber=39&X-Amz-Signature=…"
        },
        {
          "partNumber": 40,
          "url": "https://storage.beplan.io/org-media/…?partNumber=40&X-Amz-Signature=…"
        },
        {
          "partNumber": 41,
          "url": "https://storage.beplan.io/org-media/…?partNumber=41&X-Amz-Signature=…"
        },
        {
          "partNumber": 42,
          "url": "https://storage.beplan.io/org-media/…?partNumber=42&X-Amz-Signature=…"
        },
        {
          "partNumber": 43,
          "url": "https://storage.beplan.io/org-media/…?partNumber=43&X-Amz-Signature=…"
        }
      ]
    }
  }
}
```


## Start uploading a media

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

- Scope: `media:write`
- Role permission: Upload media (`media:create`)
- Effect (`write`): Changes data in Beplan.
- Idempotency: Single-flight: an `Idempotency-Key` only stops a second run while the first is running. Its answer carries signed links and is never stored, so a repeat afterwards runs again with fresh links.
- Stability: Beta (May still change before it is marked stable.) Since 2026-11-19.

Starts uploading an image (up to 20 MB) or a video (up to 10 GB) to the library, optionally into a folder (`folderId`) with formats (`formatIds`). Uploading is three steps: (1) this call, with the file's name, type and exact size, answers a ticket; (2) send the bytes straight to storage as `plan` says: `single` (images): one `PUT plan.url` with the whole file and `Content-Type` equal to `file.mimeType`; `multipart` (videos, GIFs): `PUT` part `n` (bytes `[(n - 1) * partSize, n * partSize)`, the last part shorter) to `plan.parts[n - 1].url`, any order, no headers needed; the URLs are signed for an hour and need no `Authorization` header (`…/upload/parts` signs parts again); (3) `POST …/items/{mediaId}/upload/complete` with the ticket's `versionId`. The media is hidden until completed; `…/upload/abort` cancels. An upload left unfinished is cleaned up after a while. With the Team Collaboration add-on, the media goes to review instead when `sendToReview` is set, and always for members whose role must have their uploads reviewed. `413 MEDIA_STORAGE_FULL` when the organization's storage can't hold the file. Leave `origin` out (`clipEditor` is for the Clips editor's own uploads).

**Parameters**

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

**Request body** (JSON, required)

- `file` (object, required): The file to upload. `size` must be at most 20 MB (20,971,520 bytes) for images and GIFs, 50 MB (52,428,800 bytes) for audio and 10 GB (10,737,418,240 bytes) for videos, else `400 VALIDATION_FAILED` on `size`; an audio file's `duration`, when given, at most 900 seconds.
  - `filename` (string, required): The file's name, shown in the library. 1–255 characters.
  - `mimeType` (string, required): The file's type. The bytes you send must be of this type. one of `image/jpeg`, `image/png`, `image/webp`, `image/gif`, `image/heic`, `image/heif`, `image/avif`, `image/tiff`, `image/bmp`, `video/mp4`, `video/quicktime`, `video/webm`, `video/x-matroska`, `video/x-msvideo`, `video/x-m4v`, `video/3gpp`, `video/mpeg`, `audio/mpeg`, `audio/mp3`, `audio/mp4`, `audio/x-m4a`, `audio/m4a`, `audio/aac`, `audio/x-aac`, `audio/wav`, `audio/x-wav`, `audio/wave`, `audio/vnd.wave`, `audio/ogg`, `audio/opus`, `audio/flac`, `audio/x-flac`.
  - `size` (integer, required): The exact file size in bytes. greater than 0.
  - `width` (integer, optional): Width in pixels, if you know it. greater than 0.
  - `height` (integer, optional): Height in pixels, if you know it. greater than 0.
  - `duration` (number, optional): Length in seconds (videos and audio), if you know it. at least 0.
- `folderId` (string (uuid), optional, nullable)
- `formatIds` (array of string (uuid), optional): at most 50 items.
- `sendToReview` (boolean, optional)
- `origin` (string, optional): one of `library`, `clipEditor`.

**201 Created**

- `data` (object, required, UploadTicket)
  - `mediaId` (string, required): The media the file fills (hidden from lists until the upload completes).
  - `versionId` (string, required, nullable): The version the file fills (raw footage and new versions), else `null`: send it back as is.
  - `plan` (object, required, UploadPlan): How to send the bytes to storage (signed URLs, valid one hour; send them without an `Authorization` header). `single`: one `PUT url` with the whole file and a `Content-Type` header equal to `file.mimeType`. `multipart`: `PUT` each part's bytes to its `url` (part `n` is bytes `[(n - 1) * partSize, n * partSize)`, the last one shorter), in any order, no `Content-Type` needed, ETags need not be kept. Then call `…/upload/complete`.
    - variant mode: "single":
      - `mode` (string, required): always `"single"`.
      - `url` (string, required)
    - variant mode: "multipart":
      - `mode` (string, required): always `"multipart"`.
      - `partSize` (number, required)
      - `parts` (array of object, required)
        - `partNumber` (number, required)
        - `url` (string, 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 | `FOLDER_NOT_FOUND` | This folder doesn't exist in this workspace. |
| 404 | `FORMAT_NOT_FOUND` | One of the formats 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. |
| 413 | `MEDIA_STORAGE_FULL` | Your media storage is full. Delete some media or add storage to your plan. |
| 502 | `UPSTREAM_FAILED` | A service we depend on didn't respond. Please try again. |

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: An image**

```bash
curl -X POST "https://api.beplan.io/v1/organizations/ORGANIZATION_ID/workspaces/WORKSPACE_ID/media-library/uploads" \
  -H "Authorization: Bearer beplan_pat_…" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "file": {
    "filename": "launch-teaser.jpg",
    "mimeType": "image/jpeg",
    "size": 482133
  }
}'
```

Answers 201:

```json
{
  "data": {
    "mediaId": "0b6f5a52-7f4e-4c55-9d6f-2f0a6a1c3e11",
    "versionId": null,
    "plan": {
      "mode": "single",
      "url": "https://storage.beplan.io/org-media/…?X-Amz-Signature=…"
    }
  }
}
```


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