---
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` (the document declares no server; this is the origin it was published from)
- 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-service/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.

Args:
    session: Database session.
    caller: The authenticated tenant.
    request: Any subset of the create request.
    domain_id: The domain version to edit.

Returns:
    The resulting draft (which may be a new version) and its validation.

Raises:
    PlatformError: ``domain_not_found``, or ``access_denied`` for a
        platform-owned row.

## 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.
    - `classes` TaxonomyClass[]
      - `group` string, required
      - `subgroup` string, required
      - `description` string, required: Written for the classifier — it IS the prompt.
      - `aliases` string[]: Renames land here so old folder paths stay resolvable.
    - `allow_other` true: Cannot be disabled: a document that fits nothing is labelled 'other', never force-fitted.

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

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `402`: Payment Required
- `403`: Forbidden
- `404`: Not Found
- `409`: Conflict
- `410`: Gone
- `413`: Request Entity Too Large
- `422`: Unprocessable Entity
- `424`: Failed Dependency
- `429`: Too Many Requests
- `500`: Internal Server Error
- `501`: Not Implemented
- `503`: Service Unavailable
- `504`: Gateway Timeout

---

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