Endpoints
Complete reference for the Media API endpoints.
Base URL
http://localhost:3001/api
Authentication
All endpoints (except health check) require a JWT bearer token:
Authorization: Bearer <token>
Media CRUD
List media
GET /media?page=1&limit=20&sort=createdAt&order=desc
Query parameters:
| Param | Type | Default | Description |
|---|---|---|---|
page |
number |
1 |
Page number |
limit |
number |
20 |
Items per page |
sort |
string |
createdAt |
Sort field |
order |
asc|desc |
desc |
Sort order |
Get media item
GET /media/:id
Create media item
POST /media
Content-Type: application/json
{
"title": "My Video",
"description": "A description",
"tags": ["demo", "tutorial"]
}
Update media item
PATCH /media/:id
Content-Type: application/json
{
"title": "Updated Title"
}
Delete media item
DELETE /media/:id
Search
Full-text search
GET /media/search?q=tutorial&type=video&tags=demo
| Param | Type | Description |
|---|---|---|
q |
string |
Search query |
type |
string |
Filter by media type (video, image, audio) |
tags |
string |
Comma-separated tag filter |
Metadata
Get media metadata
GET /media/:id/metadata
Returns extracted metadata including dimensions, duration, codec, bitrate, and more.
Social
Like a media item
POST /media/:id/like
Get comments
GET /media/:id/comments
Add comment
POST /media/:id/comments
Content-Type: application/json
{
"text": "Great video!"
}
Upload
See the Upload API page for the multipart resumable upload flow.