Skip to main content

grants

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

Overview

Namegrants
TypeResource
Idokta.users.grants

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringID of the Grant object (example: oag3ih1zrm1cBFOiq0h6)
_embeddedobjectEmbedded resources related to the Grant
_linksobjectSpecifies 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.
clientIdstringClient ID of the app integration (example: oag3ih1zrm1cBFOiq0h6)
createdstring (date-time)Timestamp when the object was created (example: 2017-03-28T01:11:10.000Z)
createdByobjectUser that created the object
issuerstringThe issuer of your org authorization server. This is typically your Okta domain. (example: https://my_test_okta_org.oktapreview.com)
lastUpdatedstring (date-time)Timestamp when the object was last updated
scopeIdstringThe name of the Okta scope for which consent is granted (example: okta.users.read)
sourcestringUser type source that granted consent (example: ADMIN)
statusstringStatus (example: ACTIVE)
userIdstringUser ID that granted consent (if source is END_USER) (example: 00u5t60iloOHN9pBi0h7)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_grants_for_user_and_clientselectsubdomainexpand, after, limitLists all grants for a specified user and client
list_user_grantsselectsubdomainscopeId, expand, after, limitLists all grants for the specified user
get_user_grantselectsubdomainexpandRetrieves a grant for the specified user
revoke_grants_for_user_and_clientdeletesubdomainRevokes all grants for the specified user and client
revoke_user_grantsdeletesubdomainRevokes all grants for a specified user
revoke_user_grantdeletesubdomainRevokes one grant for a specified user

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
subdomainstringThe domain of your organization. This can be a provided subdomain of an official okta domain (okta.com, oktapreview.com, etc) or one of your configured custom domains. (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.
expandstringValid value: scope. If specified, scope details are included in the _embedded attribute.
limitinteger (int32)Specifies the number of grants to return
scopeIdstringThe scope ID to filter on

SELECT examples

Lists all grants for a specified user and client

SELECT
id,
_embedded,
_links,
clientId,
created,
createdBy,
issuer,
lastUpdated,
scopeId,
source,
status,
userId
FROM okta.users.grants
WHERE subdomain = '{{ subdomain }}' -- required
AND expand = '{{ expand }}'
AND after = '{{ after }}'
AND limit = '{{ limit }}';

DELETE examples

Revokes all grants for the specified user and client

DELETE FROM okta.users.grants
WHERE subdomain = '{{ subdomain }}' --required;