Skip to main content

okta_service_accounts

Creates, updates, deletes, gets or lists an okta_service_accounts resource.

Overview​

Nameokta_service_accounts
TypeResource
Idokta.privileged_access.okta_service_accounts

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstring (regex)The UUID of the Okta managed user account (pattern: (?i)^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$, example: d1b65a78-21ed-429b-8ea3-eec96f2748d6)
namestring (regex)The user-defined name for the Okta managed user account (pattern: ^[\w-_. ]+$, example: AD Integrations Admin)
createdstring (date-time)Timestamp when the Okta managed user account was created (example: 2023-04-04T15:56:05.000Z)
descriptionstring (regex)The description of the Okta managed user account (example: Shared admin account for managing AD integrations)
emailstringThe email address associated with the Okta user. This parameter is read-only, and it is derived from the Okta user profile. (example: foo@bar.com)
lastUpdatedstring (date-time)Timestamp when the Okta managed user account was last updated (example: 2023-05-05T18:15:44.000Z)
oktaUserIdstringThe ID of the Okta user being managed as a service account (example: 00u11s48P9zGW8yqm0g5)
ownerGroupIdsarrayA list of IDs of the Okta groups who own the Okta managed user account
ownerUserIdsarrayA list of IDs of the Okta users who own the Okta managed user account
statusstringDescribes the current status of a service account (ALERT, ERROR, INFO, NO_ISSUES, UNSECURED) (example: UNSECURED)
statusDetailstringDescribes the detailed status of a service account (CREATION_FAILED, MISSING_PASSWORD, PENDING, ROTATED, ROTATING, ROTATION_FAILED, STAGED, UNMANAGED, VAULTED) (example: STAGED)
usernamestringThe username associated with the Okta user. This parameter is read-only, and it is derived from the Okta user profile. (example: shr-ad-admin-01@example.com)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_okta_managed_user_accountselectid, subdomainRetrieves an Okta managed user account specified by ID
list_okta_managed_user_accountsselectsubdomainlimit, after, matchLists all Okta managed user accounts in your org.

Use the match parameter to search for accounts where the account name (name) or username (username) contains the specified value.
create_okta_managed_user_accountinsertsubdomain, name, oktaUserIdCreates a new Okta managed user account for managing a Universal Directory user as a service account.

You must specify an existing Okta user in your org with the oktaUserId request parameter.
update_okta_managed_user_accountupdateid, subdomainUpdates an existing Okta managed user account specified by ID.

You can only update the name, description, ownerUserIds, and ownerGroupIds properties.
delete_okta_managed_user_accountdeleteid, subdomainDeletes an Okta managed user account specified by ID.

This operation removes the service account management for the Okta user, suspends the underlying Okta user account,
but doesn't delete the user from Universal Directory.

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
idstring (regex)ID of an existing Okta managed user account
subdomainstring(default: my-org)
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
matchstringSearches for Okta managed user accounts where the account name (name) or username (username) contains the given value

SELECT examples​

Retrieves an Okta managed user account specified by ID

SELECT
id,
name,
created,
description,
email,
lastUpdated,
oktaUserId,
ownerGroupIds,
ownerUserIds,
status,
statusDetail,
username
FROM okta.privileged_access.okta_service_accounts
WHERE id = '{{ id }}' -- required
AND subdomain = '{{ subdomain }}' -- required
;

INSERT examples​

Creates a new Okta managed user account for managing a Universal Directory user as a service account.

You must specify an existing Okta user in your org with the oktaUserId request parameter.

INSERT INTO okta.privileged_access.okta_service_accounts (
description,
name,
oktaUserId,
ownerGroupIds,
ownerUserIds,
subdomain
)
SELECT
'{{ description }}',
'{{ name }}' /* required */,
'{{ oktaUserId }}' /* required */,
'{{ ownerGroupIds }}',
'{{ ownerUserIds }}',
'{{ subdomain }}'
RETURNING
id,
name,
created,
description,
email,
lastUpdated,
oktaUserId,
ownerGroupIds,
ownerUserIds,
status,
statusDetail,
username
;

UPDATE examples​

Updates an existing Okta managed user account specified by ID.

You can only update the name, description, ownerUserIds, and ownerGroupIds properties.

UPDATE okta.privileged_access.okta_service_accounts
SET
description = '{{ description }}',
name = '{{ name }}',
ownerGroupIds = '{{ ownerGroupIds }}',
ownerUserIds = '{{ ownerUserIds }}'
WHERE
id = '{{ id }}' --required
AND subdomain = '{{ subdomain }}' --required
RETURNING
id,
name,
created,
description,
email,
lastUpdated,
oktaUserId,
ownerGroupIds,
ownerUserIds,
status,
statusDetail,
username;

DELETE examples​

Deletes an Okta managed user account specified by ID.

This operation removes the service account management for the Okta user, suspends the underlying Okta user account,
but doesn't delete the user from Universal Directory.

DELETE FROM okta.privileged_access.okta_service_accounts
WHERE id = '{{ id }}' --required
AND subdomain = '{{ subdomain }}' --required
;