Confluence REST API to remove anonymous access to a space/page

@jrichards, thanks for the quick response.

When I tried above, it gives me the following response

{"statusCode":403,"data":{"authorized":false,"valid":false,"errors":[{"message":{"translation":"User isn't authorized to modify permissions.","args":[]}}],"successful":false},"message":"com.atlassian.confluence.api.service.exceptions.PermissionException: User isn't authorized to modify permissions."}

The user I was trying to use is an admin user and all the permissions have been set to use the REST APIs for this user.

Any idea why this is still happening?

Thanks
Ravi