Loading…
/videos is the editorial surface for the public video gallery. Editors create,
reorder, and publish videos backed by the private WordPress video CPT; the public
gallery at /videos renders the published set with a deep-link modal player. The full
public-side design is documented at Videos.
This module follows the CPT-backed module pattern —
content is stored as JSON in content.raw and revalidated via cache tags on write.
| Route | Purpose | Guard |
|---|---|---|
/videos | List view with thumbnails, reorder, bulk actions | org:content:view (page.tsx) |
/videos/[slug] | Edit a single video (metadata, poster, Mux asset) | org:content:edit |
Entry point:
page.tsx
gates on requirePermission("org:content:view") and renders VideosClientPage; the
[slug] detail page re-asserts org:content:edit.
| Route | Purpose | Clearance |
|---|---|---|
GET /api/workspace/videos | List CPT items (resized list posters via ?w=) | org:content:view |
POST /api/workspace/videos | Create one (videoCreateSchema) | org:content:edit |
GET / PUT / DELETE /api/workspace/videos/[id] | Fetch, update, trash (delete falls back to edit) | view / edit / delete-or-edit |
POST /api/workspace/videos/bulk | Bulk publish, trash, or recategorise | org:content:edit |
POST /api/workspace/videos/reorder | Persist drag-and-drop menu order | org:content:edit |
POST /api/workspace/videos/upload-poster | Upload a custom poster (not Mux-derived) | org:content:edit |
Handlers live under
app/api/workspace/videos/
and share the VIDEO_CPT descriptor from lib/services/cpt.service.ts.
LIST_POSTER_WIDTH, retina 2x):
WordPress-hosted images get a ?w= query; third-party or signed CDN URLs are left
untouched so signatures don't break.productVideoPosterUrl in lib/data/product-videos.ts.product-videos.ts registry rather than rendering empty.Related: Content Studio · Videos (public) · CPT pattern