# Update settings

URL: https://docs.hanzo.ai/docs/openapi/index/patch-index-indexes-by-uid-settings

> Sets which attributes an index can be filtered on.

`PATCH /v1/index/indexes/{uid}/settings`

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

|               |                                                        |
| ------------- | ------------------------------------------------------ |
| **Address**   | `https://api.hanzo.ai/v1/index/indexes/{uid}/settings` |
| **Method**    | `PATCH`                                                |
| **Operation** | `patch_index_indexes_by_uid_settings`                  |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY`                 |

Sets which attributes an index can be filtered on.

Replaces the whole filterable set. An attribute not listed here cannot be
used in a search `filter`, so this is what makes a per-user or per-tag
narrowing possible at all.

It CREATES the index when it is missing rather than answering 404, because a
Meilisearch client configures settings on an index it has just asked for and
a refusal there leaves the client with no index at all.

The 202 and its `enqueued` task are DIALECT COMPATIBILITY, not a promise of
later work: the setting is already applied when this answers.

## Request

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

| Field                  | In   | Type      | Required | Description                                             |
| ---------------------- | ---- | --------- | -------- | ------------------------------------------------------- |
| `uid`                  | path | string    | yes      |                                                         |
| `filterableAttributes` | body | string\[] | —        | FilterableAttributes replaces the whole filterable set. |

## Response

| Status    | Body                | Meaning  |
| --------- | ------------------- | -------- |
| `202`     | index.indexEnqueued | accepted |
| `default` | problem-details     | refused  |

`202` body — 5 fields.

| Field        | In   | Type            | Always | Description                                                                                                                                 |
| ------------ | ---- | --------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------- |
| `enqueuedAt` | body | string          | —      | EnqueuedAt is when the task was recorded, RFC 3339 — which is also when it completed.                                                       |
| `indexUid`   | body | string          | —      | IndexUID names the index the write landed in.                                                                                               |
| `status`     | body | string          | —      | Status is always `enqueued`, for dialect compatibility.                                                                                     |
| `taskUid`    | body | integer (int64) | —      | TaskUID identifies the task for a client that polls it.                                                                                     |
| `type`       | body | string          | —      | Type is the dialect's name for the kind of write: indexCreation, indexDeletion, settingsUpdate, documentAdditionOrUpdate, documentDeletion. |

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

## Examples

**CLI**

```bash
hanzo index indexes settings patch <uid>
```

**SDK**

**.ts**

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

const api = new IndexApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.patchIndexIndexesByUidSettings({ uid: 'uid', filterableAttributes: ["<filterableAttributes>"] });
```

**.py**

```python
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import IndexApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = IndexApi(client).patch_index_indexes_by_uid_settings(uid='uid', filterable_attributes=["<filterableAttributes>"])
```

**.go**

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

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

**.rs**

```rust
use hanzo_client::apis::{configuration::Configuration, index_api};

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

let result = index_api::patch_index_indexes_by_uid_settings(&cfg, Default::default()).await?;
```

**.java**

```java
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.IndexApi;

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

var result = new IndexApi(client).patchIndexIndexesByUidSettings();
```

**HTTP**

```bash
curl -X PATCH https://api.hanzo.ai/v1/index/indexes/<uid>/settings \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "filterableAttributes": [
         "<filterableAttributes>"
       ]
     }'
```

**MCP**

MCP reaches **index** through the `index` tool, which names its 14 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": "get_index_health"
         }
       }
     }'
```

---

[Index API](https://docs.hanzo.ai/docs/openapi/index) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
