subdomains array.
Domain schema
A domain document contains the following fields:| Field | Type | Required | Description |
|---|---|---|---|
id | string (ObjectId) | Yes | MongoDB ObjectId, auto-generated |
name | string | Yes | Human-readable label, e.g. "Accommodation" |
color | string | Yes | Hex colour code used for UI theming, e.g. "#3B82F6" |
image | string | No | URL of a background or thumbnail image (default "") |
icon | string | No | URL or identifier of an icon asset (default "") |
subdomains | string[] | Yes | Ordered list of subdomain labels, e.g. ["Hotels", "Hostels"] |
Domain/subdomain hierarchy
The hierarchy is intentionally flat — there is no subdomain document or collection. Subdomains live entirely as string values in the parent domain’ssubdomains array.
subdomains array before saving the indicator.
Soft deletes
Domains use soft-delete semantics. A deleted domain hasdeleted: true set in MongoDB and is excluded from all read queries. The domain document itself is retained in the database.
Creating a domain
Domain object including the generated id.
Updating subdomains
Use aPUT request to replace the entire domain (including its subdomains list) or a PATCH request to update only specific fields:
Removing a subdomain string from the
subdomains array does not automatically delete indicators that reference that subdomain. The indicators will continue to exist with their subdomain field pointing to the removed string. Update or delete those indicators separately before removing the subdomain.Icon and image uploads
The service exposes a dedicated endpoint that proxies upload requests to the external knowledge-base service:multipart/form-data. The knowledge-base service stores the asset and returns a URL, which is then saved to the domain’s icon or image field.
Filtering indicators by domain and subdomain
Indicators can be listed scoped to a domain or a specific subdomain:governance_filter, sort_by, sort_order, skip, and limit query parameters as the top-level indicators endpoint.