Skip to main content

users

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

Overview​

Nameusers
TypeResource
Idokta.identity_sources.users

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe ID of the user in the identity source
createdstring (date-time)The timestamp when the user was created in the identity source
externalIdstringThe external ID of the user in the identity source
lastUpdatedstring (date-time)The timestamp when the user was last updated in the identity source
profileobjectContains a set of external user attributes and their values that are mapped to Okta standard and custom profile properties. See the profile object and Declaration of a Custom Identity Source Schema in Using anything as a source. > Note: Profile attributes can only be of the string type.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_identity_source_userselectidentitySourceId, externalId, subdomainRetrieves a user by external ID in an identity source for the given identity source instance
create_identity_source_userinsertidentitySourceId, subdomainCreates a user in an identity source for the given identity source instance
update_identity_source_usersupdateidentitySourceId, externalId, subdomainUpdates a user to an identity source for the given identity source instance and external ID
replace_existing_identity_source_userreplaceidentitySourceId, externalId, subdomainReplaces an existing user for the given identity source instance and external ID
delete_identity_source_userdeleteidentitySourceId, externalId, subdomainDeletes a user in an identity source for the given identity source instance and external ID

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
externalIdstringThe external ID of the user (example: 00u7m9p9ZT8k2S2EX1f7)
identitySourceIdstringThe ID of the identity source for which the session is created (example: 0oa3l6l6WK6h0R0QW0g4)
subdomainstring(default: my-org)

SELECT examples​

Retrieves a user by external ID in an identity source for the given identity source instance

SELECT
id,
created,
externalId,
lastUpdated,
profile
FROM okta.identity_sources.users
WHERE identitySourceId = '{{ identitySourceId }}' -- required
AND externalId = '{{ externalId }}' -- required
AND subdomain = '{{ subdomain }}' -- required
;

INSERT examples​

Creates a user in an identity source for the given identity source instance

INSERT INTO okta.identity_sources.users (
externalId,
profile,
identitySourceId,
subdomain
)
SELECT
'{{ externalId }}',
'{{ profile }}',
'{{ identitySourceId }}',
'{{ subdomain }}'
;

UPDATE examples​

Updates a user to an identity source for the given identity source instance and external ID

UPDATE okta.identity_sources.users
SET
profile = '{{ profile }}'
WHERE
identitySourceId = '{{ identitySourceId }}' --required
AND externalId = '{{ externalId }}' --required
AND subdomain = '{{ subdomain }}' --required
RETURNING
id,
created,
externalId,
lastUpdated,
profile;

REPLACE examples​

Replaces an existing user for the given identity source instance and external ID

REPLACE okta.identity_sources.users
SET
externalId = '{{ externalId }}',
profile = '{{ profile }}'
WHERE
identitySourceId = '{{ identitySourceId }}' --required
AND externalId = '{{ externalId }}' --required
AND subdomain = '{{ subdomain }}' --required
RETURNING
id,
created,
externalId,
lastUpdated,
profile;

DELETE examples​

Deletes a user in an identity source for the given identity source instance and external ID

DELETE FROM okta.identity_sources.users
WHERE identitySourceId = '{{ identitySourceId }}' --required
AND externalId = '{{ externalId }}' --required
AND subdomain = '{{ subdomain }}' --required
;