Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Pragyat-Nikunj/VidTube/llms.txt
Use this file to discover all available pages before exploring further.
VidTube includes a full social interaction layer built on top of video content. You can like videos, comments, and tweets; leave comments on videos; publish short-form posts (tweets) to a channel; and subscribe to other channels. All like and subscription endpoints use a toggle pattern — calling the same endpoint twice removes the action. Most write operations require authentication; a small number of read endpoints are public.
Public endpoints (no token required): listing a user’s tweets (GET /api/v1/tweets/getUserTweets/:userId), fetching video comments (GET /api/v1/comments/videoComments/:videoId), and getting a channel’s subscriber count (GET /api/v1/subscription/channelSubscriberCount/:channelId).All other endpoints on this page require an Authorization: Bearer <token> header.
Likes
The like system is a toggle: sending the request once adds the like, sending it again removes it. All like endpoints are protected.Like or unlike a video
curl -X POST https://vidtube-ke5w.onrender.com/api/v1/likes/video/64f1a2b3c4d5e6f7a8b9c0d1 \
-H "Authorization: Bearer <your_access_token>"
Liked response:{
"statusCode": 200,
"data": {
"_id": "65a0b1c2d3e4f5a6b7c8d9e0",
"video": "64f1a2b3c4d5e6f7a8b9c0d1",
"likedBy": "64e0a1b2c3d4e5f6a7b8c9d0",
"createdAt": "2024-09-01T14:00:00.000Z"
},
"message": "Video Liked successfully.",
"success": true
}
Unliked response:{
"statusCode": 200,
"data": null,
"message": "Video unliked successfully.",
"success": true
}
curl -X POST https://vidtube-ke5w.onrender.com/api/v1/likes/comment/65b0c1d2e3f4a5b6c7d8e9f0 \
-H "Authorization: Bearer <your_access_token>"
curl -X POST https://vidtube-ke5w.onrender.com/api/v1/likes/tweet/65c0d1e2f3a4b5c6d7e8f9a0 \
-H "Authorization: Bearer <your_access_token>"
Get all videos you have liked
Returns all videos that the authenticated user has liked.curl https://vidtube-ke5w.onrender.com/api/v1/likes/videos \
-H "Authorization: Bearer <your_access_token>"
{
"statusCode": 200,
"data": [
{
"_id": "65a0b1c2d3e4f5a6b7c8d9e0",
"video": {
"_id": "64f1a2b3c4d5e6f7a8b9c0d1",
"title": "My First Video",
"thumbnail": "https://res.cloudinary.com/...",
"duration": "2: 34 seconds",
"views": 142
},
"likedBy": "64e0a1b2c3d4e5f6a7b8c9d0"
}
],
"message": "Liked Videos fetched successfully.",
"success": true
}
Likes endpoint summary
| Method | Path | Auth | Description |
|---|
POST | /api/v1/likes/video/:videoId | Required | Toggle like on a video |
POST | /api/v1/likes/comment/:commentId | Required | Toggle like on a comment |
POST | /api/v1/likes/tweet/:tweetId | Required | Toggle like on a tweet |
GET | /api/v1/likes/videos | Required | Get all videos liked by you |
Subscriptions
Subscriptions link a subscriber to a channel. The subscribe endpoint is a toggle: calling it when not subscribed creates the subscription, calling it again removes it. You cannot subscribe to your own channel.Subscribe or unsubscribe from a channel
curl -X POST https://vidtube-ke5w.onrender.com/api/v1/subscription/subscribe/64e0a1b2c3d4e5f6a7b8c9d0 \
-H "Authorization: Bearer <your_access_token>"
Subscribed response (HTTP 201):{
"statusCode": 201,
"data": {
"_id": "65d0e1f2a3b4c5d6e7f8a9b0",
"subscriber": "64e9f0a1b2c3d4e5f6a7b8c9",
"channel": "64e0a1b2c3d4e5f6a7b8c9d0",
"createdAt": "2024-09-01T17:00:00.000Z"
},
"message": "Channel subscribed successfully.",
"success": true
}
Unsubscribed response (HTTP 200):{
"statusCode": 200,
"data": { "deletedCount": 1 },
"message": "Channel unsubscribed successfully.",
"success": true
}
Get subscriber count for a channel
This endpoint is public — useful for displaying a subscriber count badge on a channel page.curl https://vidtube-ke5w.onrender.com/api/v1/subscription/channelSubscriberCount/64e0a1b2c3d4e5f6a7b8c9d0
{
"statusCode": 200,
"data": { "subscriberCount": 1024 },
"message": "Subscriber count fetched successfully.",
"success": true
}
Get channels you are subscribed to
You can only fetch subscriptions for the authenticated user — the subscriberId in the URL must match the logged-in user’s ID.curl "https://vidtube-ke5w.onrender.com/api/v1/subscription/subscribedChannels/64e9f0a1b2c3d4e5f6a7b8c9?page=1&limit=20" \
-H "Authorization: Bearer <your_access_token>"
{
"statusCode": 200,
"data": {
"totalCount": 5,
"page": 1,
"limit": 20,
"subscribers": [
{
"channel": {
"_id": "64e0a1b2c3d4e5f6a7b8c9d0",
"name": "Tech Channel",
"avatar": "https://res.cloudinary.com/..."
},
"createdAt": "2024-08-15T10:00:00.000Z"
}
]
},
"message": "Subscribed Channels fetched successfully.",
"success": true
}
Get subscribers of a channel
You can only view subscribers of your own channel — the channelId must match the authenticated user’s ID.curl "https://vidtube-ke5w.onrender.com/api/v1/subscription/channelSubscribers/64e0a1b2c3d4e5f6a7b8c9d0?page=1&limit=20" \
-H "Authorization: Bearer <your_access_token>"
Both paginated subscriber list endpoints support page (default 1) and limit (default 20, max 100) query parameters.Subscriptions endpoint summary
| Method | Path | Auth | Description |
|---|
POST | /api/v1/subscription/subscribe/:channelId | Required | Subscribe/unsubscribe (toggle) |
GET | /api/v1/subscription/channelSubscriberCount/:channelId | Public | Get subscriber count for a channel |
GET | /api/v1/subscription/subscribedChannels/:subscriberId | Required | Get channels you have subscribed to |
GET | /api/v1/subscription/channelSubscribers/:channelId | Required | Get all subscribers of your channel |