← Back to Library

Def-Store API

api ·  integrators
def-storeterminologyontologyterm-relationsimport-exportaudit-logapi

Def-Store API

What it is. The def-store owns WIP's controlled vocabularies: terminologies (a named vocabulary, e.g. DOC_STATUS) and their terms (draft, approved, …), plus typed term relations (is_a, part_of, maps_to, related_to, finding_site, causative_agent, or any custom type) that let terms form an ontology graph. It also imports/exports terminologies (JSON, CSV, and OBO Graph JSON ontologies such as HPO/GO/CHEBI), keeps a per-term audit log of every change, and validates caller-supplied values against a terminology (including alias matches and close-match suggestions). Terminologies and terms are registered with the Registry service to get unique, system-wide IDs; the ID scheme is configurable per namespace (default UUID7).

Reaching it. Base path /api/def-store, aggregating five sub-routers: /terminologies, a set of unprefixed term/validate routes, /import-export, /audit, and /ontology. Every endpoint depends on require_api_key (re-exported from the shared wip_auth library) and requires an API key via the X-API-Key header (the service's OpenAPI ApiKeyAuth security scheme). See also: Auth & Access; Routing & Ingress.

Conventions that apply. Every write endpoint here is bulk-first: POST/PUT/DELETE bodies are arrays, and the store always answers 200 OK with a BulkResponse envelope (results, total, succeeded, failed) — a 200 does not mean every item in the array succeeded; check each BulkResultItem.status/error/error_code. Namespace scoping applies throughout but its shape varies by endpoint: entity-mutating and traversal endpoints require an explicit namespace query parameter, list/read endpoints accept an optional namespace (omitted → every namespace the caller can access, via resolve_namespace_filter), and the recent-audit-log / cross-namespace export endpoints resolve the caller's full accessible-namespace set via resolve_accessible_namespaces (a superadmin key gets no filter — every namespace). Def-store does not use document-store's identity-hash / natural-upsert model: terminology and term IDs are minted by the Registry on create (or supplied pre-assigned for restore/migration), and re-submitting an existing value either errors or, with on_conflict=validate, returns an idempotent status=unchanged rather than a new version. See also: API Conventions; PoNIFs.

Endpoints

POST /api/def-store/terminologies

GET /api/def-store/terminologies

GET /api/def-store/terminologies/by-value/{value}

GET /api/def-store/terminologies/{terminology_id}

PUT /api/def-store/terminologies

GET /api/def-store/terminologies/{terminology_id}/dependencies

POST /api/def-store/terminologies/{terminology_id}/restore

DELETE /api/def-store/terminologies

POST /api/def-store/terminologies/{terminology_id}/terms

GET /api/def-store/terminologies/{terminology_id}/terms

GET /api/def-store/terms/{term_id}

PUT /api/def-store/terms

POST /api/def-store/terms/deprecate

DELETE /api/def-store/terms

POST /api/def-store/validate

POST /api/def-store/validate/bulk

GET /api/def-store/import-export/export/{terminology_id}

GET /api/def-store/import-export/export

POST /api/def-store/import-export/import

POST /api/def-store/import-export/import-ontology

POST /api/def-store/import-export/import/url

GET /api/def-store/audit/terms/{term_id}

GET /api/def-store/audit/terminologies/{terminology_id}

GET /api/def-store/audit

POST /api/def-store/ontology/term-relations

GET /api/def-store/ontology/term-relations

DELETE /api/def-store/ontology/term-relations

GET /api/def-store/ontology/term-relations/all

GET /api/def-store/ontology/terms/{term_id}/ancestors

GET /api/def-store/ontology/terms/{term_id}/descendants

GET /api/def-store/ontology/terms/{term_id}/parents

GET /api/def-store/ontology/terms/{term_id}/children

Store-specific gotchas

See also

Generated from real source code, not hand-written — see the WIP Technical Library.