Can't create category via WP REST API

Viewed 24

I am attempting to create categories via the WordPress REST API but getting the following error:

{
    "code": "rest_cannot_create",
    "message": "Sorry, you are not allowed to create terms in this taxonomy.",
    "data": {
        "status": 401
    }
}

The REST API user I'm using is an administrator. I've confirmed that I'm authenticating correctly because I can create pages via the REST API.

Here is the JSON I'm submitting to https://hostname.net/wp-json/wp/v2/categories

{
    "description":"",
    "name": "Test",
    "slug": "test",
    "parent": 51,
    "meta": []
}

I've confirmed that the category with id 51 exists (created that via the UI). The content-type header is set to application/json.

What is the correct syntax to create a new category via the WP REST API?

0 Answers
Related