POST /auth/register
Content-Type: application/json
{
"name" : " string" ,
"email" : " string" ,
"password" : " string"
}
Success Response (201 Created)
{
"status" : " success" ,
"data" : {
"token" : " jwt_token_string" ,
"user" : {
"id" : " user_id" ,
"name" : " user_name" ,
"email" : " user_email"
}
}
}
POST /auth/verify-email
Content-Type: application/json
{
"email" : " string" ,
"verificationCode" : " string"
}
Success Response (200 OK)
{
"status" : " success" ,
"message" : " Email verified successfully"
}
POST /auth/resend-verification-code
Content-Type: application/json
Success Response (200 OK)
{
"status" : " success" ,
"message" : " Verification code sent successfully"
}
POST /auth/login
Content-Type: application/json
{
"email" : " string" ,
"password" : " string"
}
Success Response (200 OK)
{
"status" : " success" ,
"data" : {
"token" : " jwt_token_string" ,
"user" : {
"id" : " user_id" ,
"name" : " user_name" ,
"email" : " user_email"
}
}
}
POST /auth/change-password
Authorization: Bearer <token>
Content-Type: application/json
{
"oldPassword" : " string" ,
"newPassword" : " string"
}
Success Response (200 OK)
{
"status" : " success" ,
"message" : " Password updated successfully"
}
POST /auth/forgot-password
Content-Type: application/json
Success Response (200 OK)
{
"status" : " success" ,
"message" : " Password reset instructions sent to email"
}
POST /auth/reset-password
Content-Type: application/json
{
"token" : " string" ,
"newPassword" : " string"
}
Success Response (200 OK)
{
"status" : " success" ,
"message" : " Password reset successfully"
}
POST /auth/logout
Authorization: Bearer <token>
Success Response (200 OK)
{
"status" : " success" ,
"message" : " Logged out successfully"
}
POST /auth/logout-all
Authorization: Bearer <token>
Success Response (200 OK)
{
"status" : " success" ,
"message" : " Logged out from all devices"
}
GET /user/profile
Authorization: Bearer <token>
Success Response (200 OK)
{
"status" : " success" ,
"data" : {
"user" : {
"id" : " user_id" ,
"name" : " string" ,
"email" : " string" ,
"hobbies" : [" string" ],
"dateOfBirth" : " string" ,
"location" : {
"type" : " Point" ,
"coordinates" : [number, number ]
},
"academicQualification" : [
{
"passedYear" : " number" ,
"degreeName" : " string"
}
],
"followers" : [" user_id" ],
"following" : [" user_id" ]
}
}
}
PUT /user/hobbies
Authorization: Bearer <token>
Content-Type: application/json
{
"hobbies" : [" string" ]
}
Success Response (200 OK)
{
"status" : " success" ,
"data" : {
"hobbies" : [" string" ]
}
}
DELETE /user/hobbies
Authorization: Bearer <token>
Content-Type: application/json
Success Response (200 OK)
{
"status" : " success" ,
"message" : " Hobby deleted successfully"
}
Update Academic Qualifications
PUT /user/academic-qualification
Authorization: Bearer <token>
Content-Type: application/json
{
"academicQualification" : [
{
"passedYear" : " number" ,
"degreeName" : " string"
}
]
}
Success Response (200 OK)
{
"status" : " success" ,
"data" : {
"academicQualification" : [
{
"passedYear" : " number" ,
"degreeName" : " string"
}
]
}
}
Delete Academic Qualification
DELETE /user/academic-qualification
Authorization: Bearer <token>
Content-Type: application/json
{
"qualificationId" : " string"
}
Success Response (200 OK)
{
"status" : " success" ,
"message" : " Academic qualification deleted successfully"
}
PUT /user/date-of-birth
Authorization: Bearer <token>
Content-Type: application/json
{
"dateOfBirth" : " YYYY-MM-DD"
}
Success Response (200 OK)
{
"status" : " success" ,
"data" : {
"dateOfBirth" : " YYYY-MM-DD"
}
}
PUT /user/location
Authorization: Bearer <token>
Content-Type: application/json
{
"location" : {
"type" : " Point" ,
"coordinates" : [number, number ]
}
}
Success Response (200 OK)
{
"status" : " success" ,
"data" : {
"location" : {
"type" : " Point" ,
"coordinates" : [number, number ]
}
}
}
GET /user/followers
Authorization: Bearer <token>
Success Response (200 OK)
{
"status" : " success" ,
"data" : {
"followers" : [
{
"id" : " user_id" ,
"name" : " string" ,
"email" : " string"
}
]
}
}
GET /user/following
Authorization: Bearer <token>
Success Response (200 OK)
{
"status" : " success" ,
"data" : {
"following" : [
{
"id" : " user_id" ,
"name" : " string" ,
"email" : " string"
}
]
}
}
POST /user/follow
Authorization: Bearer <token>
Content-Type: application/json
{
"followUserId" : " string"
}
Success Response (200 OK)
{
"status" : " success" ,
"message" : " User followed successfully"
}
POST /user/unfollow
Authorization: Bearer <token>
Content-Type: application/json
{
"unfollowUserId" : " string"
}
Success Response (200 OK)
{
"status" : " success" ,
"message" : " User unfollowed successfully"
}
POST /posts/uploadpost
Authorization: Bearer <token>
Content-Type: multipart/form-data
title: string
content: string
image: File (optional)
Success Response (201 Created)
{
"status" : " success" ,
"data" : {
"post" : {
"id" : " post_id" ,
"title" : " string" ,
"content" : " string" ,
"image" : " string" ,
"author" : {
"id" : " user_id" ,
"name" : " string"
},
"likesCounter" : 0 ,
"createdAt" : " datetime" ,
"updatedAt" : " datetime"
}
}
}
GET /posts/getposts?page=1&limit=10
Authorization: Bearer <token>
page (default: 1)
limit (default: 10)
Success Response (200 OK)
{
"status" : " success" ,
"data" : {
"posts" : [
{
"id" : " post_id" ,
"title" : " string" ,
"content" : " string" ,
"image" : " string" ,
"author" : {
"id" : " user_id" ,
"name" : " string"
},
"likesCounter" : " number" ,
"createdAt" : " datetime" ,
"updatedAt" : " datetime"
}
],
"pagination" : {
"currentPage" : " number" ,
"totalPages" : " number" ,
"totalPosts" : " number"
}
}
}
GET /posts/showfeed?page=1&limit=10
Authorization: Bearer <token>
page (default: 1)
limit (default: 10)
Success Response (200 OK)
{
"status" : " success" ,
"data" : {
"posts" : [
{
"id" : " post_id" ,
"title" : " string" ,
"content" : " string" ,
"image" : " string" ,
"author" : {
"id" : " user_id" ,
"name" : " string"
},
"likesCounter" : " number" ,
"createdAt" : " datetime" ,
"updatedAt" : " datetime"
}
],
"pagination" : {
"currentPage" : " number" ,
"totalPages" : " number" ,
"totalPosts" : " number"
}
}
}
GET /posts/postbyid/:id
Authorization: Bearer <token>
Success Response (200 OK)
{
"status" : " success" ,
"data" : {
"post" : {
"id" : " post_id" ,
"title" : " string" ,
"content" : " string" ,
"image" : " string" ,
"author" : {
"id" : " user_id" ,
"name" : " string"
},
"likesCounter" : " number" ,
"createdAt" : " datetime" ,
"updatedAt" : " datetime"
}
}
}
PUT /posts/updatepost/:id
Authorization: Bearer <token>
Content-Type: multipart/form-data
title: string
content: string
image: File (optional)
Success Response (200 OK)
{
"status" : " success" ,
"data" : {
"post" : {
"id" : " post_id" ,
"title" : " string" ,
"content" : " string" ,
"image" : " string" ,
"author" : {
"id" : " user_id" ,
"name" : " string"
},
"likesCounter" : " number" ,
"createdAt" : " datetime" ,
"updatedAt" : " datetime"
}
}
}
DELETE /posts/deletepost/:id
Authorization: Bearer <token>
Success Response (200 OK)
{
"status" : " success" ,
"message" : " Post deleted successfully"
}
POST /posts/likepost
Authorization: Bearer <token>
Content-Type: application/json
Success Response (200 OK)
{
"status" : " success" ,
"message" : " Post liked/unliked successfully" ,
"data" : {
"likesCounter" : " number"
}
}
Comments
Add Comment
POST /comment/add
Authorization: Bearer <token>
Content-Type: application/json
{
"postId" : " string" ,
"content" : " string"
}
Success Response (201 Created)
{
"status" : " success" ,
"data" : {
"comment" : {
"id" : " comment_id" ,
"content" : " string" ,
"author" : {
"id" : " user_id" ,
"name" : " string"
},
"post" : " post_id" ,
"createdAt" : " datetime"
}
}
}
Update Comment
PUT /comment/update
Authorization: Bearer <token>
Content-Type: application/json
{
"commentId" : " string" ,
"content" : " string"
}
Success Response (200 OK)
{
"status" : " success" ,
"data" : {
"comment" : {
"id" : " comment_id" ,
"content" : " string" ,
"author" : {
"id" : " user_id" ,
"name" : " string"
},
"post" : " post_id" ,
"createdAt" : " datetime" ,
"updatedAt" : " datetime"
}
}
}
Delete Comment
DELETE /comment/delete
Authorization: Bearer <token>
Content-Type: application/json
{
"commentId" : " string"
}
Success Response (200 OK)
{
"status" : " success" ,
"message" : " Comment deleted successfully"
}
Get Post Comments
GET /posts/postcomments/:postId?page=1&limit=10
Authorization: Bearer <token>
page (default: 1)
limit (default: 10)
Success Response (200 OK)
{
"status" : " success" ,
"data" : {
"comments" : [
{
"id" : " comment_id" ,
"content" : " string" ,
"author" : {
"id" : " user_id" ,
"name" : " string"
},
"createdAt" : " datetime"
}
],
"pagination" : {
"currentPage" : " number" ,
"totalPages" : " number" ,
"totalComments" : " number"
}
}
}
{
"status" : " error" ,
"code" : 422 ,
"message" : " Validation failed" ,
"errors" : {
"field" : " error message"
}
}
Authentication Error (401)
{
"status" : " error" ,
"code" : 401 ,
"message" : " Invalid token or unauthorized"
}
{
"status" : " error" ,
"code" : 404 ,
"message" : " Resource not found"
}
{
"status" : " error" ,
"code" : 500 ,
"message" : " Internal server error"
}