When API (Application Programming Interface) Access Control is enabled in your Salesforce org, users may encounter the error "This session is not valid for use with the REST (Representational State Transfer) API" when trying to access the Developer Console. The Developer Console is a web-based integrated development environment (IDE) in Salesforce used to write, debug, and test Apex code and queries.
This error occurs because if a user is assigned the system permission "Use Any API Client" only through a Session-Based Permission Set (a permission set that grants additional access only after a specific login condition is met, such as multi-factor authentication), the permission is not activated during session initialization.
- The Developer Console cannot be accessed.
- Users receive the error: "This session is not valid for use with the REST API."
A developer needs to debug code in the Developer Console but has the "Use Any API Client" permission granted only through a Session-Based Permission Set. When they try to open the Developer Console, the session does not recognize the permission, resulting in the REST API error.
For more information about Session-Based Permission Sets, refer to Salesforce Help: Use Session-Based Permission Sets.
To resolve this error and enable Developer Console access, assign the "Use Any API Client" permission using one of the following methods:
Option 1: Assign via a Standard Permission Set
Option 2: Assign via the User Profile
Navigate to Setup > Permission Sets.
Select the relevant permission set (or create a new one).
Click System Permissions.
Enable "Use Any API Client."
Click Save.
Assign the permission set to the affected user.
Navigate to Setup > Profiles.
Select the profile assigned to the affected user.
Under System Permissions, enable "Use Any API Client."
Click Save.
Important: Avoid relying solely on Session-Based Permission Sets for the "Use Any API Client" permission. Session-Based Permission Sets are not activated during the session initialization required by the Developer Console, which is the root cause of this error.
Additional Resources-
Note: This is a known limitation of the Developer Console with Session-Based Permission Sets. Salesforce is investigating this issue and will update the documentation if enhancements occur.
005132451

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.