Hi
@vijay.hambar , by default Bots can access all resources, except for the ones you listed above, as those are server-level protected resources. We guard those on purpose, as modifying them via Bots can generally can generally cause issues.
For the use cases you list, I believe should shouldn't need to access those resources.
> We are trying to use bot to create couple of resources after user registration
This can be achieve by writing a bot that Subscribes to the "PasswordChangeRequest" resource, as described in the guide that
@reshma linked. The PCR.type = 'invite' indicates a new user registration.
Admittedly, the name is less than intuitive here
> Set an access policy to the user which needs to be applied to the projectmembership resource
>
The proper way to invite users is to use the
/invite
endpoint:
https://www.medplum.com/docs/auth/user-management-guide#invite-via-api
This endpoint allows you to set an access policy on the member
at the time of invite