Replace categories

Creates or replaces one category and returns it as stored.

PUT /v1/taxonomy/categories/{id}

Addresshttps://api.hanzo.ai/v1/taxonomy/categories/{id}
MethodPUT
Operationput_taxonomy_categories_by_id
AuthAuthorization: Bearer $HANZO_API_KEY

Creates or replaces one category and returns it as stored. The id in the URL is the one it is filed under whatever the body says, so a category can never be written under a name it was not addressed by — which also makes create and replace the same act, and is why there is no POST beside this.

Platform SuperAdmin only: one catalogue serves every tenant, so an org admin who could rename a category would rename it for all of them.

Request

6 fields, body application/json (required).

FieldInTypeRequiredDescription
idpathstringyesID is the category slug to write, from the path.
brandsbodystring[]—Brands are the brands whose console shows it.
idbodystring—ID is the category slug to write, from the path.
labelbodystring—Label is the display name.
orderbodyinteger (int64)—Order is where the category sits among its siblings, ascending.
summarybodystring—Summary is the one line describing what the category groups.

Response

StatusBodyMeaning
200taxonomy.Categoryok
defaultproblem-detailsrefused

200 body — 19 fields.

FieldInTypeAlwaysDescription
brandsbodystring[]—Brands are the brands whose console shows this category.
idbodystring—ID is the stable slug this category is addressed by, e.g. "observe".
labelbodystring—Label is the display name, e.g. "Observe".
orderbodyinteger (int64)—Order is where the category sits among its siblings, ascending.
ownerbodystring—Owner is the org this category belongs to: the platform's own org for a category every tenant sees, or your org for one you added.
summarybodystring—Summary is the one line describing what the category groups, shown as the header copy on its landing page.
taxabodytaxonomy.Taxon[]—Taxa are the products filed under this category, in display order.
taxa[].brandsbodystring[]—Brands are the brands whose console shows this taxon.
taxa[].categorybodystring—Category is the id of the category this taxon is filed under.
taxa[].descriptionbodystring—Description is the one line shown beneath the name in the catalogue and nav.
taxa[].hrefbodystring—Href is the absolute URL an external product launches, for the taxa that genuinely live at their own domain.
taxa[].iconbodystring—Icon names the icon the surface renders, e.g. "Database".
taxa[].idbodystring—ID is the stable slug this taxon is addressed by, e.g. "vector".
taxa[].namebodystring—Name is the display name, e.g. "Vector".
taxa[].orderbodyinteger (int64)—Order is where the taxon sits within its category, ascending.
taxa[].ownerbodystring—Owner is the org this product belongs to: the platform's own org for one every tenant sees, or your org for one you added.
taxa[].publishedbodyboolean—Published is whether the taxon is shown.
taxa[].routebodystring—Route is the in-console path this taxon opens, e.g. "/vector".
taxa[].tagsbodystring[]—Tags are free-form labels for search and grouping across categories.

Failure carries the platform error shape — see Errors.

Examples

hanzo taxonomy categories set <id>
import { Configuration, TaxonomyApi } from 'hanzoai';

const api = new TaxonomyApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.putTaxonomyCategoriesById({ id: 'id', brands: ["<brands>"], id: "<id>" });
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import TaxonomyApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = TaxonomyApi(client).put_taxonomy_categories_by_id(id='id', brands=["<brands>"], id="<id>")
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.TaxonomyAPI.PutTaxonomyCategoriesById(context.Background()).Execute()
if err != nil {
	return err
}
use hanzo_client::apis::{configuration::Configuration, taxonomy_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = taxonomy_api::put_taxonomy_categories_by_id(&cfg, Default::default()).await?;
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.TaxonomyApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new TaxonomyApi(client).putTaxonomyCategoriesById();
curl -X PUT https://api.hanzo.ai/v1/taxonomy/categories/<id> \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "brands": [
         "<brands>"
       ],
       "id": "<id>"
     }'

MCP reaches taxonomy through the taxonomy tool, which names its 5 operations with its own verbs — this one among them, under a name only MCP declares. describe explains any of them:

curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "describe",
         "arguments": {
           "op": "list_taxonomies"
         }
       }
     }'

Taxonomy API · All Hanzo APIs · Interactive reference

Was this page useful?