Skip to content

Latest commit

 

History

History
80 lines (63 loc) · 1.09 KB

deleteProfilePic.md

File metadata and controls

80 lines (63 loc) · 1.09 KB

Delete profile Picture

reset to default profile picture

URL : /api/user/profile-pic

METHOD : DELETE

Auth required : YES

Headers:

{
  "Auth": "<BEARER>__<TOKEN>"
}

Success Response:

code : 201

{
    "status": "success",
    "message": "Profile picture deleted successfully",
    "data": {
        "user": {
            "profilePic": {
                "secure_url": "...",
                "public_id": null
            },
            "_id": "656792084cd8dd1ef2501489",
            "userName": "yhya101",
            "email": "yhya@email.com",
            "updatedAt": "2023-11-29T22:28:22.329Z"
        }
    }
}

Fail Response:

code : 400

{
  "status": "fail",
  "code": 401,
  "message": "No custom profile picture to delete"
}

code : 401

{
  "status": "fail",
  "code": 401,
  "message": "Invalid Token"
}
{
  "status": "fail",
  "code": 401,
  "message": " Token Is Required"
}

code : 404

{
  "status": "fail",
  "code": 404,
  "message": "User Not Found"
}