Get user
Get user
client.zones.users.retrieve(stringid, UserRetrieveParams { zoneId } params, RequestOptionsoptions?): User { id, created_at, email, 14 more }
GET/zones/{zoneId}/users/{id}
Returns details of a specific user by user ID
Parameters
id: string
Returns
Get user
import KeycardAPI from '@keycardai/api';
const client = new KeycardAPI({
apiKey: process.env['KEYCARD_API_API_KEY'], // This is the default and can be omitted
});
const user = await client.zones.users.retrieve('id', { zoneId: 'zoneId' });
console.log(user.id);{
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"email": "dev@stainless.com",
"email_verified": true,
"identifier": "identifier",
"organization_id": "organization_id",
"status": "active",
"updated_at": "2019-12-27T18:11:19.117Z",
"zone_id": "zone_id",
"authenticated_at": "authenticated_at",
"credentials": [
{
"created_at": "2019-12-27T18:11:19.117Z",
"provider_id": "provider_id",
"type": "federation",
"updated_at": "2019-12-27T18:11:19.117Z",
"issuer": "issuer",
"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": {
"icon_url": "https://example.com"
},
"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": {
"scopes": [
"string"
],
"single_logout_enabled": true,
"user_identifier_claim": "user_identifier_claim",
"userinfo_endpoint": "https://example.com"
}
},
"type": "external"
},
"subject": "subject"
}
],
"grant_count": 0,
"issuer": "issuer",
"provider_id": "provider_id",
"role_assignments": [
{
"role_id": "role_id",
"role_identifier": "role_identifier",
"role_owner_type": "platform",
"scope": {
"id": "id",
"type": "type"
}
}
],
"session_count": 0,
"subject": "subject"
}Returns Examples
{
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"email": "dev@stainless.com",
"email_verified": true,
"identifier": "identifier",
"organization_id": "organization_id",
"status": "active",
"updated_at": "2019-12-27T18:11:19.117Z",
"zone_id": "zone_id",
"authenticated_at": "authenticated_at",
"credentials": [
{
"created_at": "2019-12-27T18:11:19.117Z",
"provider_id": "provider_id",
"type": "federation",
"updated_at": "2019-12-27T18:11:19.117Z",
"issuer": "issuer",
"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": {
"icon_url": "https://example.com"
},
"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": {
"scopes": [
"string"
],
"single_logout_enabled": true,
"user_identifier_claim": "user_identifier_claim",
"userinfo_endpoint": "https://example.com"
}
},
"type": "external"
},
"subject": "subject"
}
],
"grant_count": 0,
"issuer": "issuer",
"provider_id": "provider_id",
"role_assignments": [
{
"role_id": "role_id",
"role_identifier": "role_identifier",
"role_owner_type": "platform",
"scope": {
"id": "id",
"type": "type"
}
}
],
"session_count": 0,
"subject": "subject"
}