Error 401 when trying to update a Category in Wordpress

Describe the problem/error/question

I am getting error 401 while trying to update a post category using HTTP method.

I am able to get all categories (My GET request always end in succcess but failed when I try to perform update function)

What is the error message (if any)?

From HTTP Request

Error code

401

Full message

401 - "{\"code\":\"rest_cannot_update\",\"message\":\"Sorry, you are not allowed to edit this term.\",\"data\":{\"status\":401}}"

Request

{ "body": { "name": "bbb" }, "headers": { "accept": "application/json,text/html,application/xhtml+xml,application/xml,text/*;q=0.9, image/*;q=0.8, */*;q=0.7" }, "method": "POST", "uri": "https://myweb.com/wp-json/wp/v2/categories/537", "gzip": true, "rejectUnauthorized": true, "followRedirect": true, "resolveWithFullResponse": true, "followAllRedirects": true, "timeout": 300000, "encoding": null, "json": false, "useStream": true, "auth": { "username": "[email protected]", "password": "**hidden**" } }

Other info

Item Index

0

Node type

n8n-nodes-base.httpRequest

Node version

4.2 (Latest)

n8n version

1.81.4 (Self Hosted)

Time

3/10/2025, 12:30:42 AM

Stack trace

NodeApiError: Authorization failed - please check your credentials at ExecuteContext.requestWithAuthentication (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/node-execution-context/utils/request-helper-functions.js:991:19) at processTicksAndRejections (node:internal/process/task_queues:95:5) at ExecuteContext.requestWithAuthentication (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/node-execution-context/utils/request-helper-functions.js:1147:20)

Post Categories

Test step

Parameters

Settings


Docs

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 1.81.4 (Self Hosted)

  • Database (default: SQLite):

  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker Compose

  • Operating system: Ubuntu 24.10

I just solved this
It was occurring because I did not use Application Password For my Api Auth.

If you face this problem just

  1. Go to User Profile
  2. Look for Application Passwords
  3. Add a one for your user
  4. Now authenticate your N8n WordPress Node with that Password instead of simple login password
2 Likes

@Zia_Ch, based on the error message you received, it seems that your credentials might not be configured properly on the Request node.

Below you can see how it all should look like, make sure to fill it in with your credentials.

Wordpress Credentials

Request Node

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.