API Reference¶
All endpoints are prefixed with /api.
Interactive Docs
Full interactive API documentation (Swagger UI) is available at http://localhost:8000/docs when the server is running.
Authentication¶
Login¶
Request body:
Response:
A refresh_token is also set as an httpOnly cookie automatically.
Refresh Token¶
Uses the httpOnly cookie to issue a new access token. No request body needed.
Logout¶
Revokes the refresh token and clears the cookie.
Current User¶
Videos¶
List Videos¶
Upload Video¶
POST /api/videos/upload
Authorization: Bearer <access_token>
Content-Type: multipart/form-data
file=<video file>
Import from YouTube¶
POST /api/videos/download
Authorization: Bearer <access_token>
Content-Type: application/json
{
"url": "https://www.youtube.com/watch?v=..."
}
Download Progress (WebSocket)¶
Real-time download progress events:
Marks¶
List Marks for a Video¶
Create Mark¶
POST /api/marks
Authorization: Bearer <access_token>
Content-Type: application/json
{
"video_id": 1,
"timestamp": 125.5,
"category": "offense",
"players": "7 LeBron, 23 Jordan"
}
category options: offense | defense | turnover
Clips¶
Extract Clips¶
POST /api/clips
Authorization: Bearer <access_token>
Content-Type: application/json
{
"mark_ids": [1, 2, 3]
}
Highlights¶
Generate Highlight Reel¶
POST /api/highlights/generate
Authorization: Bearer <access_token>
Content-Type: application/json
{
"filter_type": "player",
"filter_value": "7"
}
filter_type options: player | category
Shares¶
Create Share Link¶
POST /api/shares
Authorization: Bearer <access_token>
Content-Type: application/json
{
"resource_type": "clip",
"resource_id": 1,
"expires_in": "7d"
}
expires_in options: 24h | 7d | 30d | permanent
Response:
Health Check¶
No authentication required. Returns 200 OK when the service is running.