Package com.okta.sdk.resource.api
Class GroupApi
java.lang.Object
com.okta.sdk.resource.api.GroupApi
@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen",
date="2026-03-13T17:36:05.533634+05:30[Asia/Kolkata]",
comments="Generator version: 7.15.0")
public class GroupApi
extends Object
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddGroup(AddGroupRequest group) Add a group Adds a new group with the `OKTA_GROUP` type to your org.addGroup(AddGroupRequest group, Map<String, String> additionalHeaders) Add a group Adds a new group with the `OKTA_GROUP` type to your org.voidassignUserToGroup(String groupId, String userId) Assign a user to a group Assigns a user to a group with the `OKTA_GROUP` type.voidAssign a user to a group Assigns a user to a group with the `OKTA_GROUP` type.voiddeleteGroup(String groupId) Delete a group Deletes a group of the `OKTA_GROUP` or `APP_GROUP` type from your org.voiddeleteGroup(String groupId, Map<String, String> additionalHeaders) Delete a group Deletes a group of the `OKTA_GROUP` or `APP_GROUP` type from your org.Retrieve a group Retrieves a specific group by `id` from your orgRetrieve a group Retrieves a specific group by `id` from your orgprotected static com.fasterxml.jackson.databind.ObjectMapperlistAssignedApplicationsForGroup(String groupId, String after, Integer limit) List all assigned apps Lists all apps that are assigned to a group.listAssignedApplicationsForGroup(String groupId, String after, Integer limit, Map<String, String> additionalHeaders) List all assigned apps Lists all apps that are assigned to a group.listAssignedApplicationsForGroupPaged(String groupId, String after, Integer limit) List all assigned apps (Paginated) Lists all apps that are assigned to a group.listAssignedApplicationsForGroupPaged(String groupId, String after, Integer limit, Map<String, String> additionalHeaders) List all assigned apps (Paginated with additional headers) Lists all apps that are assigned to a group.listGroups(String search, String filter, String q, String after, Integer limit, String expand, String sortBy, String sortOrder) List all groups Lists all groups with pagination support.listGroups(String search, String filter, String q, String after, Integer limit, String expand, String sortBy, String sortOrder, Map<String, String> additionalHeaders) List all groups Lists all groups with pagination support.listGroupsPaged(String search, String filter, String q, String after, Integer limit, String expand, String sortBy, String sortOrder) List all groups (Paginated) Lists all groups with pagination support.listGroupsPaged(String search, String filter, String q, String after, Integer limit, String expand, String sortBy, String sortOrder, Map<String, String> additionalHeaders) List all groups (Paginated with additional headers) Lists all groups with pagination support.listGroupUsers(String groupId, String after, Integer limit) List all member users Lists all users that are a member of a group.List all member users Lists all users that are a member of a group.listGroupUsersPaged(String groupId, String after, Integer limit) List all member users (Paginated) Lists all users that are a member of a group.listGroupUsersPaged(String groupId, String after, Integer limit, Map<String, String> additionalHeaders) List all member users (Paginated with additional headers) Lists all users that are a member of a group.replaceGroup(String groupId, AddGroupRequest group) Replace a group Replaces the profile for a group of `OKTA_GROUP` type from your org.replaceGroup(String groupId, AddGroupRequest group, Map<String, String> additionalHeaders) Replace a group Replaces the profile for a group of `OKTA_GROUP` type from your org.voidsetApiClient(ApiClient apiClient) voidunassignUserFromGroup(String groupId, String userId) Unassign a user from a group Unassigns a user from a group with the `OKTA_GROUP` type.voidUnassign a user from a group Unassigns a user from a group with the `OKTA_GROUP` type.
-
Constructor Details
-
GroupApi
public GroupApi() -
GroupApi
-
-
Method Details
-
getApiClient
-
setApiClient
-
addGroup
Add a group Adds a new group with the `OKTA_GROUP` type to your org. > **Note:** App import operations are responsible for syncing groups with `APP_GROUP` type such as Active Directory groups. See [About groups](https://help.okta.com/okta_help.htm?id=Directory_Groups) in the help documentation.- Parameters:
group- (required)- Returns:
- Group
- Throws:
ApiException- if fails to make API call
-
addGroup
public Group addGroup(AddGroupRequest group, Map<String, String> additionalHeaders) throws ApiExceptionAdd a group Adds a new group with the `OKTA_GROUP` type to your org. > **Note:** App import operations are responsible for syncing groups with `APP_GROUP` type such as Active Directory groups. See [About groups](https://help.okta.com/okta_help.htm?id=Directory_Groups) in the help documentation.- Parameters:
group- (required)additionalHeaders- additionalHeaders for this call- Returns:
- Group
- Throws:
ApiException- if fails to make API call
-
assignUserToGroup
Assign a user to a group Assigns a user to a group with the `OKTA_GROUP` type. > **Note:** You only can modify memberships for groups of the `OKTA_GROUP` type. App imports are responsible for managing group memberships for groups of the `APP_GROUP` type, such as Active Directory groups.- Parameters:
groupId- The `id` of the group (required)userId- ID of an existing Okta user (required)- Throws:
ApiException- if fails to make API call
-
assignUserToGroup
public void assignUserToGroup(String groupId, String userId, Map<String, String> additionalHeaders) throws ApiExceptionAssign a user to a group Assigns a user to a group with the `OKTA_GROUP` type. > **Note:** You only can modify memberships for groups of the `OKTA_GROUP` type. App imports are responsible for managing group memberships for groups of the `APP_GROUP` type, such as Active Directory groups.- Parameters:
groupId- The `id` of the group (required)userId- ID of an existing Okta user (required)additionalHeaders- additionalHeaders for this call- Throws:
ApiException- if fails to make API call
-
deleteGroup
Delete a group Deletes a group of the `OKTA_GROUP` or `APP_GROUP` type from your org. > **Note:** You can't remove groups of type `APP_GROUP` if they are used in a group push mapping.- Parameters:
groupId- The `id` of the group (required)- Throws:
ApiException- if fails to make API call
-
deleteGroup
Delete a group Deletes a group of the `OKTA_GROUP` or `APP_GROUP` type from your org. > **Note:** You can't remove groups of type `APP_GROUP` if they are used in a group push mapping.- Parameters:
groupId- The `id` of the group (required)additionalHeaders- additionalHeaders for this call- Throws:
ApiException- if fails to make API call
-
getGroup
Retrieve a group Retrieves a specific group by `id` from your org- Parameters:
groupId- The `id` of the group (required)- Returns:
- Group
- Throws:
ApiException- if fails to make API call
-
getGroup
Retrieve a group Retrieves a specific group by `id` from your org- Parameters:
groupId- The `id` of the group (required)additionalHeaders- additionalHeaders for this call- Returns:
- Group
- Throws:
ApiException- if fails to make API call
-
listAssignedApplicationsForGroup
public List<Application> listAssignedApplicationsForGroup(String groupId, String after, Integer limit) throws ApiException List all assigned apps Lists all apps that are assigned to a group. See [Application Groups API](/openapi/okta-management/management/tag/ApplicationGroups/).- Parameters:
groupId- The `id` of the group (required)after- Specifies the pagination cursor for the next page of apps (optional)limit- Specifies the number of app results for a page (optional, default to 20)- Returns:
- List<Application>
- Throws:
ApiException- if fails to make API call
-
listAssignedApplicationsForGroup
public List<Application> listAssignedApplicationsForGroup(String groupId, String after, Integer limit, Map<String, String> additionalHeaders) throws ApiExceptionList all assigned apps Lists all apps that are assigned to a group. See [Application Groups API](/openapi/okta-management/management/tag/ApplicationGroups/).- Parameters:
groupId- The `id` of the group (required)after- Specifies the pagination cursor for the next page of apps (optional)limit- Specifies the number of app results for a page (optional, default to 20)additionalHeaders- additionalHeaders for this call- Returns:
- List<Application>
- Throws:
ApiException- if fails to make API call
-
listAssignedApplicationsForGroupPaged
public Iterable<Application> listAssignedApplicationsForGroupPaged(String groupId, String after, Integer limit) List all assigned apps (Paginated) Lists all apps that are assigned to a group. See [Application Groups API](/openapi/okta-management/management/tag/ApplicationGroups/). This method returns a lazy, paginated iterable that automatically handles pagination. It is thread-safe and does not cause memory leaks. Use this method in a for-each loop to automatically fetch all pages without manual cursor management.- Parameters:
groupId- The `id` of the group (required)after- Specifies the pagination cursor for the next page of apps (optional)limit- Specifies the number of app results for a page (optional, default to 20)- Returns:
- Iterable<Application> lazy iterable over all pages
-
listAssignedApplicationsForGroupPaged
public Iterable<Application> listAssignedApplicationsForGroupPaged(String groupId, String after, Integer limit, Map<String, String> additionalHeaders) List all assigned apps (Paginated with additional headers) Lists all apps that are assigned to a group. See [Application Groups API](/openapi/okta-management/management/tag/ApplicationGroups/). This method returns a lazy, paginated iterable that automatically handles pagination. It is thread-safe and does not cause memory leaks.- Parameters:
groupId- The `id` of the group (required)after- Specifies the pagination cursor for the next page of apps (optional)limit- Specifies the number of app results for a page (optional, default to 20)additionalHeaders- additional headers for this call- Returns:
- Iterable<Application> lazy iterable over all pages
-
listGroupUsers
List all member users Lists all users that are a member of a group. The default user limit is set to a very high number due to historical reasons that are no longer valid for most orgs. This will change in a future version of this API. The recommended page limit is now `limit=200`.- Parameters:
groupId- The `id` of the group (required)after- The cursor to use for pagination. It is an opaque string that specifies your current location in the list and is obtained from the `Link` response header. See [Pagination](https://developer.okta.com/docs/api/#pagination) and [Link header](https://developer.okta.com/docs/api/#link-header). (optional)limit- Specifies the number of user results in a page (optional, default to 1000)- Returns:
- List<User>
- Throws:
ApiException- if fails to make API call
-
listGroupUsers
public List<User> listGroupUsers(String groupId, String after, Integer limit, Map<String, String> additionalHeaders) throws ApiExceptionList all member users Lists all users that are a member of a group. The default user limit is set to a very high number due to historical reasons that are no longer valid for most orgs. This will change in a future version of this API. The recommended page limit is now `limit=200`.- Parameters:
groupId- The `id` of the group (required)after- The cursor to use for pagination. It is an opaque string that specifies your current location in the list and is obtained from the `Link` response header. See [Pagination](https://developer.okta.com/docs/api/#pagination) and [Link header](https://developer.okta.com/docs/api/#link-header). (optional)limit- Specifies the number of user results in a page (optional, default to 1000)additionalHeaders- additionalHeaders for this call- Returns:
- List<User>
- Throws:
ApiException- if fails to make API call
-
listGroupUsersPaged
List all member users (Paginated) Lists all users that are a member of a group. The default user limit is set to a very high number due to historical reasons that are no longer valid for most orgs. This will change in a future version of this API. The recommended page limit is now `limit=200`. This method returns a lazy, paginated iterable that automatically handles pagination. It is thread-safe and does not cause memory leaks. Use this method in a for-each loop to automatically fetch all pages without manual cursor management.- Parameters:
groupId- The `id` of the group (required)after- The cursor to use for pagination. It is an opaque string that specifies your current location in the list and is obtained from the `Link` response header. See [Pagination](https://developer.okta.com/docs/api/#pagination) and [Link header](https://developer.okta.com/docs/api/#link-header). (optional)limit- Specifies the number of user results in a page (optional, default to 1000)- Returns:
- Iterable<User> lazy iterable over all pages
-
listGroupUsersPaged
public Iterable<User> listGroupUsersPaged(String groupId, String after, Integer limit, Map<String, String> additionalHeaders) List all member users (Paginated with additional headers) Lists all users that are a member of a group. The default user limit is set to a very high number due to historical reasons that are no longer valid for most orgs. This will change in a future version of this API. The recommended page limit is now `limit=200`. This method returns a lazy, paginated iterable that automatically handles pagination. It is thread-safe and does not cause memory leaks.- Parameters:
groupId- The `id` of the group (required)after- The cursor to use for pagination. It is an opaque string that specifies your current location in the list and is obtained from the `Link` response header. See [Pagination](https://developer.okta.com/docs/api/#pagination) and [Link header](https://developer.okta.com/docs/api/#link-header). (optional)limit- Specifies the number of user results in a page (optional, default to 1000)additionalHeaders- additional headers for this call- Returns:
- Iterable<User> lazy iterable over all pages
-
listGroups
public List<Group> listGroups(String search, String filter, String q, String after, Integer limit, String expand, String sortBy, String sortOrder) throws ApiException List all groups Lists all groups with pagination support. > **Note:** To list all groups belonging to a member, use the [List all groups endpoint in the User Resources API](/openapi/okta-management/management/tag/UserResources/#tag/UserResources/operation/listUserGroups). The number of groups returned depends on the specified [`limit`](/openapi/okta-management/management/tag/Group/#tag/Group/operation/listGroups!in=query&path=limit&t=request), if you have a search, filter, and/or query parameter set, and if that parameter is not null. We recommend using a limit less than or equal to 200. A subset of groups can be returned that match a supported filter expression, query, or search criteria. > **Note:** The `search` parameter results are sourced from an eventually consistent datasource and may not reflect the latest information.- Parameters:
search- Searches for groups with a supported [filtering](https://developer.okta.com/docs/api/#filter) expression for all properties except for `_embedded`, `_links`, and `objectClass`. Okta recommends this query parameter because it provides the largest range of search options and optimal performance. This operation supports [pagination](https://developer.okta.com/docs/api/#pagination). Using search requires [URL encoding](https://developer.mozilla.org/en-US/docs/Glossary/Percent-encoding), for example, `search=type eq \"OKTA_GROUP\"` is encoded as `search=type+eq+%22OKTA_GROUP%22`. This operation searches many properties: * Any group profile attribute, including imported app group profile attributes. * The top-level properties: `id`, `created`, `lastMembershipUpdated`, `lastUpdated`, and `type`. * The [source](/openapi/okta-management/management/tag/Group/#tag/Group/operation/listGroups!c=200&path=_links/source&t=response) of groups with type of `APP_GROUP`, accessed as `source.id`. You can also use the `sortBy` and `sortOrder` parameters. Searches for groups can be filtered by the following operators: `sw`, `eq`, and `co`. You can only use `co` with these select profile attributes: `profile.name` and `profile.description`. See [Operators](https://developer.okta.com/docs/api/#operators). (optional)filter- Filter expression for groups. See [Filter](https://developer.okta.com/docs/api/#filter). Filtering supports the following limited number of properties: `id`, `type`, `lastUpdated`, and `lastMembershipUpdated`. > **Note:** All filters must be [URL encoded](https://developer.mozilla.org/en-US/docs/Glossary/Percent-encoding). For example, `filter=lastUpdated gt \"2013-06-01T00:00:00.000Z\"` is encoded as `filter=lastUpdated%20gt%20%222013-06-01T00:00:00.000Z%22`. See [Special characters](https://developer.okta.com/docs/api/#special-characters). (optional)q- Finds a group that matches the `name` property. > **Note:** Paging and searching are currently mutually exclusive. You can't page a query. The default limit for a query is 300 results. Query is intended for an auto-complete picker use case where users refine their search string to constrain the results. (optional)after- Specifies the pagination cursor for the next page of groups. The `after` cursor should be treated as an opaque value and obtained through the next link relation. See [Pagination](https://developer.okta.com/docs/api/#pagination). (optional)limit- Specifies the number of group results in a page. Okta recommends using a specific value other than the default or maximum. If your request times out, retry your request with a smaller `limit` and [page the results](https://developer.okta.com/docs/api/#pagination). The Okta default `Everyone` group isn't returned for users with a group admin role. (optional)expand- If specified, additional metadata is included in the response. Possible values are `stats` and `app`. This additional metadata is listed in the [`_embedded`](https://developer.okta.com/docs/api/openapi/okta-management/management/tag/Group/#tag/Group/operation/addGroup!c=200&path=_embedded&t=response) property of the response. > **Note:** You can use the `stats` value to return the number of users within a group. This is listed as the `_embedded.stats.usersCount` value in the response. See this [Knowledge Base article](https://support.okta.com/help/s/article/Is-there-an-API-that-returns-the-number-of-users-in-a-group?language=en_US) for more information and an example. (optional)sortBy- Specifies the field to sort by (for search queries only). `sortBy` can be any single property, for example `sortBy=profile.name`. Groups with the same value for the `sortBy` property are ordered by `id`'. Use with `sortOrder` to control the order of results. (optional)sortOrder- Specifies sort order: `asc` or `desc` (for search queries only). This parameter is ignored if `sortBy` isn't present. (optional, default to asc)- Returns:
- List<Group>
- Throws:
ApiException- if fails to make API call
-
listGroups
public List<Group> listGroups(String search, String filter, String q, String after, Integer limit, String expand, String sortBy, String sortOrder, Map<String, String> additionalHeaders) throws ApiExceptionList all groups Lists all groups with pagination support. > **Note:** To list all groups belonging to a member, use the [List all groups endpoint in the User Resources API](/openapi/okta-management/management/tag/UserResources/#tag/UserResources/operation/listUserGroups). The number of groups returned depends on the specified [`limit`](/openapi/okta-management/management/tag/Group/#tag/Group/operation/listGroups!in=query&path=limit&t=request), if you have a search, filter, and/or query parameter set, and if that parameter is not null. We recommend using a limit less than or equal to 200. A subset of groups can be returned that match a supported filter expression, query, or search criteria. > **Note:** The `search` parameter results are sourced from an eventually consistent datasource and may not reflect the latest information.- Parameters:
search- Searches for groups with a supported [filtering](https://developer.okta.com/docs/api/#filter) expression for all properties except for `_embedded`, `_links`, and `objectClass`. Okta recommends this query parameter because it provides the largest range of search options and optimal performance. This operation supports [pagination](https://developer.okta.com/docs/api/#pagination). Using search requires [URL encoding](https://developer.mozilla.org/en-US/docs/Glossary/Percent-encoding), for example, `search=type eq \"OKTA_GROUP\"` is encoded as `search=type+eq+%22OKTA_GROUP%22`. This operation searches many properties: * Any group profile attribute, including imported app group profile attributes. * The top-level properties: `id`, `created`, `lastMembershipUpdated`, `lastUpdated`, and `type`. * The [source](/openapi/okta-management/management/tag/Group/#tag/Group/operation/listGroups!c=200&path=_links/source&t=response) of groups with type of `APP_GROUP`, accessed as `source.id`. You can also use the `sortBy` and `sortOrder` parameters. Searches for groups can be filtered by the following operators: `sw`, `eq`, and `co`. You can only use `co` with these select profile attributes: `profile.name` and `profile.description`. See [Operators](https://developer.okta.com/docs/api/#operators). (optional)filter- Filter expression for groups. See [Filter](https://developer.okta.com/docs/api/#filter). Filtering supports the following limited number of properties: `id`, `type`, `lastUpdated`, and `lastMembershipUpdated`. > **Note:** All filters must be [URL encoded](https://developer.mozilla.org/en-US/docs/Glossary/Percent-encoding). For example, `filter=lastUpdated gt \"2013-06-01T00:00:00.000Z\"` is encoded as `filter=lastUpdated%20gt%20%222013-06-01T00:00:00.000Z%22`. See [Special characters](https://developer.okta.com/docs/api/#special-characters). (optional)q- Finds a group that matches the `name` property. > **Note:** Paging and searching are currently mutually exclusive. You can't page a query. The default limit for a query is 300 results. Query is intended for an auto-complete picker use case where users refine their search string to constrain the results. (optional)after- Specifies the pagination cursor for the next page of groups. The `after` cursor should be treated as an opaque value and obtained through the next link relation. See [Pagination](https://developer.okta.com/docs/api/#pagination). (optional)limit- Specifies the number of group results in a page. Okta recommends using a specific value other than the default or maximum. If your request times out, retry your request with a smaller `limit` and [page the results](https://developer.okta.com/docs/api/#pagination). The Okta default `Everyone` group isn't returned for users with a group admin role. (optional)expand- If specified, additional metadata is included in the response. Possible values are `stats` and `app`. This additional metadata is listed in the [`_embedded`](https://developer.okta.com/docs/api/openapi/okta-management/management/tag/Group/#tag/Group/operation/addGroup!c=200&path=_embedded&t=response) property of the response. > **Note:** You can use the `stats` value to return the number of users within a group. This is listed as the `_embedded.stats.usersCount` value in the response. See this [Knowledge Base article](https://support.okta.com/help/s/article/Is-there-an-API-that-returns-the-number-of-users-in-a-group?language=en_US) for more information and an example. (optional)sortBy- Specifies the field to sort by (for search queries only). `sortBy` can be any single property, for example `sortBy=profile.name`. Groups with the same value for the `sortBy` property are ordered by `id`'. Use with `sortOrder` to control the order of results. (optional)sortOrder- Specifies sort order: `asc` or `desc` (for search queries only). This parameter is ignored if `sortBy` isn't present. (optional, default to asc)additionalHeaders- additionalHeaders for this call- Returns:
- List<Group>
- Throws:
ApiException- if fails to make API call
-
listGroupsPaged
public Iterable<Group> listGroupsPaged(String search, String filter, String q, String after, Integer limit, String expand, String sortBy, String sortOrder) List all groups (Paginated) Lists all groups with pagination support. > **Note:** To list all groups belonging to a member, use the [List all groups endpoint in the User Resources API](/openapi/okta-management/management/tag/UserResources/#tag/UserResources/operation/listUserGroups). The number of groups returned depends on the specified [`limit`](/openapi/okta-management/management/tag/Group/#tag/Group/operation/listGroups!in=query&path=limit&t=request), if you have a search, filter, and/or query parameter set, and if that parameter is not null. We recommend using a limit less than or equal to 200. A subset of groups can be returned that match a supported filter expression, query, or search criteria. > **Note:** The `search` parameter results are sourced from an eventually consistent datasource and may not reflect the latest information. This method returns a lazy, paginated iterable that automatically handles pagination. It is thread-safe and does not cause memory leaks. Use this method in a for-each loop to automatically fetch all pages without manual cursor management.- Parameters:
search- Searches for groups with a supported [filtering](https://developer.okta.com/docs/api/#filter) expression for all properties except for `_embedded`, `_links`, and `objectClass`. Okta recommends this query parameter because it provides the largest range of search options and optimal performance. This operation supports [pagination](https://developer.okta.com/docs/api/#pagination). Using search requires [URL encoding](https://developer.mozilla.org/en-US/docs/Glossary/Percent-encoding), for example, `search=type eq \"OKTA_GROUP\"` is encoded as `search=type+eq+%22OKTA_GROUP%22`. This operation searches many properties: * Any group profile attribute, including imported app group profile attributes. * The top-level properties: `id`, `created`, `lastMembershipUpdated`, `lastUpdated`, and `type`. * The [source](/openapi/okta-management/management/tag/Group/#tag/Group/operation/listGroups!c=200&path=_links/source&t=response) of groups with type of `APP_GROUP`, accessed as `source.id`. You can also use the `sortBy` and `sortOrder` parameters. Searches for groups can be filtered by the following operators: `sw`, `eq`, and `co`. You can only use `co` with these select profile attributes: `profile.name` and `profile.description`. See [Operators](https://developer.okta.com/docs/api/#operators). (optional)filter- Filter expression for groups. See [Filter](https://developer.okta.com/docs/api/#filter). Filtering supports the following limited number of properties: `id`, `type`, `lastUpdated`, and `lastMembershipUpdated`. > **Note:** All filters must be [URL encoded](https://developer.mozilla.org/en-US/docs/Glossary/Percent-encoding). For example, `filter=lastUpdated gt \"2013-06-01T00:00:00.000Z\"` is encoded as `filter=lastUpdated%20gt%20%222013-06-01T00:00:00.000Z%22`. See [Special characters](https://developer.okta.com/docs/api/#special-characters). (optional)q- Finds a group that matches the `name` property. > **Note:** Paging and searching are currently mutually exclusive. You can't page a query. The default limit for a query is 300 results. Query is intended for an auto-complete picker use case where users refine their search string to constrain the results. (optional)after- Specifies the pagination cursor for the next page of groups. The `after` cursor should be treated as an opaque value and obtained through the next link relation. See [Pagination](https://developer.okta.com/docs/api/#pagination). (optional)limit- Specifies the number of group results in a page. Okta recommends using a specific value other than the default or maximum. If your request times out, retry your request with a smaller `limit` and [page the results](https://developer.okta.com/docs/api/#pagination). The Okta default `Everyone` group isn't returned for users with a group admin role. (optional)expand- If specified, additional metadata is included in the response. Possible values are `stats` and `app`. This additional metadata is listed in the [`_embedded`](https://developer.okta.com/docs/api/openapi/okta-management/management/tag/Group/#tag/Group/operation/addGroup!c=200&path=_embedded&t=response) property of the response. > **Note:** You can use the `stats` value to return the number of users within a group. This is listed as the `_embedded.stats.usersCount` value in the response. See this [Knowledge Base article](https://support.okta.com/help/s/article/Is-there-an-API-that-returns-the-number-of-users-in-a-group?language=en_US) for more information and an example. (optional)sortBy- Specifies the field to sort by (for search queries only). `sortBy` can be any single property, for example `sortBy=profile.name`. Groups with the same value for the `sortBy` property are ordered by `id`'. Use with `sortOrder` to control the order of results. (optional)sortOrder- Specifies sort order: `asc` or `desc` (for search queries only). This parameter is ignored if `sortBy` isn't present. (optional, default to asc)- Returns:
- Iterable<Group> lazy iterable over all pages
-
listGroupsPaged
public Iterable<Group> listGroupsPaged(String search, String filter, String q, String after, Integer limit, String expand, String sortBy, String sortOrder, Map<String, String> additionalHeaders) List all groups (Paginated with additional headers) Lists all groups with pagination support. > **Note:** To list all groups belonging to a member, use the [List all groups endpoint in the User Resources API](/openapi/okta-management/management/tag/UserResources/#tag/UserResources/operation/listUserGroups). The number of groups returned depends on the specified [`limit`](/openapi/okta-management/management/tag/Group/#tag/Group/operation/listGroups!in=query&path=limit&t=request), if you have a search, filter, and/or query parameter set, and if that parameter is not null. We recommend using a limit less than or equal to 200. A subset of groups can be returned that match a supported filter expression, query, or search criteria. > **Note:** The `search` parameter results are sourced from an eventually consistent datasource and may not reflect the latest information. This method returns a lazy, paginated iterable that automatically handles pagination. It is thread-safe and does not cause memory leaks.- Parameters:
search- Searches for groups with a supported [filtering](https://developer.okta.com/docs/api/#filter) expression for all properties except for `_embedded`, `_links`, and `objectClass`. Okta recommends this query parameter because it provides the largest range of search options and optimal performance. This operation supports [pagination](https://developer.okta.com/docs/api/#pagination). Using search requires [URL encoding](https://developer.mozilla.org/en-US/docs/Glossary/Percent-encoding), for example, `search=type eq \"OKTA_GROUP\"` is encoded as `search=type+eq+%22OKTA_GROUP%22`. This operation searches many properties: * Any group profile attribute, including imported app group profile attributes. * The top-level properties: `id`, `created`, `lastMembershipUpdated`, `lastUpdated`, and `type`. * The [source](/openapi/okta-management/management/tag/Group/#tag/Group/operation/listGroups!c=200&path=_links/source&t=response) of groups with type of `APP_GROUP`, accessed as `source.id`. You can also use the `sortBy` and `sortOrder` parameters. Searches for groups can be filtered by the following operators: `sw`, `eq`, and `co`. You can only use `co` with these select profile attributes: `profile.name` and `profile.description`. See [Operators](https://developer.okta.com/docs/api/#operators). (optional)filter- Filter expression for groups. See [Filter](https://developer.okta.com/docs/api/#filter). Filtering supports the following limited number of properties: `id`, `type`, `lastUpdated`, and `lastMembershipUpdated`. > **Note:** All filters must be [URL encoded](https://developer.mozilla.org/en-US/docs/Glossary/Percent-encoding). For example, `filter=lastUpdated gt \"2013-06-01T00:00:00.000Z\"` is encoded as `filter=lastUpdated%20gt%20%222013-06-01T00:00:00.000Z%22`. See [Special characters](https://developer.okta.com/docs/api/#special-characters). (optional)q- Finds a group that matches the `name` property. > **Note:** Paging and searching are currently mutually exclusive. You can't page a query. The default limit for a query is 300 results. Query is intended for an auto-complete picker use case where users refine their search string to constrain the results. (optional)after- Specifies the pagination cursor for the next page of groups. The `after` cursor should be treated as an opaque value and obtained through the next link relation. See [Pagination](https://developer.okta.com/docs/api/#pagination). (optional)limit- Specifies the number of group results in a page. Okta recommends using a specific value other than the default or maximum. If your request times out, retry your request with a smaller `limit` and [page the results](https://developer.okta.com/docs/api/#pagination). The Okta default `Everyone` group isn't returned for users with a group admin role. (optional)expand- If specified, additional metadata is included in the response. Possible values are `stats` and `app`. This additional metadata is listed in the [`_embedded`](https://developer.okta.com/docs/api/openapi/okta-management/management/tag/Group/#tag/Group/operation/addGroup!c=200&path=_embedded&t=response) property of the response. > **Note:** You can use the `stats` value to return the number of users within a group. This is listed as the `_embedded.stats.usersCount` value in the response. See this [Knowledge Base article](https://support.okta.com/help/s/article/Is-there-an-API-that-returns-the-number-of-users-in-a-group?language=en_US) for more information and an example. (optional)sortBy- Specifies the field to sort by (for search queries only). `sortBy` can be any single property, for example `sortBy=profile.name`. Groups with the same value for the `sortBy` property are ordered by `id`'. Use with `sortOrder` to control the order of results. (optional)sortOrder- Specifies sort order: `asc` or `desc` (for search queries only). This parameter is ignored if `sortBy` isn't present. (optional, default to asc)additionalHeaders- additional headers for this call- Returns:
- Iterable<Group> lazy iterable over all pages
-
replaceGroup
Replace a group Replaces the profile for a group of `OKTA_GROUP` type from your org. > **Note :** You only can modify profiles for groups of the `OKTA_GROUP` type. > > App imports are responsible for updating profiles for groups of the `APP_GROUP` type, such as Active Directory groups.- Parameters:
groupId- The `id` of the group (required)group- (required)- Returns:
- Group
- Throws:
ApiException- if fails to make API call
-
replaceGroup
public Group replaceGroup(String groupId, AddGroupRequest group, Map<String, String> additionalHeaders) throws ApiExceptionReplace a group Replaces the profile for a group of `OKTA_GROUP` type from your org. > **Note :** You only can modify profiles for groups of the `OKTA_GROUP` type. > > App imports are responsible for updating profiles for groups of the `APP_GROUP` type, such as Active Directory groups.- Parameters:
groupId- The `id` of the group (required)group- (required)additionalHeaders- additionalHeaders for this call- Returns:
- Group
- Throws:
ApiException- if fails to make API call
-
unassignUserFromGroup
Unassign a user from a group Unassigns a user from a group with the `OKTA_GROUP` type. > **Note:** You only can modify memberships for groups of the `OKTA_GROUP` type. > > App imports are responsible for managing group memberships for groups of the `APP_GROUP` type, such as Active Directory groups.- Parameters:
groupId- The `id` of the group (required)userId- ID of an existing Okta user (required)- Throws:
ApiException- if fails to make API call
-
unassignUserFromGroup
public void unassignUserFromGroup(String groupId, String userId, Map<String, String> additionalHeaders) throws ApiExceptionUnassign a user from a group Unassigns a user from a group with the `OKTA_GROUP` type. > **Note:** You only can modify memberships for groups of the `OKTA_GROUP` type. > > App imports are responsible for managing group memberships for groups of the `APP_GROUP` type, such as Active Directory groups.- Parameters:
groupId- The `id` of the group (required)userId- ID of an existing Okta user (required)additionalHeaders- additionalHeaders for this call- Throws:
ApiException- if fails to make API call
-
getObjectMapper
protected static com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
-