How to Fix the Error “Unable to Create API Tokens for Reseller Accounts”

Learn how to troubleshoot and resolve the "Unable to Create API Tokens for Reseller Accounts" error in cPanel with simple steps and detailed solutions.

api token

API tokens are unique identifiers used to grant applications or scripts access to cPanel services without needing a username and password. However, sometimes creating API tokens for reseller accounts on cPanel servers can lead to errors. Here, we’ll explain the common causes of these errors and how to fix them.

Common Errors and Fixes

1. Error: “The system failed to create the API token: Invalid or unauthorized ACL specified: frontpage”

This happens because an invalid ‘frontpage’ ACL is present in the file /var/cpanel/resellers for a user (e.g., user1).

Steps to Fix:

  1. Backup the File:

    Create a backup of the /var/cpanel/resellers file:

    bash
     
    cp -v /var/cpanel/resellers{,.backup.9558369} 
                                        
  2. Remove the Invalid ACL:

    Run this command to remove the invalid frontpage ACL for the specific user:

    bash
     
    sed -i 's/frontpage,//g' /var/cpanel/resellers 
                                        
  3. Restart cPanel:

    Save the file and restart cPanel. This should resolve the issue.

  4. Fix for Multiple Users:

    To remove the frontpage ACL for all users, run this command:

    bash
     
    sed -i.bak 's/frontpage,//g' /var/cpanel/resellers 
                                        

After fixing, your /var/cpanel/resellers file should look like this (example):

text
 
User1:acct-summary,add-pkg,allow-addoncreate,allow-parkedcreate,allow-unlimited-bw-pkgs,allow-unlimited-disk-pkgs,allow-unlimited-pkgs,basic-system-info,basic-whm-functions,cors-proxy-get,cpanel-api,cpanel-integration,create-acct,create-dns,create-user-session,digest-auth,edit-account,edit-dns,edit-mx,edit-pkg,generate-email-config,kill-acct,kill-dns,limit-bandwidth,list-accts,list-pkgs,mailcheck,manage-api-tokens,manage-dns-records,manage-oidc,manage-styles,mysql-info,news,ns-config,park-dns,passwd,public-contact,quota,show-bandwidth,ssl,ssl-gencrt,ssl-info,stats,status,suspend-acct,track-email,upgrade-account 
                                    

2. Error: “The system failed to create the API token: Invalid or unauthorized ACLs specified: disallow-shell and frontpage”

This error occurs because the ‘disallow-shell’ setting is outdated and no longer supported in newer versions of cPanel.

Steps to Fix:

  1. Add Missing Reseller Options for All Users:

    Run the following script to update reseller settings globally:

    bash
     
    /scripts/fix_reseller_acls --fix-disallow-shell --all-resellers --all-acl-lists 
                                        
  2. Fix for a Single User:

    To update settings for one reseller (e.g., user1), use this command:

    bash
     
    /usr/local/cpanel/scripts/fix_reseller_acls --add-default-privs --reseller user1 
                                        

These steps will update the necessary permissions and allow API tokens to be created successfully.

Conclusion

Unable to Create API Tokens for Reseller Accounts" error in cPanel can be resolved by addressing specific issues with ACL settings. By identifying and removing invalid or unauthorized ACLs, such as 'frontpage' and 'disallow-shell,' and updating reseller settings, you can successfully create API tokens. Following the provided steps ensures that your cPanel system functions smoothly and securely. If problems persist, seeking help from experts is always a good option to ensure the issue is fully resolved.

Discover iDatam Dedicated Server Locations

iDatam servers are available around the world, providing diverse options for hosting websites. Each region offers unique advantages, making it easier to choose a location that best suits your specific hosting needs.

Up