> 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/apply-database-schema-bundle.md).

# Apply Database Schema Bundle

Creates every collection and taxonomy of a schema bundle, linked and published, in one call.

Creates working collections from the reviewed schema **catalog** (or from your own intermediate-format entities) in one deterministic call: the server compiles the bundle, creates each taxonomy it needs under a readable title **with its terms**, creates the collections in dependency order, links every taxonomy and collection field so the Cloud pickers resolve, and publishes new collections as version 1. Running it again finds what exists and updates drafts instead of creating duplicates. `POST /{version}/database/schemas/apply-bundle` | Field | Meaning | | --- | --- | | `entities` | Comma-separated catalog entity ids, e.g. `blog_posts,comments`. The usual input — the server loads the reviewed documents itself. | | `bundleJson` | Only for entities the catalog does not have: one entity object `{ entity, display_name, description, fields: [{ name, kind, label }] }` or an array; or a catalog reference with `add_fields` / `remove_fields`. A JSON string. | | `tier` | `minimal`, `standard` (default) or `extended` — how many fields to compile. | | `translatable` | `true` marks free-text fields (title, body, excerpt …) translatable. Default `false`. | | `publish` | `false` leaves every collection as a draft. Default `true`. | The answer lists the `taxonomies` (catalog id, id, slug, title, `created` or `reused`, terms created), the `collections`, the `decisions` the server made and any `errors`. Permission: every taxonomy, term and schema goes through the normal save and publish commands, so the caller needs the rights to create taxonomies, terms and schemas (`database:create`) and to publish. AI tool: `apply_database_schema_bundle` (asks for confirmation) — the way the AI assistant creates collections.

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.applyDatabaseSchemaBundle({
  translatable: true,
  publish: true,
  entities: 'example-value',
  bundleJson: '{}',
});
```

{% endtab %}

{% tab title=".NET" %}

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

using var client = new NorbixClient();

var result = await client.Database.ApplyDatabaseSchemaBundleAsync(new ApplyDatabaseSchemaBundleRequest
{
    Translatable = true,
    Publish = true,
    Entities = "example-value",
    BundleJson = "{}",
});
```

{% endtab %}

{% tab title="Python" %}

```python
from norbix_python import NorbixHub

norbix = NorbixHub()

result = norbix.database.apply_database_schema_bundle(
    translatable=True,
    publish=True,
    entities="example-value",
    bundleJson="{}",
)
```

{% endtab %}

{% tab title="Go" %}

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

var result map[string]any
err := c.Hub.Database.ApplyDatabaseSchemaBundle(ctx, map[string]any{
	"translatable": true,
	"publish": true,
	"entities": "example-value",
	"bundleJson": "{}",
}, &result)
```

{% endtab %}

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

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

final hub = NorbixHub();

final result = await hub.database.applyDatabaseSchemaBundle(body: {
  'translatable': true,
  'publish': true,
  'entities': 'example-value',
  'bundleJson': '{}',
});
```

{% endtab %}

{% tab title="Swift" %}

```swift
import NorbixHub

let client = try NorbixHubClient()

let result = try await client.database.applyDatabaseSchemaBundle([
    "translatable": true,
    "publish": true,
    "entities": "example-value",
    "bundleJson": "{}",
])
```

{% endtab %}

{% tab title="Kotlin" %}

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

val hub = NorbixHub()

val result = hub.database.applyDatabaseSchemaBundle(mapOf(
    "translatable" to true,
    "publish" to true,
    "entities" to "example-value",
    "bundleJson" to "{}",
))
```

{% endtab %}

{% tab title="CLI" %}

```sh
norbix hub db schema bundle apply --translatable true --publish true --entities example-value --bundleJson '{}'
```

{% 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: [Apply Database Schema Bundle](/codemash/api-reference/database/schemas/apply-database-schema-bundle.md).
