Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Salesforce
  3. Question
Salesforce

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

Asked by Christian Parsons Aug 23, 2023 7.0K views 3 answers
Share

About this question

 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? 

Your answer

3 Answers

Ranjana Admin JanBask Expert Latest answer

Answered on Mar 4, 2025

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.

Was this helpful?

Ranjana Admin JanBask Expert

Answered on May 8, 2024

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.

Was this helpful?

More Salesforce discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Salesforce Blogs

Guides, tips and career advice on Salesforce from JanBask experts.