Magento Rest "Admin role not found" error

Magento Rest "Admin role not found" error

August 19, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento Rest "Admin role not found" error

Troubleshooting “Admin Role Not Found” Error in Magento REST API

You’ve encountered an “Admin role not found” error while trying to access Magento’s REST API using the Scribe library. This issue is likely due to a misconfiguration in your Magento installation or incorrect credentials.

Understanding the “Admin Role Not Found” Error

In Magento, you need to create admin roles and assign them permissions before they can be used for API authentication. If no suitable role exists when the API attempts to authenticate, this error occurs.

The error message you received suggests that the API cannot find an appropriate admin role:

{
  "messages": {
    "error": [
      {"code":0,"message":"Admin role not found"}
    ]
}

Checking Your Magento Configuration

Before proceeding with troubleshooting, ensure your Magento installation is up-to-date and correctly configured for REST API access. Here’s a quick checklist:

  1. Enable the REST API: In the Magento admin panel, navigate to Stores > Settings > Configuration > Services > Rest. Make sure the webservices enabled field is set to “Yes”.

  2. Check Credentials: Verify that you’ve entered the correct API key and secret for your user role in the Scribe library configuration.

  3. API Permissions: Ensure that the admin role associated with these credentials has sufficient permissions to access the desired resources (in this case, products).

Resolving the “Admin Role Not Found” Issue

Step 1: Create an Admin Role

If you haven’t already, create a new admin user and assign it a role. To do this:

  1. In your Magento admin panel, go to System > Permissions > Roles.
  2. Click ”+ Add New Role”.
  3. Enter a name for the role (e.g., “API User”).
  4. Save the role.

Step 2: Assign Permissions

Next, assign sufficient permissions to the newly created role:

  1. In the same “Roles” page, select your new role.
  2. Click on “Role Resources”.
  3. Under “Resources”, click on “All”.
  4. Select the resources you need (in this case, Magento_Catalog) and save.

Step 3: Create a User with API Access

  1. Go to System > Permissions > Users.
  2. Click ”+ Add New User”.
  3. Fill in the user details.
  4. In the “Role” field, select the role you created earlier (e.g., “API User”).
  5. Save the user.

Step 4: Configure Scribe for the New User

Update your Scribe configuration to use the new user’s API key and secret:

OAuthService service = new ServiceBuilder()
    .provider(Magento17Api.class)
    .apiKey(NEW_API_KEY) // Replace with the new user's API Key
    .apiSecret(NEW_API_SECRET) // Replace with the new user's API Secret
    .build();

Conclusion

The “Admin role not found” error typically occurs when Magento cannot find a suitable admin role for your API authentication. After creating a new role, assigning necessary permissions, and updating your Scribe configuration to use this new role, you should be able to access the REST API without encountering this issue.

Remember that Magento’s REST API is a powerful tool, but it requires careful setup and management of user roles and permissions for secure operation. Always ensure that you follow best practices for security when configuring your store’s API access.

For more detailed information on Magento’s REST API configuration, feel free to explore the official documentation or visit Laravel Company for in-depth tutorials and guides.

Catalog Database Security API

Our network