> For the complete documentation index, see [llms.txt](https://codemash.gitbook.io/codemash/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://codemash.gitbook.io/codemash/sdks/database/schemas/update-database-schema-embed.md).

# Update Database Schema Embed

Saves a schema's embed setting — which fields of each record go into the project's AI knowledge.

Turns AI embedding on or off for one collection. When it is on, the named top-level fields of each record form the text that goes into the project's AI knowledge; the record is embedded again on insert, update and delete. This is a full replace of the setting. `PUT /{version}/database/schemas/{Id}/embed` | Field | Meaning | | --- | --- | | `id` (required) | The schema id (`sch_…`). | | `embed` (required) | `{ enabled, fields, embeddingIntegrationId, perUser }` — `fields`: top-level field names, e.g. `["title", "body"]`; `embeddingIntegrationId`: empty = the project's default embedding integration; `perUser`: `true` = each record's knowledge belongs only to its owner (needs **Records have an owner**). | The current value is read back on the schema (`embed` on [Get Database Schema](/codemash/sdks/database/schemas/get-database-schema.md)). Permission: `database:update` on the schema. AI tool: `update_database_schema_embed`.

This method is on the **Hub** surface (`norbix.hub.database`) — call it from admin tooling or IaC.

{% hint style="info" %}
These examples assume the SDK is installed and your credentials are set as environment variables — each client reads them automatically, so the constructors below take no arguments. See [Install a Norbix SDK](/codemash/sdks/install.md).
{% endhint %}

{% tabs %}
{% tab title="JavaScript / TypeScript" %}

```ts
import { Norbix } from '@norbix.ai/ts';
const norbix = new Norbix();

const result = await norbix.hub.database.updateDatabaseSchemaEmbed({
  id: 'sch_4kX9mQvR2tYw7ZbC1dFgHj',
});
```

{% endtab %}

{% tab title=".NET" %}

```csharp
using Norbix.Sdk;
using Norbix.Sdk.Types.Hub;

using var client = new NorbixClient();

var result = await client.Database.UpdateDatabaseSchemaEmbedAsync(new UpdateDatabaseSchemaEmbedRequest
{
    Id = "sch_4kX9mQvR2tYw7ZbC1dFgHj",
});
```

{% endtab %}

{% tab title="Python" %}

```python
from norbix_python import NorbixHub

norbix = NorbixHub()

result = norbix.database.update_database_schema_embed(
    id="sch_4kX9mQvR2tYw7ZbC1dFgHj",
)
```

{% endtab %}

{% tab title="Go" %}

```go
c, _ := norbix.New(norbix.Options{})
ctx := context.Background()

var result map[string]any
err := c.Hub.Database.UpdateDatabaseSchemaEmbed(ctx, "sch_4kX9mQvR2tYw7ZbC1dFgHj", nil, &result)
```

{% endtab %}

{% tab title="Dart / Flutter" %}

```dart
import 'package:norbix/norbix_hub.dart';

final hub = NorbixHub();

final result = await hub.database.updateDatabaseSchemaEmbed(id: 'sch_4kX9mQvR2tYw7ZbC1dFgHj');
```

{% endtab %}

{% tab title="Swift" %}

```swift
import NorbixHub

let client = try NorbixHubClient()

let result = try await client.database.updateDatabaseSchemaEmbed([
    "id": "sch_4kX9mQvR2tYw7ZbC1dFgHj",
])
```

{% endtab %}

{% tab title="Kotlin" %}

```kotlin
import ai.norbix.sdk.hub.NorbixHub

val hub = NorbixHub()

val result = hub.database.updateDatabaseSchemaEmbed(mapOf(
    "id" to "sch_4kX9mQvR2tYw7ZbC1dFgHj",
))
```

{% endtab %}

{% tab title="CLI" %}

```sh
norbix hub db schema embed update sch_4kX9mQvR2tYw7ZbC1dFgHj
```

{% endtab %}
{% endtabs %}

## In Cloud

Manage this visually in Cloud — see [Database → Schemas](/codemash/cloud/database/collections/create-schema.md).

## API reference

Full request and response for this endpoint: [Update Database Schema Embed](/codemash/api-reference/database/schemas/update-database-schema-embed.md).
