# Unable to limit Get User list

**URL:** <https://devforum.okta.com/t/unable-to-limit-get-user-list/5864>\
**Category:** Questions\
**Created:** [August 5, 2019, 11:57am UTC](https://devforum.okta.com/t/unable-to-limit-get-user-list/5864 "2019-08-05T11:57:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![monalizende](https://avatars.discourse-cdn.com/v4/letter/m/47e85d/32.png) [@monalizende](https://devforum.okta.com/u/monalizende)\
**Post date:** [August 5, 2019, 11:57am UTC](https://devforum.okta.com/t/unable-to-limit-get-user-list/5864/1 "2019-08-05T11:57:27Z")

</div>

Hi,

I am using @okta/okta-sdk-nodejs (documentation : [https://www.npmjs.com/package/@okta/okta-sdk-nodejs](https://www.npmjs.com/package/@okta/okta-sdk-nodejs)) module to access Okta APIs.  
I am trying to add limit to query parameter, but unable to do so.  
Here is the snippet

client.listUsers({  
search: ‘profile.nickName eq “abc 1234”’,  
limit : 5  
})

Can anyone help ? Its urgent.

---

<div class="post-metadata">

**Author:** ![dragos](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/dragos/32/1313_2.png) [@dragos](https://devforum.okta.com/u/dragos)\
**Post date:** [August 5, 2019, 11:57pm UTC](https://devforum.okta.com/t/unable-to-limit-get-user-list/5864/2 "2019-08-05T23:57:47Z")

</div>

Hi @monalizende

I’ve tested now on my end using the following script.

```auto
const okta = require('@okta/okta-sdk-nodejs');
 
const client = new okta.Client({
  orgUrl: 'https://org.oktapreview.com',
  token: 'API_TOKEN' 
});

client.listUsers({
  search: 'profile.firstName eq "Test"',
  limit: 1
}).each(user => {
  console.log('User matches search:', user);
});

```

All the HTTP requests contained the limit parameter as set in the script.

```auto
[05/Aug/2019:23:54:10 +0000] "GET /api/v1/users?search=profile.firstName%20eq%20%22Test%22&limit=1 HTTP/1.1"
[05/Aug/2019:23:54:10 +0000] "GET /api/v1/users?after=1&limit=1&search=profile.firstName+eq+%22Test%22 HTTP/1.1"
[05/Aug/2019:23:54:11 +0000] "GET /api/v1/users?after=3&limit=1&search=profile.firstName+eq+%22Test%22 HTTP/1.1"

```

---

<div class="post-metadata">

**Author:** ![monalizende](https://avatars.discourse-cdn.com/v4/letter/m/47e85d/32.png) [@monalizende](https://devforum.okta.com/u/monalizende)\
**Post date:** [August 6, 2019, 8:33am UTC](https://devforum.okta.com/t/unable-to-limit-get-user-list/5864/3 "2019-08-06T08:33:36Z")

</div>

Please check the response of API call as well. It simply ignores the limit and send all the records. Try to have multiple records matching search criteria and see if numbers of records in response follows the limit provided.

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [January 24, 2024, 6:30pm UTC](https://devforum.okta.com/t/unable-to-limit-get-user-list/5864/4 "2024-01-24T18:30:41Z")

</div>

Closed on January 24, 2024, 6:30pm UTC


