---
title: "Videos"
description: "REST endpoints for videos. Bearer-auth required."
section: "API"
group: "REST"
order: 76
---

## GET /api/videos

List videos

List videos in a workspace. Each row is lazily reconciled against Cloudflare Stream — rows in `processing`/`queued` are refreshed inline and transitioned to `ready`/`error` when CF has finished transcoding.

**Query parameters**

- `limit` (optional): Max items per page (1–100, default 100).
- `after` (optional): Keyset cursor — return the page after this row (next page).
- `before` (optional): Keyset cursor — return the page before this row (prev page).
- `ids` (optional): Comma-separated IDs. Narrows results to these IDs within the caller's accessible scope (does not bypass access checks).
- `workspace_id` (optional): Filter to videos in this workspace. When omitted, returns videos across every workspace the caller is a member of (admins see all).

**Response**

```json
{
  "data": [
    {
      "id": "<...>",
      "fileId": "<...>",
      "workspaceId": "<...>",
      "cfStreamUid": "<...>",
      "transcodingStatus": "<...>",
      "transcodingError": "<...>",
      "duration": "<...>",
      "width": "<...>",
      "height": "<...>",
      "size": "<...>",
      "metadata?": "<...>",
      "playbackUrl": "<...>",
      "thumbnailUrl": "<...>",
      "signedToken": "<...>"
    }
  ],
  "pageInfo": {
    "total": "number",
    "hasNextPage": "boolean",
    "hasPreviousPage": "boolean",
    "startCursor": "string",
    "endCursor": "string"
  }
}
```

## GET /api/videos/{id}

Get video

Fetch a video by ID. If the row is still `processing`, the service lazy-reconciles against Cloudflare Stream and flips it to `ready`/`error` when CF has finished transcoding.

**Path parameters**

- `id` (required): The video's prefixed ID (e.g. `vid_...`).

**Response**

```json
{
  "id": "string",
  "fileId": "string",
  "workspaceId": "string",
  "cfStreamUid": "string",
  "transcodingStatus": "queued | processing | ready | error",
  "transcodingError": "string",
  "duration": "number",
  "width": "number",
  "height": "number",
  "size": "number",
  "metadata?": "any",
  "playbackUrl": "string",
  "thumbnailUrl": "string",
  "signedToken": "string"
}
```

## DELETE /api/videos/{id}

Delete the video projection (the underlying file is unaffected).

**Path parameters**

- `id` (required): Video to delete.

**Response**

```json
{
  "success": "boolean"
}
```

## GET /api/videos/by-file/{file_id}

Get video by file id

Resolve the video (if any) bound to a given file. Used by file-detail UIs that know the file id but not the video id.

**Path parameters**

- `file_id` (required): The underlying file's prefixed ID (e.g. `fil_...`).

**Response**

```json
{
  "id": "string",
  "fileId": "string",
  "workspaceId": "string",
  "cfStreamUid": "string",
  "transcodingStatus": "queued | processing | ready | error",
  "transcodingError": "string",
  "duration": "number",
  "width": "number",
  "height": "number",
  "size": "number",
  "metadata?": "any",
  "playbackUrl": "string",
  "thumbnailUrl": "string",
  "signedToken": "string"
}
```
