Skip to main content

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
}

Like or unlike a comment

curl -X POST https://vidtube-ke5w.onrender.com/api/v1/likes/comment/65b0c1d2e3f4a5b6c7d8e9f0 \
  -H "Authorization: Bearer <your_access_token>"

Like or unlike a tweet

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

MethodPathAuthDescription
POST/api/v1/likes/video/:videoIdRequiredToggle like on a video
POST/api/v1/likes/comment/:commentIdRequiredToggle like on a comment
POST/api/v1/likes/tweet/:tweetIdRequiredToggle like on a tweet
GET/api/v1/likes/videosRequiredGet all videos liked by you

Build docs developers (and LLMs) love