---
title: "Update user"
method: PATCH
path: "/zones/{zoneId}/users/{id}"
tags: ["Users"]
---

# Update user

`PATCH /zones/{zoneId}/users/{id}`

Update a user

## Path parameters

- `zoneId` string, required
- `id` string, required

## Request body

- IamUserUpdate — Schema for updating an existing user
  - `identifier` string, safe-text — Zone-scoped user identifier
  - `status` 'active' | 'disabled' — Status of the user. Set to `disabled` to prevent the user from authenticating and revoke their active sessions, or `active` to re-enable.

## Response `200`

An authenticated user entity

- IamUser — An authenticated user entity
  - `id` string, required — Unique identifier of the user
  - `organization_id` string, required — Organization that owns this user
  - `zone_id` string, required — Zone this user belongs to
  - `identifier` string, required — 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.
  - `subject` string — Subject identifier from the identity provider
  - `issuer` string — Issuer identifier of the identity provider
  - `email` string, email, required — Email address of the user
  - `email_verified` boolean, required — Whether the email address has been verified
  - `status` 'active' | 'disabled', required — Status of the user. Disabled users cannot authenticate.
  - `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.
  - `created_at` string, date-time, required — Entity creation timestamp
  - `updated_at` string, date-time, required — Entity update timestamp
  - `authenticated_at` string — Date when the user was last authenticated
  - `session_count` integer — Session count for this user. Populated only when `expand[]=session_count` is set on the listing endpoint.
  - `grant_count` integer — Delegated-grant count for this user. Populated only when `expand[]=grant_count` is set on the listing endpoint.
  - `role_assignments` IamUserRoleAssignment[] — Role grants for this user within the zone. Populated only when `expand[]=role-assignments` is set on the listing endpoint.
    - `role_id` string, required — ID of the assigned role
    - `role_identifier` string, required — Opaque role identifier. Treated as an opaque identifier by the API and unique within a zone.
    - `scope` object, nullable, required — The resource this grant is scoped to, or null when the grant is unscoped (applies to the owning zone itself).
      - `type` string, required — The kind of resource this grant is scoped to (e.g. `zone`).
      - `id` string, required — The ID of the scoped resource.

## Other responses

- `404` — Error response
- `409` — Error response
- `default` — Error response

---

[API](https://skmtc.net/keycardai/apis/untitled-api.md) · [All operations](https://skmtc.net/keycardai/apis/untitled-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/keycardai/untitled-api/revisions/2f5033ed4491/schema)
