---
title: "update_domain"
method: PATCH
path: "/v1/domains/{domain_id}"
tags: ["domains"]
---

# update_domain

`PATCH /v1/domains/{domain_id}`

## Request

- Base URL: `https://ndi-api.nace.ai`
- URL: `https://ndi-api.nace.ai/v1/domains/{domain_id}`
- Auth: API key in header `X-API-Key`
- TypeScript: <https://skmtc.dev/nace/apis/ndi-platform-api/docs/v1/domains/:domain_id/patch.ts> (a function with typed inputs; its response is checked against the schema)

Edit a draft, or spin a published version into the next draft. Cost class: fast.

Editing a ``draft`` mutates it. Editing a ``published`` domain creates version
*n+1* and leaves version *n* untouched. Existing workspaces remain pinned to
the version selected at creation; the new version is available only to future
workspaces.

## Path parameters

- `domain_id` string, uuid, required: Domain version identifier.

## Request body

- UpdateDomainRequest: Any subset of the create request. Editing a ``draft`` mutates it. Editing a ``published`` domain creates version *n+1* as a new draft and leaves version *n* untouched — there is no way to change the vocabulary under a live corpus, because a workspace that could not explain its own folder structure is worse than one with an old vocabulary.
  - `display_name` string, nullable
  - `taxonomy` NdiServiceAppPlatformApiDomainsSchemasTaxonomy: The classification vocabulary.
    - `allow_other` true: Cannot be disabled: a document that fits nothing is labelled 'other', never force-fitted.
    - `classes` TaxonomyClass[]
      - `aliases` string[]: Renames land here so old folder paths stay resolvable.
      - `description` string, required: Written for the classifier — it IS the prompt.
      - `group` string, required
      - `subgroup` string, required

## Response `200`

Successful Response

- DomainResponse
  - `domain` Domain, required: A domain with its effective taxonomy already resolved. A caller reading a domain wants the taxonomy that will actually be applied, not a delta they have to merge themselves.
    - `class_count` integer, required
    - `display_name` string, required
    - `domain_id` string, uuid, required
    - `owner` 'platform' | 'tenant', required
    - `parent_slug` string, nullable: Inheritance lineage for platform domains that extend a base vocabulary.
    - `published_at` string, date-time, nullable
    - `selectable` boolean, required: True once published; a workspace may only pin a published version.
    - `slug` string, required
    - `status` 'draft' | 'published', required
    - `taxonomy` TaxonomyOutput, required: The classification vocabulary.
      - `allow_other` true: Cannot be disabled: a document that fits nothing is labelled 'other', never force-fitted.
      - `classes` TaxonomyClass[]
        - `aliases` string[]: Renames land here so old folder paths stay resolvable.
        - `description` string, required: Written for the classifier — it IS the prompt.
        - `group` string, required
        - `subgroup` string, required
    - `version` integer, required
  - `validation` DomainValidation, required: Returned on every domain write, so a caller never has to guess whether a publish will succeed.
    - `effective_class_count` integer, required
    - `errors` DomainValidationError[]
      - `code` string, required
      - `message` string, required
      - `path` string, required
    - `valid` boolean, required

## Other responses

- `504`: Gateway Timeout
- `default`: Typed error envelope used by every 4xx and 5xx. ``error.code`` distinguishes the failure; HTTP status is a consequence of the code.

---

[API](https://skmtc.dev/nace/apis/ndi-platform-api.md) - [All operations](https://skmtc.dev/nace/apis/ndi-platform-api/llms.txt) - [OpenAPI document](https://skmtc.dev/nace/apis/ndi-platform-api/revisions/d002a3589a67?raw)
