How to delete a user

Hi all,

After I succeed to create a test-user-1 by using create-user.yaml, I tried to delete this test user by using the delete syntax, the error: 422 Unprocessable Entity appeared. Is the syntax error in delete-user.yaml? My version is v11.4. Thanks a lot.

create-user.yaml

command: conjur policy load root create-user.yaml

  • !user
    id: test-user-1
    owner: !user admin

delete-user.yaml

command: conjur policy load root delete-user.yaml

  • !delete
    record: !user test-user-1

error msg

{“error”:{“code”:“validation_failed”,“message”:“policy_text may not contain deletion statements”,“details”:[{“code”:“validation_failed”,“target”:“policy_text”,“message”:“may not contain deletion statements”}]}}
error: 422 Unprocessable Entity

1 Like

you need to change the policy load command to delete.

conjur policy load --delete root delete-user.yml is the command for loading a delete policy.

Regards,
Nathan

2 Likes

Thanks, I kept adding the --delete at the end of the command :man_facepalming:t2: