Skip to content
API Reference

Get user

client.zones.users.retrieve(stringid, UserRetrieveParams { zoneId } params, RequestOptionsoptions?): User { id, created_at, email, 8 more }
GET/zones/{zoneId}/users/{id}

Returns details of a specific user by user ID

ParametersExpand Collapse
id: string
params: UserRetrieveParams { zoneId }
zoneId: string

Zone ID

ReturnsExpand Collapse
User { id, created_at, email, 8 more }

An authenticated user entity

id: string

Unique identifier of the user

created_at: string

Entity creation timestamp

formatdate-time
email: string

Email address of the user

formatemail
email_verified: boolean

Whether the email address has been verified

organization_id: string

Organization that owns this user

updated_at: string

Entity update timestamp

formatdate-time
zone_id: string

Zone this user belongs to

authenticated_at?: string

Date when the user was last authenticated

issuer?: string

Issuer identifier of the identity provider

provider_id?: string

Reference to the identity provider. This field is undefined when the source identity provider is deleted but the user is not deleted.

subject?: string

Subject identifier from the identity provider

Get user

import KeycardAPI from '@keycardai/api';

const client = new KeycardAPI();

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,
  "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"
}
Returns Examples
{
  "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"
}