Skip to main content

group_targets

Creates, updates, deletes, gets or lists a group_targets resource.

Overview​

Namegroup_targets
TypeResource
Idokta.groups.group_targets

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringUnique ID for the group (example: 0gabcd1234)
_embeddedobjectEmbedded resources related to the group
_linksobjectDiscoverable resources related to the group
createdstring (date-time)Timestamp when the group was created
lastMembershipUpdatedstring (date-time)Timestamp when the groups memberships were last updated
lastUpdatedstring (date-time)Timestamp when the group's profile was last updated
objectClassarrayDetermines the group's profile
profileobjectProfile for any group that is not imported from Active Directory. Specifies the standard and custom profile properties for a group. The objectClass for these groups is okta:user_group. You can extend group profiles with custom properties, but you must first add the properties to the group profile schema before you can reference them. Use the Profile Editor in the Admin Console or the Schemas API to manage schema extensions. Custom properties can contain HTML tags. It is the client's responsibility to escape or encode this data before displaying it. Use best-practices to prevent cross-site scripting.
typestringDetermines how a group's profile and memberships are managed (APP_GROUP, BUILT_IN, OKTA_GROUP)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_group_targets_for_group_roleselectgroupId, roleAssignmentId, subdomainafter, limitLists all group targets for a USER_ADMIN, HELP_DESK_ADMIN, or GROUP_MEMBERSHIP_ADMIN role assignment to a group.
If the role isn't scoped to specific group targets, Okta returns an empty array [].
assign_group_target_to_group_admin_rolereplacegroupId, roleAssignmentId, targetGroupId, subdomainAssigns a group target to a USER_ADMIN, HELP_DESK_ADMIN, or GROUP_MEMBERSHIP_ADMIN role assignment to a group.
When you assign the first group target, you reduce the scope of the role assignment. The role no longer applies to all targets but applies only to the specified target.
unassign_group_target_from_group_admin_roledeletegroupId, roleAssignmentId, targetGroupId, subdomainUnassigns a group target from a USER_ADMIN, HELP_DESK_ADMIN, or GROUP_MEMBERSHIP_ADMIN role assignment to a group.

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
groupIdstringThe id of the group
roleAssignmentIdstringThe id of the role assignment
subdomainstring(default: my-org)
targetGroupIdstring
afterstringThe 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 and Link header.
limitintegerA limit on the number of objects to return

SELECT examples​

Lists all group targets for a USER_ADMIN, HELP_DESK_ADMIN, or GROUP_MEMBERSHIP_ADMIN role assignment to a group.
If the role isn't scoped to specific group targets, Okta returns an empty array [].

SELECT
id,
_embedded,
_links,
created,
lastMembershipUpdated,
lastUpdated,
objectClass,
profile,
type
FROM okta.groups.group_targets
WHERE groupId = '{{ groupId }}' -- required
AND roleAssignmentId = '{{ roleAssignmentId }}' -- required
AND subdomain = '{{ subdomain }}' -- required
AND after = '{{ after }}'
AND limit = '{{ limit }}'
;

REPLACE examples​

Assigns a group target to a USER_ADMIN, HELP_DESK_ADMIN, or GROUP_MEMBERSHIP_ADMIN role assignment to a group.
When you assign the first group target, you reduce the scope of the role assignment. The role no longer applies to all targets but applies only to the specified target.

REPLACE okta.groups.group_targets
SET
-- No updatable properties
WHERE
groupId = '{{ groupId }}' --required
AND roleAssignmentId = '{{ roleAssignmentId }}' --required
AND targetGroupId = '{{ targetGroupId }}' --required
AND subdomain = '{{ subdomain }}' --required;

DELETE examples​

Unassigns a group target from a USER_ADMIN, HELP_DESK_ADMIN, or GROUP_MEMBERSHIP_ADMIN role assignment to a group.

DELETE FROM okta.groups.group_targets
WHERE groupId = '{{ groupId }}' --required
AND roleAssignmentId = '{{ roleAssignmentId }}' --required
AND targetGroupId = '{{ targetGroupId }}' --required
AND subdomain = '{{ subdomain }}' --required
;