Skip to content

Adjust limit in collection endpoints #433

@ilonachan

Description

@ilonachan

Describe the feature request?

I want to use this SDK in scripts to quickly iterate over all users in my org (and/or some group in it). However since the org is very(!) large, I hit the rate limit extremely quickly. This will always be a problem to some extent, but could be mitigated if the API allowed me to increase the number of users fetched with each request (the default of 200 resp. 1000 is laughable in my case). Which it does, but the Node SDK does not expose this functionality. It has to, or it is practically unusable for my (rather basic) purpose.

My suggestion would be, since the repeated fetch logic is abstracted into the Collection objects, that once such a handler object is obtained its limit field can be explicitly set between executions. If this conflicts with the policy of not manipulating the rel-next URL, it should at least be optionally specifiable at creation time. There's no point in restricting this only to the listUsers() endpoint(s), it should be available in all collection-based endpoints.

New or Affected Resource(s)

All collection-based endpoints would be extended with an optional parameter at construction or field on the handler object, which is a non-breaking change.

Provide a documentation link

Documentation of the pagination feature: https://developer.okta.com/docs/api/#pagination
The default limit for api/v1/users is 200: https://developer.okta.com/docs/api/openapi/okta-management/management/tag/User/#tag/User/operation/listUsers!in=query&path=limit&t=request
The default limit for api/v1/groups/{gid}/users is 1000: https://developer.okta.com/docs/api/openapi/okta-management/management/tag/Group/#tag/Group/operation/listGroupUsers!in=query&path=limit&t=request
(To an extent, this last fact leads to an anti-pattern of querying the members of the "Everyone" group rather than using the intended "all users" endpoint)

Additional Information?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions