curl --request POST \
--url https://api.example.com/api/profile/Retrieve the authenticated user profile information
curl --request POST \
--url https://api.example.com/api/profile/Documentation Index
Fetch the complete documentation index at: https://mintlify.com/edimez14/password_generator/llms.txt
Use this file to discover all available pages before exploring further.
Authorization: Bearer <access_token>
POST /api/profile/
| Header | Value | Required |
|---|---|---|
| Authorization | Bearer | Yes |
| Content-Type | application/json | Yes |
UsersSerializer:
{
"id": 1,
"username": "john_doe",
"email": "[email protected]",
"first_name": "John",
"last_name": "Doe",
"number_phone": "1234567890",
"avatar": "/media/avatars/profile.jpg",
"date_joined": "2024-01-15T10:30:00Z",
"last_login": "2024-03-10T14:20:00Z",
"is_active": true,
"is_staff": false,
"is_superuser": false
}
| Field | Type | Description |
|---|---|---|
| id | integer | Unique user identifier |
| username | string | User’s username (inherited from AbstractUser) |
| string | User’s email address (unique, max 200 chars) | |
| first_name | string | User’s first name (max 200 chars, optional) |
| last_name | string | User’s last name (max 200 chars, optional) |
| number_phone | string | User’s phone number (max 10 chars, optional) |
| avatar | string | URL path to user’s avatar image (optional) |
| date_joined | datetime | When the user account was created |
| last_login | datetime | Last login timestamp |
| is_active | boolean | Whether the user account is active |
| is_staff | boolean | Whether user has staff privileges |
| is_superuser | boolean | Whether user has superuser privileges |
{
"detail": "Authentication credentials were not provided."
}
{
"error": "The user cannot be found in the database."
}
{
"error": "Error message details"
}
curl -X POST https://api.example.com/api/profile/ \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
-H "Content-Type: application/json"
{
"id": 42,
"username": "alice_wonder",
"email": "[email protected]",
"first_name": "Alice",
"last_name": "Wonder",
"number_phone": "5551234567",
"avatar": "/media/avatars/alice.png",
"date_joined": "2024-02-01T08:15:30Z",
"last_login": "2024-03-10T11:45:22Z",
"is_active": true,
"is_staff": false,
"is_superuser": false
}
/apps/users/views.py:84 as the profile function view:
@permission_classes([IsAuthenticated]) to require authenticationUsersSerializer to serialize the user data from request.user