VOD Docs

API reference

Every HTTP endpoint, its auth requirement and what it does.

The live, interactive schema is generated by FastAPI at /docs (Swagger UI) and /openapi.json on the API host. This page is the curated summary.

Base URL: https://api.vod.spokhrel.dev in production, http://localhost locally (through Caddy).

Auth: Authorization: Bearer <access_token> unless stated otherwise. Errors use FastAPI's standard shape, { "detail": "…" }, or a list of validation errors for 422.

Auth labelMeaning
PublicNo token needed
OptionalWorks without a token; a valid token can unlock more (for example, your own private video)
UserAny valid access token
VerifiedValid token and verified email
AdminValid token and ADMIN role

Auth

MethodPathAuthDescription
POST/auth/signupPublicCreate an account and send a verification email
GET/auth/verify-email?token=PublicVerify the email address
POST/auth/resend-verificationPublicSend a new verification link (3 per hour)
POST/auth/signinPublicReturns access_token, refresh_token and the user
POST/auth/refreshRefresh token in bodyReturns a new access token
POST/auth/logoutRefresh token in bodyRevoke the refresh token
POST/auth/forgot-passwordPublicEmail a 6-digit reset code
POST/auth/reset-passwordPublicSet a new password with the code; signs out every session

User

MethodPathAuthDescription
GET/user/profileVerifiedThe current user

Videos

MethodPathAuthDescription
GET/videos/PublicPublic feed (skip, limit)
GET/videos/by-id/{id}OptionalOne video; private ones only for owner or admin
GET/videos/user/meUserYour own videos
GET/videos/{id}/statusUser (owner)Processing status and progress
POST/videos/{id}/viewOptionalIncrement the view count
GET/videos/list-allAdminAdmin list: search, filters, sorting, pagination with total
POST/videos/createAdminLegacy multipart upload (video, thumbnail, data JSON string)
PATCH/videos/by-id/{id}AdminPartial metadata update
PATCH/videos/by-id/{id}/visibilityAdminSet is_public
POST/videos/{id}/thumbnailAdminUpload and attach a poster
GET/videos/by-id/{id}/download-urlAdmin15-minute presigned download URL for the original
DELETE/videos/by-id/{id}AdminSoft delete

Uploads (tus)

MethodPathAuthDescription
POST, PATCH, HEAD/files/…Token in tus metadataThe tus protocol itself, served by tusd, not FastAPI
GET/internal/tus/hooks/uploads/{upload_id}Admin{ status, video_id } for a finished upload

tusd's own hook endpoint is internal to the Docker network and not part of the public API.

Health

MethodPathAuthDescription
GET/health/Public{ "status": "Ok!" } (process liveness only; it does not check the database or Redis)

Example: sign in, then call an admin endpoint

TOKEN=$(curl -s -X POST https://api.vod.spokhrel.dev/auth/signin \
  -H 'Content-Type: application/json' \
  -d '{"email":"admin@example.com","password":"…"}' | jq -r .access_token)

curl -s "https://api.vod.spokhrel.dev/videos/list-all?limit=10&processing_status=failed" \
  -H "Authorization: Bearer $TOKEN"

On this page