List delegated grants
zones.delegated_grants.list(strzone_id, DelegatedGrantListParams**kwargs) -> DelegatedGrantListResponse
GET/zones/{zoneId}/delegated-grants
Returns a list of delegated grants in the specified zone. Can be filtered by user, resource, or status.
Parameters
zone_id: str
active: Optional[Literal["true"]]
after: Optional[str]
Cursor for forward pagination
minLength1
maxLength255
before: Optional[str]
Cursor for backward pagination
minLength1
maxLength255
limit: Optional[int]
Maximum number of items to return
minimum1
maximum100
resource_id: Optional[str]
Filter by resource ID
user_id: Optional[str]
Filter by user ID
Returns
List delegated grants
from keycardai_api import KeycardAPI
client = KeycardAPI()
delegated_grants = client.zones.delegated_grants.list(
zone_id="zoneId",
)
print(delegated_grants.items){
"items": [
{
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"expires_at": "2019-12-27T18:11:19.117Z",
"organization_id": "organization_id",
"provider_id": "provider_id",
"refresh_token_set": true,
"resource_id": "resource_id",
"scopes": [
"string"
],
"status": "active",
"updated_at": "2019-12-27T18:11:19.117Z",
"user_id": "user_id",
"zone_id": "zone_id",
"active": true,
"provider": {
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"identifier": "x",
"name": "x",
"organization_id": "organization_id",
"owner_type": "platform",
"slug": "slug",
"updated_at": "2019-12-27T18:11:19.117Z",
"zone_id": "zone_id",
"client_id": "client_id",
"client_secret_set": true,
"description": "description",
"metadata": {},
"protocols": {
"oauth2": {
"issuer": "https://example.com",
"authorization_endpoint": "https://example.com",
"authorization_parameters": {
"foo": "string"
},
"authorization_resource_enabled": true,
"authorization_resource_parameter": "authorization_resource_parameter",
"code_challenge_methods_supported": [
"string"
],
"jwks_uri": "https://example.com",
"registration_endpoint": "https://example.com",
"scope_parameter": "scope_parameter",
"scope_separator": "scope_separator",
"scopes_supported": [
"string"
],
"token_endpoint": "https://example.com",
"token_response_access_token_pointer": "token_response_access_token_pointer"
},
"openid": {
"userinfo_endpoint": "https://example.com"
}
},
"type": "external"
},
"refreshed_at": "2019-12-27T18:11:19.117Z",
"resource": {
"id": "id",
"application_type": "native",
"created_at": "2019-12-27T18:11:19.117Z",
"identifier": "x",
"name": "x",
"organization_id": "organization_id",
"owner_type": "platform",
"slug": "slug",
"updated_at": "2019-12-27T18:11:19.117Z",
"zone_id": "zone_id",
"application": {
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"dependencies_count": 0,
"identifier": "x",
"name": "x",
"organization_id": "organization_id",
"owner_type": "platform",
"slug": "slug",
"updated_at": "2019-12-27T18:11:19.117Z",
"zone_id": "zone_id",
"description": "description",
"metadata": {
"docs_url": "https://example.com"
},
"protocols": {
"oauth2": {
"post_logout_redirect_uris": [
"https://example.com"
],
"redirect_uris": [
"https://example.com"
]
}
}
},
"application_id": "application_id",
"credential_provider": {
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"identifier": "x",
"name": "x",
"organization_id": "organization_id",
"owner_type": "platform",
"slug": "slug",
"updated_at": "2019-12-27T18:11:19.117Z",
"zone_id": "zone_id",
"client_id": "client_id",
"client_secret_set": true,
"description": "description",
"metadata": {},
"protocols": {
"oauth2": {
"issuer": "https://example.com",
"authorization_endpoint": "https://example.com",
"authorization_parameters": {
"foo": "string"
},
"authorization_resource_enabled": true,
"authorization_resource_parameter": "authorization_resource_parameter",
"code_challenge_methods_supported": [
"string"
],
"jwks_uri": "https://example.com",
"registration_endpoint": "https://example.com",
"scope_parameter": "scope_parameter",
"scope_separator": "scope_separator",
"scopes_supported": [
"string"
],
"token_endpoint": "https://example.com",
"token_response_access_token_pointer": "token_response_access_token_pointer"
},
"openid": {
"userinfo_endpoint": "https://example.com"
}
},
"type": "external"
},
"credential_provider_id": "credential_provider_id",
"description": "description",
"metadata": {
"docs_url": "https://example.com"
},
"scopes": [
"string"
],
"when_accessing": [
"string"
]
},
"user": {
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"email": "dev@stainless.com",
"email_verified": true,
"organization_id": "organization_id",
"updated_at": "2019-12-27T18:11:19.117Z",
"zone_id": "zone_id",
"authenticated_at": "authenticated_at",
"issuer": "issuer",
"provider_id": "provider_id",
"subject": "subject"
}
}
],
"pagination": {
"after_cursor": "x",
"before_cursor": "x",
"total_count": 0
}
}Returns Examples
{
"items": [
{
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"expires_at": "2019-12-27T18:11:19.117Z",
"organization_id": "organization_id",
"provider_id": "provider_id",
"refresh_token_set": true,
"resource_id": "resource_id",
"scopes": [
"string"
],
"status": "active",
"updated_at": "2019-12-27T18:11:19.117Z",
"user_id": "user_id",
"zone_id": "zone_id",
"active": true,
"provider": {
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"identifier": "x",
"name": "x",
"organization_id": "organization_id",
"owner_type": "platform",
"slug": "slug",
"updated_at": "2019-12-27T18:11:19.117Z",
"zone_id": "zone_id",
"client_id": "client_id",
"client_secret_set": true,
"description": "description",
"metadata": {},
"protocols": {
"oauth2": {
"issuer": "https://example.com",
"authorization_endpoint": "https://example.com",
"authorization_parameters": {
"foo": "string"
},
"authorization_resource_enabled": true,
"authorization_resource_parameter": "authorization_resource_parameter",
"code_challenge_methods_supported": [
"string"
],
"jwks_uri": "https://example.com",
"registration_endpoint": "https://example.com",
"scope_parameter": "scope_parameter",
"scope_separator": "scope_separator",
"scopes_supported": [
"string"
],
"token_endpoint": "https://example.com",
"token_response_access_token_pointer": "token_response_access_token_pointer"
},
"openid": {
"userinfo_endpoint": "https://example.com"
}
},
"type": "external"
},
"refreshed_at": "2019-12-27T18:11:19.117Z",
"resource": {
"id": "id",
"application_type": "native",
"created_at": "2019-12-27T18:11:19.117Z",
"identifier": "x",
"name": "x",
"organization_id": "organization_id",
"owner_type": "platform",
"slug": "slug",
"updated_at": "2019-12-27T18:11:19.117Z",
"zone_id": "zone_id",
"application": {
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"dependencies_count": 0,
"identifier": "x",
"name": "x",
"organization_id": "organization_id",
"owner_type": "platform",
"slug": "slug",
"updated_at": "2019-12-27T18:11:19.117Z",
"zone_id": "zone_id",
"description": "description",
"metadata": {
"docs_url": "https://example.com"
},
"protocols": {
"oauth2": {
"post_logout_redirect_uris": [
"https://example.com"
],
"redirect_uris": [
"https://example.com"
]
}
}
},
"application_id": "application_id",
"credential_provider": {
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"identifier": "x",
"name": "x",
"organization_id": "organization_id",
"owner_type": "platform",
"slug": "slug",
"updated_at": "2019-12-27T18:11:19.117Z",
"zone_id": "zone_id",
"client_id": "client_id",
"client_secret_set": true,
"description": "description",
"metadata": {},
"protocols": {
"oauth2": {
"issuer": "https://example.com",
"authorization_endpoint": "https://example.com",
"authorization_parameters": {
"foo": "string"
},
"authorization_resource_enabled": true,
"authorization_resource_parameter": "authorization_resource_parameter",
"code_challenge_methods_supported": [
"string"
],
"jwks_uri": "https://example.com",
"registration_endpoint": "https://example.com",
"scope_parameter": "scope_parameter",
"scope_separator": "scope_separator",
"scopes_supported": [
"string"
],
"token_endpoint": "https://example.com",
"token_response_access_token_pointer": "token_response_access_token_pointer"
},
"openid": {
"userinfo_endpoint": "https://example.com"
}
},
"type": "external"
},
"credential_provider_id": "credential_provider_id",
"description": "description",
"metadata": {
"docs_url": "https://example.com"
},
"scopes": [
"string"
],
"when_accessing": [
"string"
]
},
"user": {
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"email": "dev@stainless.com",
"email_verified": true,
"organization_id": "organization_id",
"updated_at": "2019-12-27T18:11:19.117Z",
"zone_id": "zone_id",
"authenticated_at": "authenticated_at",
"issuer": "issuer",
"provider_id": "provider_id",
"subject": "subject"
}
}
],
"pagination": {
"after_cursor": "x",
"before_cursor": "x",
"total_count": 0
}
}