role_targets
Creates, updates, deletes, gets or lists a role_targets resource.
Overview​
| Name | role_targets |
| Type | Resource |
| Id | okta.users.role_targets |
Fields​
The following fields are returned by SELECT queries:
- get_role_targets_by_user_id_and_role_id
| Name | Datatype | Description |
|---|---|---|
_links | object | Specifies link relations (see Web Linking) available using the JSON Hypertext Application Language specification. This object is used for dynamic discovery of related resources and lifecycle operations. |
assignmentType | string | The assignment type of how the user receives this target (example: GROUP) |
expiration | string (date-time) | The expiry time stamp of the associated target. It's only included in the response if the associated target will expire. (example: 2023-08-25T12:00:00.000Z) |
orn | string | The Okta Resource Name (ORN) of the app target or group target (example: orn:okta:directory:00o5v1t2W4OSF9r4N0g4:groups:00g5vhi3rEJMOog1S0g4) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_role_targets_by_user_id_and_role_id | select | userId, roleIdOrEncodedRoleId, subdomain | assignmentType, after, limit | Retrieves all role targets for an APP_ADMIN, USER_ADMIN, HELP_DESK_ADMIN, or GROUP_MEMBERSHIP_ADMIN role assignment to an admin user by user or group assignment type.If the role isn't scoped to specific group targets or any app targets, an empty array [] is returned. |
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 |
|---|---|---|
roleIdOrEncodedRoleId | string | The id of the role or Base32 encoded id of the role name |
subdomain | string | (default: my-org) |
userId | string | ID of an existing Okta user |
after | string | 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 and Link header. |
assignmentType | string | Specifies the assignment type of the user |
limit | integer | A limit on the number of objects to return |
SELECT examples​
- get_role_targets_by_user_id_and_role_id
Retrieves all role targets for an APP_ADMIN, USER_ADMIN, HELP_DESK_ADMIN, or GROUP_MEMBERSHIP_ADMIN role assignment to an admin user by user or group assignment type.
If the role isn't scoped to specific group targets or any app targets, an empty array [] is returned.
SELECT
_links,
assignmentType,
expiration,
orn
FROM okta.users.role_targets
WHERE userId = '{{ userId }}' -- required
AND roleIdOrEncodedRoleId = '{{ roleIdOrEncodedRoleId }}' -- required
AND subdomain = '{{ subdomain }}' -- required
AND assignmentType = '{{ assignmentType }}'
AND after = '{{ after }}'
AND limit = '{{ limit }}'
;