Kullanıcı Listesi
Kullanıcı listesini getirir (pagination, filtreleme, arama).
Endpoint
GET /api/v1/users
Authentication
Bu endpoint authentication gerektirir.
Header: Authorization: Bearer \{token\}
Permission
users.view- Tüm kullanıcıları görüntülemeusers.view.own- Sadece kendi profilini görüntüleme
Request
Headers
| Header | Değer | Zorunlu |
|---|---|---|
Authorization | Bearer \{token\} | Evet |
Query Parameters
| Parametre | Tip | Zorunlu | Açıklama |
|---|---|---|---|
search | string | Hayır | Genel arama (email, UUID) |
is_active | boolean | Hayır | Aktif/pasif filtresi |
role | string | Hayır | Rol slug'ı ile filtreleme |
with_trashed | boolean | Hayır | Silinen kayıtları dahil et |
per_page | integer | Hayır | Sayfa başına kayıt (varsayılan: 15, max: 100) |
page | integer | Hayır | Sayfa numarası (varsayılan: 1) |
Response
Success Response (200 OK)
{
"data": [
{
"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"
}
],
"links": {
"first": "http://api.example.com/api/v1/users?page=1",
"last": "http://api.example.com/api/v1/users?page=7",
"prev": null,
"next": "http://api.example.com/api/v1/users?page=2"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 7,
"per_page": 15,
"to": 15,
"total": 100
}
}
Code Examples
cURL
curl -X GET "https://api.example.com/api/v1/users?search=mail@example.com&per_page=20" \
-H "Authorization: Bearer \{token\}"
JavaScript (Fetch)
const response = await fetch('https://api.example.com/api/v1/users?search=mail&per_page=20', {
method: 'GET',
headers: {
'Authorization': `Bearer ${token}`,
},
});
const data = await response.json();
console.log(data.data); // Kullanıcı listesi
console.log(data.meta.total); // Toplam kayıt sayısı
Notes
.ownpermission'ı olan kullanıcılar sadece kendi profilini görür- Silinen kayıtlar varsayılan olarak filtrelenir (
with_trashed=trueile görülebilir)
Related Endpoints
- Create User - Yeni kullanıcı oluştur
- User Detail - Kullanıcı detayı