The Salesforce org I am working on needs to restrict access to the Salesforce's REST Resources from Lightning Platform REST API. (for example /services/data/vXX.0)

From my research I understood that you need API enabled permission in order to access these services, so if I want to restrict them I would just have to deactivate this checkbox from the profiles.

The problem is that I still need access to all the custom Rest APIs, which can be invoked only if the users have the same permission. API enabled is supposed to allow API calls to any Salesforce API, whether custom or standard.

Can you please help me with that? I was not able to find a clear answer so far.

  • I'm not clear. Do your users not have separate profiles from yourself? Preferably, if they were on separate profiles you could have different settings? – Kris Goncalves Jan 17 at 10:59
  • @KrisGoncalves I am the admin and yes, they have a differrent profile. I want to restrict their access to the Lightning Platform REST API for them, but not the access to the custom APIs that are developed. My user will not be affected. – Roxana Elena Cismaru Jan 17 at 12:35
  • What are your custom APIs? Apex REST web service methods? – Kris Goncalves Jan 17 at 13:07
  • @KrisGoncalves they are just custom REST resources developed to retrieve object records, make certain validations. So yes, Apex web services – Roxana Elena Cismaru Jan 17 at 14:40

There is a permission now that will allow you to access custom Apex REST services while not being able to access the standard REST API:

enter image description here

| improve this answer | |
  • 1
    I have tried to enable only this permission (without API enabled) and it works. I thought that if you do not have API enabled, the custom Apex Rest Services cannot be called. But they can. Thanks a lot! – Roxana Elena Cismaru Jan 21 at 14:53
  • No problem @RoxanaElenaCismaru, this is a very useful permission that I myself had been waiting for a long time. Glad it helped you – Bryan Anderson Jan 21 at 15:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.