Semantic Domains API
Create and manage semantic domains via the Semaphor API
Overview
The Semantic Domains API allows you to create, retrieve, update, and delete semantic domains programmatically. Semantic domains define project-wide data terminology, organizing tables and fields into logical business concepts.
Base path:
All endpoints require authentication with a Bearer token that includes project_id.
Access Control
Different operations require different token configurations:
| Operation | Token Requirements |
|---|---|
| List domains (GET) | Any token with projectId. Results filtered by semanticDomainAccess on the token. |
| Get domain (GET) | Any token with projectId. Honors semanticDomainAccess restrictions. |
| Create domain (POST) | Project token (type: "project") with orgUserId. User must be an Admin. Token must have unrestricted domain access (semanticDomainAccess omitted or mode: "all"). |
| Update domain (PUT/PATCH) | Project token with orgUserId. User must be an Admin. |
| Delete domain (DELETE) | Project token with orgUserId. User must be an Admin. |
Domain Object
Fields:
id: Unique domain identifierprojectId: The project this domain belongs toname: Identifier (lowercase letters and underscores only, unique per project)label: Human-readable display name (defaults tonameif not provided)description: Optional description (defaults to empty string)createdBy: Organization user ID who created the domain (nullable)createdAt: Timestamp in ISO 8601 format
Template management (relationships, calculated fields, joinability, discovery) is handled by separate sub-resource routes and is not part of this CRUD API.
Example: Create a Domain via API
1. Get a project token
2. Create a domain
Expected Response:
List Domains
GET /domains
- Returns all domains in the project that the token has access to.
- Results are filtered by
semanticDomainAccesswhen present on the token.
Example Request:
Example Response:
Create Domain
POST /domains
- Creates a new semantic domain in the project.
- Requires a project token with an Admin organization user.
- Token must have unrestricted domain access (
semanticDomainAccessomitted ormode: "all").
Request Body:
Required Fields:
name: Lowercase letters and underscores only, unique per projectlabel: Human-readable display name
Optional Fields:
description: Domain description (defaults to empty string)
Example Request:
Example Response:
Get Domain by ID
GET /domains/:domainId
- Returns a single domain's metadata.
- Honors
semanticDomainAccessrestrictions on the token.
Example Request:
Example Response:
Update Domain
PUT /domains/:domainId or PATCH /domains/:domainId
- Updates domain fields.
- At least one of
name,label, ordescriptionmust be provided. - Both PUT and PATCH behave identically (partial update).
- Requires a project token with an Admin organization user.
Request Body:
Example Request:
Example Response:
Delete Domain
DELETE /domains/:domainId
- Permanently deletes a domain.
- Requires a project token with an Admin organization user.
Example Request:
Example Response:
Error Handling
400 Bad Request:
401 Unauthorized:
403 Forbidden:
404 Not Found:
Notes
- All endpoints require authentication (Bearer token)
- Domain names must be lowercase letters and underscores only
- Domain names must be unique within each project
- Read operations honor
semanticDomainAccessrestrictions on the token - Write operations require a project token with an organization user who has the Admin role
- Creating new domains additionally requires unrestricted domain access on the token
- All timestamps are returned in ISO 8601 format
- The
labelfield defaults tonamewhen not explicitly set - Template management (relationships, calculated fields) uses separate sub-resource routes