Retrieve Me
Retrieve information about the currently authenticated user.
HTTP Request
GET/api/users/me
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>"Status Codes
| Code | Description |
|---|---|
| 200 | User information retrieved successfully |
| 400 | Bad request — invalid parameters |
| 401 | Unauthorized — authentication required |
| 403 | Forbidden — insufficient permissions |
| 500 | Internal server error |
Response Fields
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the user. |
| username | String | Username of the user. |
| mobile_number | String | Mobile phone number of the user. |
| String | Email address of the user. | |
| avatar | String | URL to the user's avatar image. |
| first_name | String | First name of the user. |
| last_name | String | Last name of the user. |
| full_name | String | Full name (first + last name). |
| gender | String | Gender of the user. |
| 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. |
Example Response
{
"id": 42,
"username": "alex_thompson",
"mobile_number": "+1-555-0123",
"email": "alex.thompson@techcorp.com",
"avatar": "http://www.example.com/media/avatars/alex_profile.jpg",
"first_name": "Alex",
"last_name": "Thompson",
"full_name": "Alex Thompson",
"gender": "non-binary",
"groups": [1, 3, 7],
"last_login": "2025-08-06T14:23:45.123456Z",
"created_at": "2024-03-15T09:30:00.000000Z"
}
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.