Facets

Define content types and attributes

Changed on

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:

  1. 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.
  2. Build from scratch: create your own trees, nodes, and attributes entirely with define_content_type and define_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 subtree
  • define_attribute: add or update a metadata field on a node
  • undefine_attribute: remove a metadata field

Building a tree from scratch, example flow:

  1. Create a root:
    {"action": "define_content_type", "code": "compliance", "label": "Compliance"}
    
  2. Add children:
    {"action": "define_content_type", "parent_path": "compliance", "code": "audit-report", "label": "Audit Report"}
    
  3. Add attributes:
    {"action": "define_attribute", "content_type_path": "compliance", "name": "owner", "attribute_type": "text"}
    
  4. 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.

post/api/v3/content-types

Request

  • Base URL
    https://api.lighton.ai
  • URL
    https://api.lighton.ai/api/v3/content-types
  • Auth
    HTTP bearer

Request body

action'adopt' | 'define_content_type' | 'undefine_content_type' | 'define_attribute' | 'undefine_attribute' required
content_typesstring[]
parent_pathstring nullable
codestring nullable
content_type_pathstring nullable

Colon-separated content type path.

labelstring nullable

Human-readable label for the node or attribute.

descriptionstring nullable

Optional descriptive text for the node or attribute.

inherit_attributesboolean nullable

Whether child content types inherit attributes from ancestors. Defaults to true on create.

namestring nullable

Attribute identifier in snake_case.

attribute_typestring nullable

Public attribute type. Supported values: text, number, date, boolean, select, multi-select, rich-text. Accepted aliases: multi_select, multiselect, rich_text, richtext.

requiredboolean nullable

Whether the attribute is required. Defaults to false.

choicesstring[] nullable

Required for select and multi-select attributes. Must be omitted for all other types.

Response

Action completed: existing node updated or already-present attribute replaced

OR
OR

Changes

    • breaking

      added required request body

    • info

      api operation id api_v3_content_types_create was added

    • info

      the endpoint scheme security bearerAuth was added to the API

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the success response with the status

    • info

      added the success response with the status

    • info

      added the success response with the status