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
- 🐍 Python
- 🌐 Curl
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())1curl "http://www.example.com/api/users/me" -H "Authorization: Token <your_api_key>"Response Fields
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the user. |
| username | String | profile username(unique, nullable) |
| mobile_number | String | Mobile number of the user (unique, nullable) |
| String | Email address of the user (unique, nullable) | |
| avatar | String | URL to the user's avatar image(nullable) |
| first_name | String | First name of the user(nullable) |
| last_name | String | Last name of the user(nullable) |
| full_name | String | Full name (nullable). |
| gender | String | Gender of the user (Male, Female, Other) |
| is_profile_compeleted | Boolean | Defines if user profile information are complete |
| groups | Array | Array of group IDs the user belongs to. |
| last_login | String (ISO 8601) | Timestamp of the user's last login. |
| created_at | String (ISO 8601) | Timestamp when the user was created. |
Group Object Fields
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique id of the group |
| name | String | Name of the group |
| notes | String | Description of the group |
| users_count | Integer | Current number of the users in the group |
| created_at | Datetime | Creation time of the group |
| updated_at | Datetime | Last 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_namefield is automatically generated fromfirst_nameandlast_name. - The
groupsarray contains group IDs, not group objects.