# Get User api returns users we didn't created

**URL:** <https://forum.keycloak.org/t/get-user-api-returns-users-we-didnt-created/16589>\
**Category:** Getting advice\
**Created:** [July 24, 2022, 7:43am UTC](https://forum.keycloak.org/t/get-user-api-returns-users-we-didnt-created/16589 "2022-07-24T07:43:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![amir](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@amir](https://forum.keycloak.org/u/amir)\
**Post date:** [July 24, 2022, 7:43am UTC](https://forum.keycloak.org/t/get-user-api-returns-users-we-didnt-created/16589/1 "2022-07-24T07:43:22Z")

</div>

Hi all,  
we are using the Admin Rest API to get a list of users for a realm.  
for some reason when using a query parameter of “username” the result we are getting are incorrect

when accessing the admin console we get this user when pressing “view all users”

![image](https://global.discourse-cdn.com/free1/uploads/keycloak/original/2X/8/8a14c0865617ed95fa697df8839ca2223202a649.png)

and when sending a “GetUsers” request with no query parameters we are getting the same results  
(https://[KC\_API\_URL]/admin/realms/[realm\_name]/users)

But, when adding a query parameter like this:  
https://[KC\_API\_URL]/admin/realms/[realm\_name]/users?username=ale  
we get this result:

[  
{  
“id”: “296b6c46-1864-4284-860b-3521a7a8cc9d”,  
“createdTimestamp”: 1604216553710,  
“username”: “service-account-alertsservice”,  
“enabled”: true,  
“totp”: false,  
“emailVerified”: false,  
“disableableCredentialTypes”: ,  
“requiredActions”: ,  
“notBefore”: 0,  
“access”: {  
“manageGroupMembership”: true,  
“view”: true,  
“mapRoles”: true,  
“impersonate”: true,  
“manage”: true  
}  
}  
]

we have a client named “AlertsService” and when inspecting the DB I do see that for every client that we are adding KC creates a user entity with a user name: service-account-[clientName] (in my case “service-account-alertsservice”)

1. Is this a normal behavior?
2. how can we filter results like this from “Users” GET results?
3. Why when we send a GET request with no query parameters we don’t get that user? - seems like inconsistent behavior

thanks!
