PATCH /wp-json/content-api/v1/terms/
Updates a term in a specified taxonomy.
Authentication
This endpoint requires a Bearer token in the Authorization header. To authenticate:
- Go to Content API > Settings in your WordPress admin panel.
- Set a secure token in the “Token” field and save it.
- Include the token in your request header as follows:
Authorization: Bearer <your-token-here>
Replace <your-token-here> with the token you configured.
Parameters
| Name | Type | Description | Required |
|---|---|---|---|
| taxonomy | string | Taxonomy name (product_cat or brand) | Yes |
| id | integer | Term ID | Yes |
| name | string | Term name | Yes |
| description | string | Term description | Yes |
Example Request
{
"taxonomy": "product_cat",
"id": 12,
"name": "Updated Electronics",
"description": "Updated category description"
}
Example Response
{
"success": true,
"term_id": 12
}
Possible Errors
| Code | Message | Description | HTTP Status |
|---|---|---|---|
| not_authorized | Not Authorized | The provided Bearer token is invalid or does not match the configured token. | 401 |
| data_missing | Missing data | No parameters were provided in the request body. | 400 |
| taxonomy_missing | Missing taxonomy | The taxonomy parameter was not provided in the request. |
400 |
| taxonomy_invalid | Only product_cat and brand taxonomies are supported currently. | The provided taxonomy is not one of the supported taxonomies (product_cat or brand). |
400 |
| invalid_term_id | Invalid term id | The id parameter is not a valid numeric value. |
400 |
| term_name_missing | Missing term name | The name parameter was not provided in the request. |
400 |
| no_description | No description was provided | The description parameter was not provided in the request. |
400 |
| terms_not_found | The term id or taxonomy was incorrect | The specified term ID or taxonomy is invalid, or the term could not be updated. | 400 |