2

I am using OKTA Api where I want to get the groups. There are currently close to 50k groups and the API is making a request and pulling in 10k groups. While the api limit is 1000? Which is weird, maybe I was provided 10k request, who knows. Anyways how can I iterate through all the groups. I am using the Okta python SDK.

Here is my code:

import okta
from okta.framework.Utils import Utils
from okta.models.usergroup import UserGroup, UserGroupProfile

okta_url = "testurl.com
api_key = "apikey"
groups_client = okta.UserGroupsClient(okta_url, api_key)
groups = groups_client.get_groups(query=None, limit= 10000)

for i in groups:
    print(("Group Name: {}".format(i.profile.name)) + (" Group ID: {}".format(i.id)))

The result is

Group Name: group1 Group ID: 00abcdef
Group Name: group2 Group ID: 00fedcba
Group Name: group3 Group ID: 00defabc
...

I would like the results to print all 50k instead of printing 10k because of the API limiting. I believe a for loop might do the trick, just not sure.

Any help is greatly appreciated :D

Jeremy Lin
  • 248
  • 1
  • 12

1 Answers1

0

API rate limits apply per minute or per second to the endpoints in an org.

In your case, you might need to sync your okta group in your local database so you don't have to do a one time call from okta, you can now do the syncing by batch.

okta has rate limits for all apis.. but if you want to increase the api limits, you need to call their customer support to upgrade it for a limited amount of time, it's not permanent upgrade I believe (commonly used when doing migration).

here's the guide of their api rate limits, it depends on your subscription: https://developer.okta.com/docs/reference/rate-limits/

enter image description here

Dyrandz Famador
  • 4,499
  • 5
  • 25
  • 40