# Replace taxa

URL: https://docs.hanzo.ai/docs/openapi/taxonomy/put-taxonomy-taxa-by-id

> Creates or replaces one product and returns it as stored.

`PUT /v1/taxonomy/taxa/{id}`

> [Taxonomy →](https://docs.hanzo.ai/docs/openapi/taxonomy) · [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|               |                                              |
| ------------- | -------------------------------------------- |
| **Address**   | `https://api.hanzo.ai/v1/taxonomy/taxa/{id}` |
| **Method**    | `PUT`                                        |
| **Operation** | `put_taxonomy_taxa_by_id`                    |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY`       |

Creates or replaces one product and returns it as stored. The id in the
URL is the one it is filed under whatever the body says. The category must
already exist — a taxon naming a category that does not is refused with 400
rather than stored where nothing can render it.

A taxon opens exactly one way: `route` for a product the console renders
itself, or `href` for one that genuinely lives at its own domain. Giving both,
or neither, is refused.

Platform SuperAdmin only.

## Request

12 fields, body `application/json` (required).

| Field         | In   | Type            | Required | Description                                                          |
| ------------- | ---- | --------------- | -------- | -------------------------------------------------------------------- |
| `id`          | path | string          | yes      | ID is the taxon slug to write, from the path.                        |
| `brands`      | body | string\[]       | —        | Brands are the brands whose console shows it.                        |
| `category`    | body | string          | —        | Category is the id of an EXISTING category to file it under.         |
| `description` | body | string          | —        | Description is the one line shown beneath the name.                  |
| `href`        | body | string          | —        | Href is the absolute URL an external product launches.               |
| `icon`        | body | string          | —        | Icon names the icon the surface renders, e.g. "Database".            |
| `id`          | body | string          | —        | ID is the taxon slug to write, from the path.                        |
| `name`        | body | string          | —        | Name is the display name.                                            |
| `order`       | body | integer (int64) | —        | Order is where it sits within its category, ascending.               |
| `published`   | body | boolean         | —        | Published is whether it is shown.                                    |
| `route`       | body | string          | —        | Route is the in-console path it opens, e.g. "/vector".               |
| `tags`        | body | string\[]       | —        | Tags are free-form labels for search and grouping across categories. |

## Response

| Status    | Body            | Meaning |
| --------- | --------------- | ------- |
| `200`     | taxonomy.Taxon  | ok      |
| `default` | problem-details | refused |

`200` body — 12 fields.

| Field         | In   | Type            | Always | Description                                                                                                                |
| ------------- | ---- | --------------- | ------ | -------------------------------------------------------------------------------------------------------------------------- |
| `brands`      | body | string\[]       | —      | Brands are the brands whose console shows this taxon.                                                                      |
| `category`    | body | string          | —      | Category is the id of the category this taxon is filed under.                                                              |
| `description` | body | string          | —      | Description is the one line shown beneath the name in the catalogue and nav.                                               |
| `href`        | body | string          | —      | Href is the absolute URL an external product launches, for the taxa that genuinely live at their own domain.               |
| `icon`        | body | string          | —      | Icon names the icon the surface renders, e.g. "Database".                                                                  |
| `id`          | body | string          | —      | ID is the stable slug this taxon is addressed by, e.g. "vector".                                                           |
| `name`        | body | string          | —      | Name is the display name, e.g. "Vector".                                                                                   |
| `order`       | body | integer (int64) | —      | Order is where the taxon sits within its category, ascending.                                                              |
| `owner`       | body | string          | —      | 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. |
| `published`   | body | boolean         | —      | Published is whether the taxon is shown.                                                                                   |
| `route`       | body | string          | —      | Route is the in-console path this taxon opens, e.g. "/vector".                                                             |
| `tags`        | body | string\[]       | —      | Tags are free-form labels for search and grouping across categories.                                                       |

Failure carries the platform error shape — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo taxonomy taxa set <id>
```

**SDK**

**.ts**

```ts
import { Configuration, TaxonomyApi } from 'hanzoai';

const api = new TaxonomyApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.putTaxonomyTaxaById({ id: 'id', brands: ["<brands>"], category: "<category>" });
```

**.py**

```python
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_taxa_by_id(id='id', brands=["<brands>"], category="<category>")
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.TaxonomyAPI.PutTaxonomyTaxaById(context.Background()).Execute()
if err != nil {
	return err
}
```

**.rs**

```rust
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_taxa_by_id(&cfg, Default::default()).await?;
```

**.java**

```java
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).putTaxonomyTaxaById();
```

**HTTP**

```bash
curl -X PUT https://api.hanzo.ai/v1/taxonomy/taxa/<id> \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "brands": [
         "<brands>"
       ],
       "category": "<category>"
     }'
```

**MCP**

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:

```bash
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](https://docs.hanzo.ai/docs/openapi/taxonomy) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
