Deleting a user account
An account can be deleted from an organization by a user with the organization-manager.admin or organization-manager.organizations.owner role. To learn how to grant a role to a user, see Assigning a role to a user.
Tip
The deletion of a user account from an organization cannot be reversed. To restore a previously deleted user, add them to the organization again.
Deleting a user with a Yandex account
To delete a Yandex account user from an organization:
-
Navigate to Yandex Identity Hub
and log in using an administrator or organization owner account. -
In the left-hand panel, select
Users and select the user you want to delete in the list that opens.Optionally, use the search bar or filter at the top of the page.
-
In the row with the user, click
and select Delete. -
In the window that opens, confirm user deletion from the organization.
If you do not have the Yandex Cloud CLI yet, install and initialize it.
The folder used by default is the one specified when creating the CLI profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also specify a different folder for any command using --folder-name or --folder-id.
If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.
-
View the command description:
yc organization-manager user remove --help -
Delete the user's membership in the organization:
yc organization-manager user remove \ --organization-id <organization_ID> \ --subject-id <user_ID>Specify the organization ID and user ID. Both parameters are required for this example.
Use the deleteMembership REST API method for the User resource or the UserService/DeleteMembership gRPC API call.
Deleting a federated user
To delete a federated user from the organization:
-
Navigate to Yandex Identity Hub
and log in using an administrator or organization owner account. -
In the left-hand panel, select
Users and select the user you want to delete in the list that opens.Optionally, use the search bar or filter at the top of the page.
-
In the row with the user, click
and select Delete. -
In the window that opens, confirm user deletion from the organization.
If you do not have the Yandex Cloud CLI yet, install and initialize it.
The folder used by default is the one specified when creating the CLI profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also specify a different folder for any command using --folder-name or --folder-id.
If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.
-
View the command description:
yc organization-manager user remove --help -
Delete the user's membership in the organization:
yc organization-manager user remove \ --organization-id <organization_ID> \ --subject-id <user_ID>Specify the organization ID and user ID. Both parameters are required for this example.
With Terraform
Terraform is distributed under the Business Source License
For more information about the provider resources, see the guides on the Terraform
If you do not have Terraform yet, install it and configure the Yandex Cloud provider.
To manage infrastructure using Terraform under a service account or user accounts (a Yandex account, a federated account, or a local user), authenticate using the appropriate method.
-
In a configuration that controls the federated user, delete that user's
yandex_organizationmanager_saml_federation_user_accountsection and links to it. This deletes the user's membership in the organization but not their account with the identity provider.For more information on the
yandex_organizationmanager_saml_federation_user_accountresource, see this provider guide. -
Apply the changes after reviewing the list of resources you want to delete in the plan:
-
In the terminal, navigate to the configuration file directory.
-
Make sure the configuration is correct using this command:
terraform validateIf the configuration is valid, you will get this message:
Success! The configuration is valid. -
Run this command:
terraform planYou will see a list of resources and their properties. No changes will be made at this step. Terraform will show any errors in the configuration.
-
Apply the configuration changes:
terraform apply -
Type
yesand press Enter to confirm the changes.
-
Use the deleteMembership REST API method for the User resource or the UserService/DeleteMembership gRPC API call.
Note
Once you delete a federated user from the organization, the user gets deleted from the federation and releases used up quotas. If your federation is set up to automatically create users, a deleted user can log in to the organization and become its member again. To prevent this, delete or block the user in your IdP.
Deleting a local user
To delete a local user from an organization:
-
Navigate to Yandex Identity Hub
and log in using an administrator or organization owner account. -
In the left-hand panel, select
Users and select the user you want to delete in the list that opens.Optionally, use the search bar or filter at the top of the page.
-
In the row with the user, click
and select Delete. -
In the window that opens, confirm user deletion from the organization.
If you do not have the Yandex Cloud CLI yet, install and initialize it.
The folder used by default is the one specified when creating the CLI profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also specify a different folder for any command using --folder-name or --folder-id.
If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.
-
See the description of the CLI command for removing a user from a pool:
yc organization-manager idp user delete --help -
To get a list of pools in an organization, provide its ID in this command:
yc organization-manager idp userpool list \ --organization-id <organization_ID>Result:
+----------------------+--------------+-------------+----------------------+---------------------+ | ID | NAME | DESCRIPTION | ORGANIZATION ID | CREATED AT | +----------------------+--------------+-------------+----------------------+---------------------+ | ek0o6g0irskn******** | sample-pool1 | | bpf2c65rqcl8******** | 2025-05-17 10:01:04 | | ek03mf01jr4z******** | sample-pool2 | | bpf2c65rqcl8******** | 2025-06-28 16:30:23 | +----------------------+--------------+-------------+----------------------+---------------------+ -
To get the IDs and other information about pool users, provide the pool ID in the following command:
yc organization-manager idp user list \ --userpool-id <user_pool_ID>Result:
+----------------------+----------------------------------------+-----------+----------------------+-----------+---------------------+ | ID | USERNAME | FULL NAME | USERPOOL ID | IS ACTIVE | CREATED AT | +----------------------+----------------------------------------+-----------+----------------------+-----------+---------------------+ | aje3i1gq49n3******** | test-user1@test.ru.idp.yandexcloud.net | User 1 | ek0o6g0irskn******** | true | 2025-10-07 10:41:54 | | aje0j5mts02t******** | test-user2@test.ru.idp.yandexcloud.net | User 2 | ek0o6g0irskn******** | false | 2025-07-16 11:18:57 | +----------------------+----------------------------------------+-----------+----------------------+-----------+---------------------+ -
To delete a local user from an organization, provide their ID in this command:
yc organization-manager idp user delete <user_ID>
With Terraform
Terraform is distributed under the Business Source License
For more information about the provider resources, see the guides on the Terraform
If you do not have Terraform yet, install it and configure the Yandex Cloud provider.
To manage infrastructure using Terraform under a service account or user accounts (a Yandex account, a federated account, or a local user), authenticate using the appropriate method.
-
In a configuration that controls the local user, delete that user's
yandex_organizationmanager_idp_usersection and links to it. This deletes the user from the pool, not just their membership in the organization. -
Apply the changes after reviewing the list of resources you want to delete in the plan:
-
In the terminal, navigate to the configuration file directory.
-
Make sure the configuration is correct using this command:
terraform validateIf the configuration is valid, you will get this message:
Success! The configuration is valid. -
Run this command:
terraform planYou will see a list of resources and their properties. No changes will be made at this step. Terraform will show any errors in the configuration.
-
Apply the configuration changes:
terraform apply -
Type
yesand press Enter to confirm the changes.
-
Use the delete REST API method for the User resource or the UserService/Delete gRPC API call.