Friends, I have an aapanel installation with Wordpress installed and an n8n docker container running in the same environment. However, in n8n I have a flow that automatically creates a post in wordpress through the Rest API, but I have come across a specific error in all my attempts, it always returns this error: {“code”:“rest_cannot_create”,“message”:“No permission to create posts with this user.”,“data”:{“status”:401}}
First of all, I'd like to make it clear that I've already installed all the necessary PHP extensions, I've tested it with two users with an administrator role in wordpress and it's still giving me an error, saying that the user doesn't have permission to create a post. I've tried it on a new wordpress installation and the error is still the same, even if I generate new application passwords, and the user has permission to create a post, the request comes back saying that they don't have permission, I've also tested it with the request: curl -X POST -u “user:pass” https://xxx.com.br/wp-json/wp/v2/posts -H “Content-Type: application/json” -d '{ “title”: “Test Post”, “content”: “Content of the post.”, “status”: “publish” }' through the terminal of my local machine and the error returned is the same.
Finally, I did a test on a wordpress site installed in another environment, in a hostinger environment and in that hostinger environment it worked normally and the post was created, leading me to believe that aapanel is somehow restricting or blocking access to the Wordpress Rest API. Has anyone experienced a similar problem or know how I can solve it? I've exhausted all attempts to fix it, even those suggested by Gemini and Deepseek. I've also tried disabling the aapanel firewall and fail2ban but nothing has worked.