The Users API covers the full user lifecycle — from creating an account and authenticating, to updating your profile details and retrieving your personal watch history. Most endpoints require a valid JWT access token passed as aDocumentation 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.
Bearer header.
POST /api/v1/users/register
Register a new user account. Send asmultipart/form-data because avatar upload is required.
Unique username (stored lowercase).
Unique email address.
Account password (hashed with bcrypt before storage).
Display name for the user.
Profile picture. Uploaded to Cloudinary.
Optional channel cover image. Uploaded to Cloudinary.
400 (missing required fields, user already exists, missing avatar), 500 (Cloudinary upload failed)
POST /api/v1/users/login
Log in with email and username. Returns access and refresh tokens, and sets httpOnly cookies.Registered email address.
Registered username.
Account password.
The response also sets
accessToken and refreshToken as httpOnly cookies, so browser clients authenticate automatically on subsequent requests.400 (missing fields), 401 (invalid credentials), 404 (user not found)
POST /api/v1/users/logout
Protected — requires
Authorization: Bearer <accessToken>accessToken and refreshToken cookies and invalidates the refresh token in the database.
POST /api/v1/users/refresh-Token
Exchange a refresh token for a new access/refresh token pair. The refresh token can be sent in the cookie (browser clients) or in the request body.Refresh token. Optional if the
refreshToken cookie is set.accessToken and refreshToken, and sets new cookies.
Error codes: 401 (missing, invalid, or mismatched refresh token), 500
GET /api/v1/users/current-user
Protected — requires
Authorization: Bearer <accessToken>password and refreshToken).
PATCH /api/v1/users/update-account
Protected — requires
Authorization: Bearer <accessToken>fullname and email.
New display name.
New email address.
400 (missing fullname or email), 401
PATCH /api/v1/users/update-avatar
Protected — requires
Authorization: Bearer <accessToken>multipart/form-data.
New avatar image file. Uploaded to Cloudinary.
400 (missing file), 500 (upload failed)
GET /api/v1/users/history
Protected — requires
Authorization: Bearer <accessToken>fullname, username, and avatar.
POST /api/v1/users/change-password
Protected — requires
Authorization: Bearer <accessToken>The user’s current password.
The new password to set.
401 (incorrect old password), 401 (not authenticated)
PATCH /api/v1/users/update-cover
Protected — requires
Authorization: Bearer <accessToken>multipart/form-data.
New cover image file. Uploaded to Cloudinary.
400 (missing file), 500 (upload failed)
GET /api/v1/users/c/:username
Protected — requires
Authorization: Bearer <accessToken>The channel’s username (case-insensitive).
401 (username missing or not authenticated), 404 (channel not found)