Update Brand

PATCH /wp-json/content-api/v1/product-brand/

Updates a specific product brand by ID.

Content API Version: 1.0.3

Authentication

This endpoint requires a Bearer token in the Authorization header. To authenticate:

  1. Go to Content API > Settings in your WordPress admin panel.
  2. Set a secure token in the “Token” field and save it.
  3. Include the token in your request header as follows:
Authorization: Bearer 

Replace with the token you configured.

Parameters

Name Type Description Required
id integer The ID of the brand to update Yes
taxonomy string Taxonomy name (defaults to product_brand) No
name string The updated name of the brand No
description string The updated description of the brand No
slug string The updated slug of the brand No
parent integer The ID of the parent brand (set to 0 to remove parent) No
yoast object Yoast SEO meta fields (title, description, premium social data) No

Example Request

PATCH /wp-json/content-api/v1/product-brand/
Content-Type: application/json

{
  "id": 1,
  "taxonomy": "product_brand",
  "name": "Updated Brand A",
  "description": "Updated description for Brand A",
  "slug": "updated-brand-a",
  "parent": 0,
  "yoast": {
    "title": "Updated Brand A Title",
    "description": "Updated Brand A Description",
    "premium": {
      "social_appearance": {
        "title": "Updated Social Title",
        "description": "Updated Social Description",
        "image": "https://example.com/wp-content/uploads/updated-brand-a-social.jpg"
      },
      "x": {
        "title": "Updated X Title",
        "description": "Updated X Description",
        "image": "https://example.com/wp-content/uploads/updated-brand-a-x.jpg"
      }
    }
  }
}

Example Response

{
  "success": true,
  "brand_id": 1,
  "message": "Brand updated successfully."
}

Possible Errors

Code Message Description HTTP Status
missing_identifier Brand ID is required No brand ID was provided in the request. 400
brand_not_found Brand not found No brand was found matching the provided ID. 404
invalid_parent The specified parent brand does not exist. The provided parent ID does not correspond to an existing brand. 400
term_update_failed Failed to update brand term An error occurred while updating the brand term. 500
not_authorized Not Authorized The provided Bearer token is invalid or does not match the configured token. 401