---
title: "generate_domain"
method: POST
path: "/v1/domains/generate"
tags: ["domains"]
---

# generate_domain

`POST /v1/domains/generate`

## Request

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

Draft a taxonomy from a description or Parse job. Cost class: slow.

Synchronous and **non-persisting**: the model proposes a taxonomy the author
edits, then posts to ``POST /v1/domains``. Nothing is written to the
database and no job is created. Kept off MCP because authoring is a reviewed
human act, not an agent-loop step.

## Request body

- GenerateDomainRequest: Ask the model for an unsaved taxonomy draft. Nothing is persisted: the caller edits the draft, then posts it to ``POST /v1/domains``. Optional ``display_name`` / ``slug`` seed the suggested identity fields returned alongside the taxonomy. Exactly one input is required: a written description, or a succeeded Parse job.
  - `description` string, nullable: What kinds of files belong in this domain — the classifier-facing brief.
  - `display_name` string, nullable: Optional name hint used when suggesting a display name and slug.
  - `sheet_name` string, nullable: Workbook worksheet to extract. Required when the Parse result contains multiple sheets.
  - `slug` string, nullable: Optional slug hint. When omitted, the model derives one from the input.
  - `source` ParseResultSource: A prior Parse job whose parsed artifact can be reused by downstream methods.
    - `job_id` string, uuid, required: Succeeded parse job whose artifact should be reused.
    - `type` 'parse_result'

## Response `200`

Successful Response

- GenerateDomainResponse: An unsaved draft ready for the authoring UI to edit and then create.
  - `suggested_display_name` string, required
  - `suggested_slug` string, 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
  - `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)
