The user that's registering the directory must have workspaces:RegisterWorkspaceDirectory AWS Identity and Access Management (IAM) permissions. To allow the IAM role to run the RegisterWorkspaceDirectory API, you can give the role permissions from the AmazonWorkSpacesAdmin AWS managed policy.
The directory is unshared. In WorkSpaces, you can use only unshared directories. You can't register a shared directory.