Ana içeriğe geç

Me

Oturum açmış kullanıcının bilgilerini getirir.

Endpoint

GET /api/v1/auth/me

Authentication

Bu endpoint authentication gerektirir.

Header: Authorization: Bearer \{token\}

Request

Headers

HeaderDeğerZorunlu
AuthorizationBearer \{token\}Evet

Request Body

Yok

Response

Success Response (200 OK)

{
"id": 1,
"uuid": "550e8400-e29b-41d4-a716-446655440000",
"email": "user@example.com",
"is_active": true,
"created_at": "2025-11-20T12:00:00.000000Z",
"updated_at": "2025-11-20T12:00:00.000000Z",
"detail": {
"id": 1,
"user_id": 1,
"first_name": "John",
"last_name": "Doe",
"phone": "+90 555 000 00 00",
"country": "TR",
"city": "Istanbul",
"address": "Example Street 123",
"is_active": true
},
"setting": {
"id": 1,
"user_id": 1,
"locale": "tr",
"timezone": "Europe/Istanbul",
"date_format": "d/m/Y",
"time_format": "H:i",
"currency_id": 1,
"country_code": "TR",
"theme": "light",
"items_per_page": 15,
"currency": {
"id": 1,
"code": "TRY",
"name": "Turkish Lira",
"symbol": "₺"
}
},
"roles": [
{
"id": 1,
"name": "Super Admin",
"slug": "mgmt.superadmin",
"priority": 10,
"permissions": [...]
}
]
}

Error Responses

401 Unauthorized

{
"message": "Unauthenticated"
}

Code Examples

cURL

curl -X GET https://api.example.com/api/v1/auth/me \
-H "Authorization: Bearer \{token\}"

JavaScript (Fetch)

const response = await fetch('https://api.example.com/api/v1/auth/me', {
method: 'GET',
headers: {
'Authorization': `Bearer ${token}`,
},
});

const user = await response.json();
console.log(user.email);

Notes

  • Kullanıcı bilgileri ile birlikte detail, setting, roles ve permissions ilişkileri de döner
  • setting.currency ilişkisi otomatik olarak yüklenir
  • Pasif kullanıcılar bu endpoint'e erişemez