Skip to main content

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üleme
  • users.view.own - Sadece kendi profilini görüntüleme

Request

Headers

HeaderDeğerZorunlu
AuthorizationBearer \{token\}Evet

Query Parameters

ParametreTipZorunluAçıklama
searchstringHayırGenel arama (email, UUID)
is_activebooleanHayırAktif/pasif filtresi
rolestringHayırRol slug'ı ile filtreleme
with_trashedbooleanHayırSilinen kayıtları dahil et
per_pageintegerHayırSayfa başına kayıt (varsayılan: 15, max: 100)
pageintegerHayırSayfa 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

  • .own permission'ı olan kullanıcılar sadece kendi profilini görür
  • Silinen kayıtlar varsayılan olarak filtrelenir (with_trashed=true ile görülebilir)