careful-honey-27437
05/24/2025, 9:07 PMbrief-egg-61061
05/24/2025, 9:07 PMbrief-egg-61061
05/24/2025, 9:08 PMgo _, _, err = ory.IdentityApi. PatchIdentity(authed, identityId). JsonPatch([]client.JsonPatch{{Op: "replace", Path: "/state", Value: "inactive"}}).Execute()
Or in JavaScript: js await identity.patchIdentity({ id: identityId, jsonPatch: [ { op: "replace", value: "inactive", path: "/state", }, ], })
Setting the state to inactive will prevent the identity from using self-service flows such as sign-in. If an inactive identity tries to sign in, the server will respond with a UI error. This operation is currently only available via the SDK or API, not through the Ory Console interface [Identity state](https://www.ory.sh/docs/identities/model/activate-deactivate-user-login-state), [Github Issue: Disable User](https://github.com/ory/network/issues/415).careful-honey-27437
05/24/2025, 9:09 PMbrief-egg-61061
05/24/2025, 9:09 PMbrief-egg-61061
05/24/2025, 9:09 PM