users
Creates, updates, deletes, gets or lists a users resource.
Overview​
| Name | users |
| Type | Resource |
| Id | okta.identity_sources.users |
Fields​
The following fields are returned by SELECT queries:
- get_identity_source_user
| Name | Datatype | Description |
|---|---|---|
id | string | The ID of the user in the identity source |
created | string (date-time) | The timestamp when the user was created in the identity source |
externalId | string | The external ID of the user in the identity source |
lastUpdated | string (date-time) | The timestamp when the user was last updated in the identity source |
profile | object | Contains 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_identity_source_user | select | identitySourceId, externalId, subdomain | Retrieves a user by external ID in an identity source for the given identity source instance | |
create_identity_source_user | insert | identitySourceId, subdomain | Creates a user in an identity source for the given identity source instance | |
update_identity_source_users | update | identitySourceId, externalId, subdomain | Updates a user to an identity source for the given identity source instance and external ID | |
replace_existing_identity_source_user | replace | identitySourceId, externalId, subdomain | Replaces an existing user for the given identity source instance and external ID | |
delete_identity_source_user | delete | identitySourceId, externalId, subdomain | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
externalId | string | The external ID of the user (example: 00u7m9p9ZT8k2S2EX1f7) |
identitySourceId | string | The ID of the identity source for which the session is created (example: 0oa3l6l6WK6h0R0QW0g4) |
subdomain | string | (default: my-org) |
SELECT examples​
- get_identity_source_user
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​
- create_identity_source_user
- Manifest
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 }}'
;
# Description fields are for documentation purposes
- name: users
props:
- name: identitySourceId
value: "{{ identitySourceId }}"
description: Required parameter for the users resource.
- name: subdomain
value: "{{ subdomain }}"
description: Required parameter for the users resource.
- name: externalId
value: "{{ externalId }}"
description: |
The external ID of the user in the identity source
- name: profile
description: |
Contains a set of external user attributes and their values that are mapped to Okta standard and custom profile properties. See the [`profile` object](https://developer.okta.com/docs/api/openapi/okta-management/management/user/getuser#user/getuser/t=response&c=200&path=profile) and Declaration of a Custom Identity Source Schema in [Using anything as a source](https://help.okta.com/okta_help.htm?type=oie&id=ext-anything-as-a-source).
> **Note:** Profile attributes can only be of the string type.
value:
email: "{{ email }}"
firstName: "{{ firstName }}"
homeAddress: "{{ homeAddress }}"
lastName: "{{ lastName }}"
mobilePhone: "{{ mobilePhone }}"
secondEmail: "{{ secondEmail }}"
userName: "{{ userName }}"
UPDATE examples​
- update_identity_source_users
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​
- replace_existing_identity_source_user
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​
- delete_identity_source_user
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
;