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.

Tweets on VidTube are short text posts tied to a user’s channel — similar to YouTube’s Community posts. Any user can post tweets, list another user’s tweets, and manage their own. Reading tweets is public; creating, updating, and deleting require authentication.

GET /api/v1/tweets/getUserTweets/:userId

List all tweets posted by a specific user.
userId
string
required
MongoDB ObjectId of the user whose tweets to fetch.
curl https://vidtube-ke5w.onrender.com/api/v1/tweets/getUserTweets/664usr789...
Response (200)
{
  "statusCode": 200,
  "data": [
    {
      "_id": "664twt001...",
      "content": "Just uploaded a new video! Check it out.",
      "owner": "664usr789...",
      "createdAt": "2024-05-01T15:00:00.000Z"
    }
  ],
  "message": "Tweet fetched successfully.",
  "success": true
}
Error codes: 400 (missing userId), 404 (no tweets found for this user)

POST /api/v1/tweets/createTweet

Protected — requires Authorization: Bearer <accessToken>
Create a new tweet on your channel.
content
string
required
Text content of the tweet. Cannot be blank.
curl -X POST https://vidtube-ke5w.onrender.com/api/v1/tweets/createTweet \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"content":"New video dropping this Friday!"}'
Response (200)
{
  "statusCode": 200,
  "data": {
    "_id": "664twt002...",
    "content": "New video dropping this Friday!",
    "owner": "664usr789...",
    "createdAt": "2024-05-02T10:00:00.000Z"
  },
  "message": "Tweet created successfully.",
  "success": true
}
Error codes: 400 (missing or blank content), 500 (creation failed)

PATCH /api/v1/tweets/updateTweet/:tweetId

Protected — requires Authorization: Bearer <accessToken>
Update the content of an existing tweet.
tweetId
string
required
MongoDB ObjectId of the tweet to update.
content
string
required
New text content for the tweet. Cannot be blank.
curl -X PATCH https://vidtube-ke5w.onrender.com/api/v1/tweets/updateTweet/664twt002... \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"content":"Video is now live — go watch it!"}'
Response (200) — returns the updated tweet document. Error codes: 400 (missing tweetId or blank content, tweet doesn’t exist)

DELETE /api/v1/tweets/deleteTweet/:tweetId

Protected — requires Authorization: Bearer <accessToken>
Delete a tweet by its ID.
tweetId
string
required
MongoDB ObjectId of the tweet to delete.
curl -X DELETE https://vidtube-ke5w.onrender.com/api/v1/tweets/deleteTweet/664twt002... \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Response (200) — returns the deletion result. Error codes: 400 (missing tweetId, tweet doesn’t exist)

Build docs developers (and LLMs) love