Sample - OpenAI API
GET/organization/roles

List organization roles

Lists the roles configured for the organization. Use after to continue from a previous page, limit to control page size, and order to sort results in ascending or descending order.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

3 parameters
limitintegeroptional
The maximum number of roles to return, from 0 to 1000. Defaults to 1000 when omitted.
Default:1000
afterstringoptional
The pagination cursor from the previous response's `next` field.
orderstringoptional
The sort order for returned roles: `asc` or `desc`. Defaults to `asc` when omitted.
Allowed:ascdescDefault:asc

2 status codes
200Returns a paginated list containing role objects, a `has_more` indicator, and a `next` cursor for retrieving the next page.
objectstringrequired
Always `list`.
Allowed:list
dataarray<object>required
Roles returned in the current page.
has_morebooleanrequired
Whether more roles are available when paginating.
nextstringrequired
Cursor to fetch the next page of results, or `null` when there are no additional roles.
429Returned when the request was rejected because the rate limit was exceeded.
errorobjectrequired

Error handling

A 429 is returned when the request exceeds the rate limit. limit must be between 0 and 1000 and defaults to 1000 when omitted, while order must be asc or desc.