Welcome! Use this page to test and understand the API routes. For every route marked Auth Required, send the header Authorization: Bearer <token>.
POST/api/auth/register Public
Register a new user.
{
"email": "user@example.com",
"username": "newuser",
"password": "strongPassword123"
}
POST/api/auth/login Public
Login using email or username with password.
{
"email": "user@example.com",
"password": "strongPassword123"
}
POST/api/auth/forget Public
Reset password (email and username must match an existing user).
{
"email": "user@example.com",
"username": "newuser",
"password": "newPassword123"
}
POST/api/user/pfp Auth Required
Upload a profile image. Use multipart/form-data with the field image-file.
DELETE/api/user/pfp Auth Required
Remove the profile image. No request body is required.
PATCH/api/user Auth Required
Update user details (partial body is allowed).
{
"name": "New Name",
"bio": "Hello world",
"username": "updatedUsername"
}
GET/api/post Auth Required
Fetch all posts created by the authenticated user. No request body is required.
POST/api/post Auth Required
Create a new post using multipart/form-data:
image-file (required)caption (optional)DELETE/api/post/:postId Auth Required
Delete your own post using URL parameter postId. No request body is required.
POST/comment/newComment Auth Required
Add a comment to a post.
{
"postId": "",
"text": "Nice post!"
}
GET/comment/:postId Auth Required
Fetch comments for a specific post.
DELETE/comment/:commentId Auth Required
Delete a comment. This controller reads data from body:
{
"commentId": "",
"postId": ""
}
POST/api/like/post/:postId Auth Required
Toggle like/unlike for a post. No request body is required.