Manage content types and attributes
Create, modify, and organise your company’s content-type trees and their attributes. Every action is idempotent, safe to re-run.
Two ways to build your schema:
- Adopt from starter templates: import ready-made trees from the seed
catalog (
GET /api/v3/content-types/templates). Once adopted, they’re yours to customize. - Build from scratch: create your own trees, nodes, and attributes
entirely with
define_content_typeanddefine_attribute.
You can mix both: adopt legal from the seeds, then add a custom
compliance tree alongside it. Each tree is independent.
Actions:
adopt: import trees from the seed catalog (starter templates)define_content_type: create or update a tree node (root or child)undefine_content_type: delete a node and its entire subtreedefine_attribute: add or update a metadata field on a nodeundefine_attribute: remove a metadata field
Building a tree from scratch, example flow:
- Create a root:
{"action": "define_content_type", "code": "compliance", "label": "Compliance"} - Add children:
{"action": "define_content_type", "parent_path": "compliance", "code": "audit-report", "label": "Audit Report"} - Add attributes:
{"action": "define_attribute", "content_type_path": "compliance", "name": "owner", "attribute_type": "text"} - Classify files via
POST /api/v3/files/{id}/facets:{"action": "classify", "content_type_path": "compliance:audit-report"}
Attributes are metadata fields you define on each node. Types:
text, number, date, boolean, select, multi-select, rich-text.
select and multi-select require choices. Attributes inherit down the
tree: define jurisdiction on legal and it’s available on all children.
Multi-classification: A single document can be classified under multiple
content types from different trees (e.g., both legal:contract:nda and
compliance:audit-report).
Available seed roots for adopt: finance, healthcare, legal, manufacturing, patent, sic, tech
Requires admin-level access to modify the company’s schema.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Request body for POST /api/v3/content-types.
Action-dispatched per FAC0012. Every action is idempotent.
Schema-side verb family:
adopt— bulk import from the Pydantic seed catalog.define_content_type/undefine_content_type— CRUD on tree nodes.define_attribute/undefine_attribute— CRUD on attribute columns.
Fields are validated per action in validate_fields_for_action — top-level
optionality mirrors the union of action shapes, so consumers only need a
single Pydantic class (friendly to drf-spectacular), but the validator
enforces the narrow contract per action, the same pattern used by
FileFacetActionRequest.
adopt, define_content_type, undefine_content_type, define_attribute, undefine_attribute Colon-separated content type path.
Human-readable label for the node or attribute.
Optional descriptive text for the node or attribute.
Whether child content types inherit attributes from ancestors. Defaults to true on create.
Attribute identifier in snake_case.
Public attribute type. Supported values: text, number, date, boolean, select, multi-select, rich-text. Accepted aliases: multi_select, multiselect, rich_text, richtext.
Whether the attribute is required. Defaults to false.
Required for select and multi-select attributes. Must be omitted for all other types.