Skip to content

Add V2 videos endpoints and Video schema#36

Merged
meagerfindings merged 2 commits into
mainfrom
add-v2-videos-paths-and-schema
Apr 30, 2026
Merged

Add V2 videos endpoints and Video schema#36
meagerfindings merged 2 commits into
mainfrom
add-v2-videos-paths-and-schema

Conversation

@meagerfindings

@meagerfindings meagerfindings commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

What

Documents the new read-only V2 videos endpoints shipping in companycam/company-cam-api#21960:

  • GET /videoslistVideos
  • GET /videos/{id}getVideo
  • GET /projects/{project_id}/videoslistProjectVideos

Adds a new Video schema in components.schemas derived directly from V2::VideoSerializer (the same serializer already used to render video.* webhook payloads).

⚠️ Do NOT merge until Rails endpoints are live in production

ReadMe at docs.companycam.com auto-publishes from this spec. Merging early would document vapor.

Schema notes

  • coordinates is a single object ({lat, lon}), not an array like Photo.coordinates. (V2::VideoSerializer#coordinates returns Coordinate.new(...).to_h, not an array.)

  • playback_url, format, and thumbnail_urls.* are nullable until processing completes.

  • preview_gif_urls was dropped from both this schema and V2::VideoSerializer (CompanyCam-API#21960) — the underlying column is unused and the field always returned all-nulls. Cleaner to omit than to document a permanently-null block.

  • status enum: pending, processing, processed, processing_error.

  • Each path block and the Video schema include a callout about the HLS-readiness gotcha:

    video.created webhooks fire on after_create, before Mux transcoding completes. Until status: processed, playback_url returns the raw upload URL (the pending_uri) and format returns the file extension of that URL, not m3u8. Subscribe to video.updated or poll GET /videos/{id} until status: processed before consuming playback_url/format.

Verification

npx js-yaml openapi.yaml > /dev/null

parses cleanly. components.schemas.Video and all three new paths show up in the parsed structure.

Linked

  • Rails PR: companycam/company-cam-api#21960
  • Scoping doc: 2026-04-29 - V2 Videos API Scoping.md

https://linear.app/companycam/issue/RIF-226/add-videos-to-v2-api

meagerfindings and others added 2 commits April 29, 2026 10:55
Documents the new read-only video endpoints shipping in
CompanyCam/Company-Cam-API#21960:

- GET /videos (listVideos)
- GET /videos/{id} (getVideo)
- GET /projects/{project_id}/videos (listProjectVideos)

Adds a new Video schema mirroring V2::VideoSerializer field-for-field.
Note: video.coordinates is a single Coordinate object (not an array
like Photo.coordinates).

Each path and the Video schema include callouts about the HLS-
readiness gotcha: 'video.created' webhooks fire on after_create,
before Mux transcoding completes, so until status flips to
'processed' the playback_url returns the raw upload URL and format
returns the file extension of pending_uri instead of 'm3u8'.

Do not merge until the Rails endpoints are live in production --
ReadMe at docs.companycam.com auto-publishes from the spec.

Amp-Thread-ID: https://ampcode.com/threads/T-019dda1b-6c37-72e4-992c-1834091fce79
Co-authored-by: Amp <amp@ampcode.com>
The preview_gif_urls attribute is being removed from
V2::VideoSerializer in CompanyCam-API#21960 — it always returned
{ large: nil, medium: nil, small: nil } and the underlying
preview_gif column is unused. Removing it from the public schema
before any consumers depend on it.
@meagerfindings meagerfindings marked this pull request as ready for review April 29, 2026 22:01
@meagerfindings meagerfindings merged commit bf741d1 into main Apr 30, 2026
3 checks passed
@meagerfindings meagerfindings deleted the add-v2-videos-paths-and-schema branch April 30, 2026 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant