Administrator Profile and Sessions API
Base URL: http://localhost:8000/api/v1
Prefix: /accounts/admins
Auth: Administrator JWT bearer token
Headers: Content-Type: application/json
The current admin API does not implement
DELETE /me/. Account deactivation is not available in the Admin Profile routes.
1. Get Profile
Retrieves the authenticated administrator profile.
/accounts/admins/me/Auth: Required
Headers
Authorization: Bearer {{access_token}}Success Example
{
"success": true,
"message": "",
"data": {
"admin": {
"id": "d1c7f5a2-6e44-4e1d-9c1a-8f2b31b7a901",
"full_name": "Platform Administrator",
"email": "admin@example.com",
"phone": "+15125550103",
"avatar_url": "",
"avatar_upload_id": null,
"bio": "",
"roles": [
"admin"
],
"status": "active",
"is_active": true,
"is_staff": true,
"is_superuser": true
}
}
}Notes
-
Requires an authenticated active administrator account.
-
The response excludes the password.
2. Update Profile
Updates the authenticated administrator profile.
/accounts/admins/me/Auth: Required
Headers
Authorization: Bearer {{access_token}}Request Body
{
"full_name": "Updated Platform Administrator",
"phone": "+15125550103",
"avatar_upload_id": "59ed7663-357f-402f-b414-27d7f3b12e87",
"bio": "EstateHub platform administrator."
}Success Example
{
"success": true,
"message": "Admin profile updated successfully.",
"data": {
"admin": {
"id": "d1c7f5a2-6e44-4e1d-9c1a-8f2b31b7a901",
"full_name": "Updated Platform Administrator",
"email": "admin@example.com",
"phone": "+15125550103",
"avatar_url": "http://localhost:8000/api/v1/uploads/59ed7663-357f-402f-b414-27d7f3b12e87/content/",
"avatar_upload_id": "59ed7663-357f-402f-b414-27d7f3b12e87",
"bio": "EstateHub platform administrator.",
"roles": [
"admin"
],
"status": "active",
"is_active": true,
"is_staff": true,
"is_superuser": true
}
}
}Notes
-
All body fields are optional.
-
Allowed fields are
full_name,phone,avatar_upload_id, andbio. -
Send a completed managed upload ID, not a storage URL.
-
Phone numbers must be unique.
-
Set
avatar_upload_idtonullto remove the current avatar.
3. Get Security Information
Retrieves administrator security and authentication details.
/accounts/admins/me/security/Auth: Required
Headers
Authorization: Bearer {{access_token}}Success Example
{
"success": true,
"message": "",
"data": {
"security": {
"email": "admin@example.com",
"phone": "+15125550103",
"is_email_verified": true,
"is_phone_verified": false,
"has_password": true,
"active_session_count": 2,
"last_login": "2026-10-06T09:30:00Z",
"date_joined": "2026-08-01T10:00:00Z",
"social_accounts": []
}
}
}Notes
-
social_accountsmay be an empty array. -
active_session_countincludes all non-revoked sessions.
4. List Sessions
Lists all active administrator sessions.
/accounts/admins/me/sessions/Auth: Required
Headers
Authorization: Bearer {{access_token}}Success Example
{
"success": true,
"message": "",
"data": {
"sessions": [
{
"id": 12,
"jti": "6f1f0c55-ccf5-4e54-9d2c-45e1b7c0d0c1",
"ip_address": "192.168.1.20",
"user_agent": "Mozilla/5.0",
"created_at": "2026-10-06T09:00:00Z",
"last_active_at": "2026-10-06T09:30:00Z",
"expires_at": "2026-10-13T09:00:00Z",
"is_current": true
}
]
}
}Notes
-
Only active, non-revoked sessions are returned.
-
is_currentidentifies the session used for the current request.
5. Revoke Session
Revokes one active administrator session.
/accounts/admins/me/sessions/{session_id}/Auth: Required
Headers
Authorization: Bearer {{access_token}}Success Example
{
"success": true,
"message": "Session revoked successfully.",
"data": {}
}Notes
-
is the numeric session ID returned by the list sessions endpoint.
-
Only sessions owned by the authenticated administrator can be revoked.
-
Unknown or already revoked sessions return
Session not found.
Common Success Format
{
"success": true,
"message": "Operation completed successfully.",
"data": {}
}Common Error Format
{
"success": false,
"message": "Validation failed.",
"errors": {
"field_name": [
"Error message."
]
}
}