Skip to main content

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

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())

Status Codes

CodeDescription
200User information retrieved successfully
400Bad request — invalid parameters
401Unauthorized — authentication required
403Forbidden — insufficient permissions
500Internal server error

Response Fields

FieldTypeDescription
idIntegerUnique ID of the user.
usernameStringUsername of the user.
mobile_numberStringMobile phone number of the user.
emailStringEmail address of the user.
avatarStringURL to the user's avatar image.
first_nameStringFirst name of the user.
last_nameStringLast name of the user.
full_nameStringFull name (first + last name).
genderStringGender of the user.
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.

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_name field is automatically generated from first_name and last_name.
  • The groups array contains group IDs, not group objects.