user_groups
Creates, updates, deletes, gets or lists a user_groups resource.
Overview​
| Name | user_groups |
| Type | Resource |
| Id | okta.users.user_groups |
Fields​
The following fields are returned by SELECT queries:
- list_user_groups
| Name | Datatype | Description |
|---|---|---|
id | string | Unique ID for the group (example: 0gabcd1234) |
_embedded | object | Embedded resources related to the group |
_links | object | Discoverable resources related to the group |
created | string (date-time) | Timestamp when the group was created |
lastMembershipUpdated | string (date-time) | Timestamp when the groups memberships were last updated |
lastUpdated | string (date-time) | Timestamp when the group's profile was last updated |
objectClass | array | Determines the group's profile |
profile | object | Profile 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. |
type | string | Determines how a group's profile and memberships are managed (APP_GROUP, BUILT_IN, OKTA_GROUP) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_user_groups | select | id, subdomain | Lists all groups of which the user is a member > Note: To list all groups in your org, use the List all groups endpoints in the Groups API. |
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.
| Name | Datatype | Description |
|---|---|---|
id | string | An ID, login, or login shortname (as long as the shortname is unambiguous) of an existing Okta user |
subdomain | string | (default: my-org) |
SELECT examples​
- list_user_groups
Lists all groups of which the user is a member
> Note: To list all groups in your org, use the List all groups endpoints in the Groups API.
SELECT
id,
_embedded,
_links,
created,
lastMembershipUpdated,
lastUpdated,
objectClass,
profile,
type
FROM okta.users.user_groups
WHERE id = '{{ id }}' -- required
AND subdomain = '{{ subdomain }}' -- required
;