How to escape from access restricted to API-only users error message?

2.4K    Asked by ChristianParsons in Salesforce , Asked on Aug 23, 2023

 When I am trying to log in by using SSO, I am required to use two-factor authentication. But when I provide the 2fa code, I get the error that says access is restricted for API-only users. Even though it shows that I have successfully registered for two-factor authentication, I cannot access the UI. It shows that I close the window to continue. I have already confirmed that I am not an API-only user and cleared my cookies and cache; I am getting release notes describing the page. Can anyone please help me understand why I am getting this error message? 

Salesforce owns various access control methods like ‘profile,’ ‘permission set group,’ ‘permission set,’ ‘public group,’ etc. If you want to stop getting the error message that says ‘access restricted for API only users, ’ you need to uncheck the ‘API only user’ option. Even though the steps to do this can vary, if you choose the profile option, you can follow the steps:

First, choose setup. 
Then choose a quick find textbox key in Profile.
After that, choose the API-only users and select and edit the impacted Profile.


Your Answer

Answers (2)

If you're seeing the "Access restricted to API-only users" error in Salesforce, it means your user profile is set to API-only access, preventing you from logging in through the UI. Here’s how to fix it:

1. Check Your User Profile Settings

  • Go to Setup → Users → Profiles.
  • Find the profile assigned to your user.
  • Look for the "API Only User" setting and uncheck it.
  • Save the changes and try logging in again.

2. Assign a Different Profile

  • If you don’t have admin access to change settings, ask a Salesforce admin to assign you a standard profile (e.g., System Administrator or Standard User).
  • Once assigned, try logging in through the UI.

3. Create a Temporary Admin User (If Locked Out)

  • If you're locked out, ask another admin to create a new user with admin rights.
  • Use this new admin account to update your profile settings.
  • After fixing your original user, deactivate the temporary admin account if needed.

4. Use Salesforce Support

  • If no admin access is available, contact Salesforce Support to request profile changes.

5. Prevent Future Issues

✔ Avoid enabling API-only mode for users who need UI access.

✔ Always keep an admin account available for emergencies.

✔ Use permission sets instead of modifying default profiles.

3 Weeks

The "Access restricted to API-only users" error message typically indicates that the operation you're attempting to perform requires API access, but you're currently logged in with a user account that doesn't have the necessary permissions.


To resolve this issue, you can try the following steps:

Check Permissions: Ensure that the user account you're using has the appropriate permissions to access the API. Depending on the service or platform you're working with, this may involve adjusting settings or permissions within the user account settings.

Use API Credentials: If you're accessing an API, make sure you're using the correct API credentials (such as an API key or access token) in your request. These credentials are often required to authenticate and authorize access to the API.

Review API Documentation: Consult the documentation or developer resources for the API you're trying to access. Look for information about authentication and authorization requirements, as well as any specific instructions or limitations for accessing the API.

Contact Support: If you're still unable to resolve the issue, consider reaching out to the support team or developer community associated with the API or platform you're working with. They may be able to provide assistance or guidance to help you troubleshoot the problem.

Verify Endpoint: Double-check the endpoint URL and ensure that you're making requests to the correct API endpoint. Using an incorrect or outdated endpoint may result in authentication errors.

10 Months

Interviews

Parent Categories