---
title: "Publish a domain"
method: POST
path: "/v1/domains/{id}/publish"
tags: ["Domains"]
---

# Publish a domain

`POST /v1/domains/{id}/publish`

## Request

- Base URL: `https://console.nace.ai`
- URL: `https://console.nace.ai/v1/domains/{id}/publish`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/nace/apis/drex-api/docs/v1/domains/:id/publish/post.ts> (a function with typed inputs; its response is checked against the schema)

Freeze a draft so workspaces can use it by its slug. One-way: a published domain never changes. A taxonomy that fails validation is refused, with the rule list in `detail.validation`. Free.

## Path parameters

- `id` string, required

## Response `200`

The published domain and its validation.

- DomainWrite
  - `domain` Domain, required
    - `domain_id` string, required
    - `slug` string, required
    - `display_name` string, required
    - `owner` 'platform' | 'tenant', required: `platform` for the ones every account sees, `tenant` for the account's own.
    - `version` integer, required
    - `status` 'draft' | 'published', required
    - `parent_slug` string, nullable, required: The domain this one inherits from, or null.
    - `class_count` integer, required
    - `selectable` boolean, required: True once published: only then can a new workspace pin it.
    - `taxonomy` Taxonomy, required
      - `classes` TaxonomyClass[], required
        - `group` string, required: The first level: lowercase letters, digits and single underscores, up to 64 characters. `group/subgroup` is the folder path, so the pair is unique. A class that breaks these rules refuses the whole create or update with `422 invalid_request`.
        - `subgroup` string, required: The second level: lowercase letters, digits and single underscores, up to 64 characters.
        - `description` string, required: Written for the classifier: this text is the prompt.
        - `aliases` string[]: Earlier names, so old folder paths still resolve. Optional: a class without it has none.
      - `allow_other` true: Always true: a document that fits no class is labelled, not forced into one.
    - `published_at` string, nullable, required: ISO 8601 timestamp, or null for a draft.
  - `validation` DomainValidation, required
    - `valid` boolean, required
    - `errors` object[], required
      - `code` string, required
      - `path` string, required: The taxonomy entry that failed.
      - `message` string, required
    - `effective_class_count` integer, required

## Other responses

- `401`: Missing or invalid API key (`authentication_error`, code `invalid_api_key`).
- `403`: A platform domain is already published (`permission_error`, code `access_denied`).
- `404`: No such domain for this account (`not_found_error`, code `domain_not_found`), or domains are off on this deployment (`not_found`).
- `409`: The domain is already published (`conflict_error`, code `domain_not_editable`).
- `422`: The taxonomy fails validation (`invalid_request_error`, code `domain_validation_failed`). `detail.validation` lists what to fix.
- `429`: Over the account's requests per minute for document routes (`rate_limit_error`).
- `500`: Something failed on Drex's side (`internal_error`).
- `502`: The document service refused Drex's own request (`upstream_error`, code `ndi_refused_drex`). Retry later.
- `503`: The document service is unavailable (`service_unavailable`).

---

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