curl --request POST \
--url https://api.lighton.ai/api/v3/content-types \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"action": "adopt",
"content_types": [
"legal",
"finance"
]
}
'{
"content_types": [
{
"path": "legal",
"code": "legal",
"label": "Legal",
"children": [
{
"path": "legal:contract",
"code": "contract",
"label": "Contract"
}
]
}
]
}Define 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.
Description best practices: The description field on attributes feeds
into the scope inference endpoint (POST /api/v3/content-types/scope),
where it helps the LLM generate accurate search filters. Use keywords that
signal the attribute’s nature:
- Person names: include “name”, “examiner”, “inventor”, or “author” →
enables
*value*wildcard syntax hints - Codes/identifiers: include “code”, “classification”, or “identifier” → enables exact-match hints (don’t guess from topic keywords)
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, tech
Requires admin-level access to modify the company’s schema.
curl --request POST \
--url https://api.lighton.ai/api/v3/content-types \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"action": "adopt",
"content_types": [
"legal",
"finance"
]
}
'{
"content_types": [
{
"path": "legal",
"code": "legal",
"label": "Legal",
"children": [
{
"path": "legal:contract",
"code": "contract",
"label": "Contract"
}
]
}
]
}Authorizations
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.