Profile Management API
This API provides endpoints to manage user profiles, including viewing, updating, and deleting profiles.
1. Get Profile Details
Endpoint: api/v1/accounts/profile/
Method: GET
Permissions: IsAuthenticated
Retrieves the profile details of the authenticated user.
Response Payload (Success)
{
"user": {
"id": 123,
"email": "user@example.com",
"first_name": "John",
"last_name": "Doe"
},
"photo": "http://domain.com/media/accounts/photos/johndoe.jpg"
}
2. Update Profile
Endpoint: api/v1/accounts/profile/
Method: PATCH
Permissions: IsAuthenticated
Updates the user's profile. Supports photo upload and removal.
Request Payload
{
"first_name": "Jane",
"photo": "<binary-file-content>"
}
Response Payload (Success)
{
"message": "Profile Updated Successfully",
"data": {
"first_name": "Jane",
"photo": "http://example.com/media/photos/janedoe.jpg"
}
}
3. Delete Profile (Deactivate Account)
Endpoint: api/v1/accounts/profile/
Method: DELETE
Permissions: IsAuthenticated
Deactivates the user's account.
Response Payload (Success)
{
"message": "Account deactivated successfully"
}