Skip to content
Docs

Users

Users

List users
client.Zones.Users.List(ctx, zoneID, query) (*ZoneUserListResponse, error)
GET/zones/{zoneId}/users
Get user
client.Zones.Users.Get(ctx, id, params) (*User, error)
GET/zones/{zoneId}/users/{id}
Update user
client.Zones.Users.Update(ctx, id, params) (*User, error)
PATCH/zones/{zoneId}/users/{id}
Delete user
client.Zones.Users.Delete(ctx, id, body) error
DELETE/zones/{zoneId}/users/{id}
ModelsExpand 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

Identifier string

Zone-scoped user identifier. Defaults to the user's Keycard ID. When the provider has user_identifier_claim configured, the value is set from that claim at user creation time.

OrganizationID string

Organization that owns this user

Status UserStatus

Status of the user. Disabled users cannot authenticate.

Accepts one of the following:
const UserStatusActive UserStatus = "active"
const UserStatusDisabled UserStatus = "disabled"
UpdatedAt Time

Entity update timestamp

formatdate-time
ZoneID string

Zone this user belongs to

AuthenticatedAt stringoptional

Date when the user was last authenticated

Credentials []UserCredentialUnionoptional

Authentication credentials for this user, each carrying its identity provider for federation credentials. Populated only when expand[]=credentials is set on the listing endpoint.

Accepts one of the following:
type UserCredentialUserCredentialFederation struct{…}

Federation credential: the user authenticates through an identity provider.

CreatedAt Time

Entity creation timestamp

formatdate-time
ProviderID string

ID of the identity provider backing this credential. null when the source provider has been deleted.

Type string
UpdatedAt Time

Entity update timestamp

formatdate-time
Issuer stringoptional

Issuer identifier of the identity provider.

Provider Provideroptional

A Provider is a system that supplies access to Resources and allows actors (Users or Applications) to authenticate.

ID string

Unique identifier of the provider

CreatedAt Time

Entity creation timestamp

formatdate-time
Identifier string

User specified identifier, unique within the zone

minLength1
maxLength2048
Name string

Human-readable name

minLength1
maxLength255
OrganizationID string

Organization that owns this provider

OwnerType ProviderOwnerType

Who owns this provider. Platform-owned providers cannot be modified via API.

Accepts one of the following:
const ProviderOwnerTypePlatform ProviderOwnerType = "platform"
const ProviderOwnerTypeCustomer ProviderOwnerType = "customer"
Slug string

URL-safe identifier, unique within the zone

minLength1
maxLength63
UpdatedAt Time

Entity update timestamp

formatdate-time
ZoneID string

Zone this provider belongs to

ClientID stringoptional

OAuth 2.0 client identifier

ClientSecretSet booloptional

Indicates whether a client secret is configured

Description stringoptional

Human-readable description

maxLength2048
Metadata ProviderMetadataoptional

Provider metadata

IconURL stringoptional

Icon URL

formaturi
maxLength2048
Protocols ProviderProtocolsoptional

Protocol-specific configuration

Oauth2 ProviderProtocolsOauth2optional

OAuth 2.0 protocol configuration

Issuer string

OIDC issuer URL used for discovery and token validation.

formaturi
AuthorizationEndpoint stringoptional
formaturi
AuthorizationParameters map[string, string]optional

Custom query parameters appended to authorization redirect URLs. Use for non-standard providers (e.g. Google prompt=consent, access_type=offline).

AuthorizationResourceEnabled booloptional

Whether to include the resource parameter in authorization requests.

AuthorizationResourceParameter stringoptional

The resource parameter value to include in authorization requests. Defaults to "resource" when authorization_resource_enabled is true.

CodeChallengeMethodsSupported []stringoptional
JwksUri stringoptional
formaturi
RegistrationEndpoint stringoptional
formaturi
ScopeParameter stringoptional

The query parameter name for scopes in authorization requests. Defaults to "scope". Slack v2 uses "user_scope".

ScopeSeparator stringoptional

The separator character for scope values. Defaults to " " (space). Slack v2 uses ",".

ScopesSupported []stringoptional
TokenEndpoint stringoptional
formaturi
TokenResponseAccessTokenPointer stringoptional

Dot-separated path to the access token in the token response body. Defaults to "access_token". Slack v2 uses "authed_user.access_token".

Openid ProviderProtocolsOpenidoptional

OpenID Connect protocol configuration

ExternalIDClaim stringoptional

Name of the OIDC claim carrying the stable external id used to correlate logins with externally provisioned (SCIM) users. Defaults to "sub". Set to "oid" for Entra, whose pairwise "sub" differs from the SCIM externalId.

Scopes []stringoptional

Additional OIDC scopes to request from this provider during authentication (e.g. "groups"). Merged with the default scopes (openid, profile, email).

SingleLogoutEnabled booloptional

When true, logging out of the zone propagates the logout to this provider's end_session_endpoint (RP-initiated logout). Defaults to false.

UserIdentifierClaim stringoptional

Name of a top-level string claim in this provider's ID Token to use as the user identifier on user creation. When not set, the user's Keycard ID is used.

UserinfoEndpoint stringoptional
formaturi
Type ProviderTypeoptional
Accepts one of the following:
const ProviderTypeExternal ProviderType = "external"
const ProviderTypeKeycardVault ProviderType = "keycard-vault"
const ProviderTypeKeycardSts ProviderType = "keycard-sts"
Subject stringoptional

Subject identifier from the identity provider.

type UserCredentialUserCredentialPassword struct{…}

Password credential: the user authenticates with email and password. The email lives on the user.

CreatedAt Time

Entity creation timestamp

formatdate-time
Type string
UpdatedAt Time

Entity update timestamp

formatdate-time
GrantCount int64optional

Delegated-grant count for this user. Populated only when expand[]=grant_count is set on the listing endpoint.

minimum0
Groups []UserGroupoptional

Groups this user belongs to within the zone. Populated only when expand[]=groups is set on the listing endpoint.

ID string

Unique identifier of the group

Identifier string

Zone-unique slug that policy rules match on.

Name string

Human-readable group name

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.

RoleAssignments []UserRoleAssignmentoptional

Role grants for this user within the zone. Populated only when expand[]=role-assignments is set on the listing endpoint.

RoleID string

ID of the assigned role

RoleIdentifier string

Role identifier: a lowercase slug (letters and digits separated by single hyphens or underscores), unique per owner type within a zone. Role identifiers surface in policy evaluation, so the slug restriction keeps them unambiguous in policy text.

minLength1
maxLength255
RoleOwnerType string

Owner type of the granted role. Disambiguates roles that share an identifier across owner types.

Accepts one of the following:
const UserRoleAssignmentRoleOwnerTypePlatform UserRoleAssignmentRoleOwnerType = "platform"
const UserRoleAssignmentRoleOwnerTypeCustomer UserRoleAssignmentRoleOwnerType = "customer"
Scope UserRoleAssignmentScope

The resource this grant is scoped to, or null when the grant is unscoped (applies to the owning zone itself).

ID string

The ID of the scoped resource.

Type string

The kind of resource this grant is scoped to (e.g. zone).

Source string

The principal that holds this grant: user when assigned directly to the user, or group when inherited through group membership.

Accepts one of the following:
const UserRoleAssignmentSourceUser UserRoleAssignmentSource = "user"
const UserRoleAssignmentSourceGroup UserRoleAssignmentSource = "group"
GroupID stringoptional

ID of the group this grant is inherited from. Present only when source is group.

SessionCount int64optional

Session count for this user. Populated only when expand[]=session_count is set on the listing endpoint.

minimum0
Subject stringoptional

Subject identifier from the identity provider

UsersRoles

List user role assignments
client.Zones.Users.Roles.List(ctx, userID, params) (*ZoneUserRoleListResponse, error)
GET/zones/{zoneId}/users/{userId}/roles
Assign role to user
client.Zones.Users.Roles.Assign(ctx, userID, params) (*RoleAssignment, error)
POST/zones/{zoneId}/users/{userId}/roles
Revoke role from user
client.Zones.Users.Roles.Revoke(ctx, roleID, params) error
DELETE/zones/{zoneId}/users/{userId}/roles/{roleId}
ModelsExpand Collapse
type RoleAssignment struct{…}

Represents a role assigned to a principal within a zone

ID string

Unique identifier of the role assignment

CreatedAt Time

Entity creation timestamp

formatdate-time
PrincipalID string

ID of the principal the role is assigned to (a user, application, or group ID).

PrincipalType string

The kind of principal the role is assigned to: user, application, or group. A role assigned to a group is inherited by that group's members.

RoleID string

ID of the assigned role

RoleIdentifier string

Role identifier: a lowercase slug (letters and digits separated by single hyphens or underscores), unique per owner type within a zone. Role identifiers surface in policy evaluation, so the slug restriction keeps them unambiguous in policy text.

minLength1
maxLength255
RoleOwnerType RoleAssignmentRoleOwnerType

Owner type of the assigned role. Disambiguates roles that share an identifier across owner types.

Accepts one of the following:
const RoleAssignmentRoleOwnerTypePlatform RoleAssignmentRoleOwnerType = "platform"
const RoleAssignmentRoleOwnerTypeCustomer RoleAssignmentRoleOwnerType = "customer"
UpdatedAt Time

Entity update timestamp

formatdate-time
ZoneID string

Zone this assignment belongs to

ScopeID stringoptional

The ID of the scoped resource. Null when the assignment is unscoped.

ScopeType stringoptional

The kind of resource this grant is scoped to (e.g. zone). Null when the assignment is unscoped (applies to the owning zone itself).

type RoleAssignmentCreate struct{…}

Schema for assigning a role to a principal. Provide exactly one of role_id or role_identifier. When role_identifier is used, owner_type is required to disambiguate roles that share an identifier across owner types; owner_type must be omitted when role_id is used.

OwnerType RoleAssignmentCreateOwnerTypeoptional

Owner type of the role to assign. Required with role_identifier (an identifier is unique only per owner type); must be omitted with role_id.

Accepts one of the following:
const RoleAssignmentCreateOwnerTypePlatform RoleAssignmentCreateOwnerType = "platform"
const RoleAssignmentCreateOwnerTypeCustomer RoleAssignmentCreateOwnerType = "customer"
RoleID stringoptional

ID of the role to assign. Provide exactly one of role_id or role_identifier; owner_type must be omitted when role_id is used.

RoleIdentifier stringoptional

Role identifier: a lowercase slug (letters and digits separated by single hyphens or underscores), unique per owner type within a zone. Role identifiers surface in policy evaluation, so the slug restriction keeps them unambiguous in policy text.

minLength1
maxLength255
ScopeID stringoptional

The ID of the resource to scope the grant to. Provide together with scope_type, or omit both for an unscoped assignment. When scope_type is zone, this must reference a different zone in the same organization.

minLength1
ScopeType stringoptional

The kind of resource to scope the grant to (e.g. zone). Provide together with scope_id, or omit both for an unscoped assignment (applies to the owning zone itself). Only platform roles on the org zone may carry a scope.

minLength1