Skip to main content

Retrieve Me

Retrieve profile information of the current authenticated user.

HTTP Request

GET/api/users/me
NOTE: NOT USING THE TRAILING SLASH AT THE END OF THE URL RESULTS TO AN EXTRA REDIRECT WITH 301 STATUS

Authorization

Authorization

  • Required: Yes
  • Permission: Staff or Admin
  • Authentication: Token-based (Authorization: Token <your_api_key>)

Example Requests

1import requests
2
3api = requests.Session()
4api.headers.update({'Authorization': 'Token f4e75eab6e0f663a972d145478d6fc4b81762070'})
5response = api.get('http://www.example.com/api/users/me/')
6print(response.json())

Response Fields

FieldTypeDescription
idIntegerUnique ID of the user.
usernameStringprofile username(unique, nullable)
mobile_numberStringMobile number of the user (unique, nullable)
emailStringEmail address of the user (unique, nullable)
avatarStringURL to the user's avatar image(nullable)
first_nameStringFirst name of the user(nullable)
last_nameStringLast name of the user(nullable)
full_nameStringFull name (nullable).
genderStringGender of the user (Male, Female, Other)
is_profile_compeletedBooleanDefines if user profile information are complete
groupsArrayArray of group IDs the user belongs to.
last_loginString (ISO 8601)Timestamp of the user's last login.
created_atString (ISO 8601)Timestamp when the user was created.

Group Object Fields

FieldTypeDescription
idIntegerUnique id of the group
nameStringName of the group
notesStringDescription of the group
users_countIntegerCurrent number of the users in the group
created_atDatetimeCreation time of the group
updated_atDatetimeLast updated time of the group

Example Response

{
"id": 1,
"username": "MasterAdmin",
"mobile_number": "09123456798",
"email": "jackdonavan@hotmail.com",
"avatar": "http://127.0.0.1:8000/media/users/avatars/photo22132188258.jpg",
"first_name": "بهروز",
"last_name": "قربانی",
"full_name": "بهروز قربانی",
"gender": "male",
"is_profile_completed": true,
"groups": [
{
"id": 1,
"name": "Administrators",
"notes": "All system administrators with full permissions",
"users_count": 1,
"created_at": "2025-11-22T13:07:28.186722Z",
"updated_at": "2025-11-22T13:07:28.186728Z"
}
],
"last_login": "2025-11-28T18:20:10.269466Z",
"created_at": "2025-11-22T13:15:20.827325Z"
}

Notes

  • Only authenticated users can access their own profile.
  • The full_name field is automatically generated from first_name and last_name.
  • The groups array contains group IDs, not group objects.