Skip to content
API Reference

Get user

client.Zones.Users.Get(ctx, id, query) (*User, error)
GET/zones/{zoneId}/users/{id}

Returns details of a specific user by user ID

ParametersExpand Collapse
id string
query ZoneUserGetParams
ZoneID param.Field[string]

Zone ID

ReturnsExpand Collapse
type User struct{…}

An authenticated user entity

ID string

Unique identifier of the user

CreatedAt Time

Entity creation timestamp

formatdate-time
Email string

Email address of the user

formatemail
EmailVerified bool

Whether the email address has been verified

OrganizationID string

Organization that owns this user

UpdatedAt Time

Entity update timestamp

formatdate-time
ZoneID string

Zone this user belongs to

AuthenticatedAt stringoptional

Date when the user was last authenticated

Issuer stringoptional

Issuer identifier of the identity provider

ProviderID stringoptional

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

Subject stringoptional

Subject identifier from the identity provider

Get user

package main

import (
  "context"
  "fmt"

  "github.com/keycardai/keycard-go"
)

func main() {
  client := keycard.NewClient(

  )
  user, err := client.Zones.Users.Get(
    context.TODO(),
    "id",
    keycard.ZoneUserGetParams{
      ZoneID: "zoneId",
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", 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"
}