v1

latestOpenAPI 3.1.02026-07-263580186.3 KB
Facets

Classify a file and set attributes

Apply content-type classifications to a file and set attribute values (metadata) on it. This is how you tag a document with structured metadata from your content-type schema.

Typical workflow:

  1. Classify the file: {"action": "classify", "content_type_path": "legal:contract:nda"}
  2. Set attribute values: {"action": "set_value", "content_type_path": "legal:contract:nda", "attribute_name": "jurisdiction", "value": ["FR", "DE"]}
  3. Read back with GET /api/v3/files/{file_id}/facets

A file can be classified under multiple content types. Just call classify for each one. Removing a classification (unclassify) cascades: all attribute values under that content type are removed too.

Actions:

  • classify: assign a content type to the file (idempotent)
  • unclassify: remove a content type and all its attribute values
  • set_value: set or update an attribute value (the content type must be classified first)
  • clear_value: remove an attribute value

Value types for set_value:

  • text / rich-text → string
  • number → number or numeric string
  • date → date string, normalized to YYYY-MM-DD
  • booleantrue / false
  • select → one string from choices
  • multi-select → array of strings from choices

To clear a value, use clear_value (not set_value with null).

Prerequisites: Content types must be set up first. See GET /api/v3/content-types/templates (browse templates) and POST /api/v3/content-types (adopt or create).

Requires edit access to the file.

post/api/v3/files/{file_id}/facets

Path parameters

file_idinteger required

Request body

action'classify' | 'unclassify' | 'set_value' | 'clear_value' required
content_type_pathstring required

Assigned content type path, e.g. legal:contract:nda.

attribute_namestring nullable

Attribute identifier in snake_case.

{"stackTrail":"components:schemas:FileFacetActionRequest:properties:value","oasType":"schema","type":"unknown","title":"Value","description":"Attribute value for set_value. Shape depends on attribute type: text/rich-text=string, number=number, date=date string (YYYY-MM-DD), boolean=true/false, select=string from choices, multi-select=array of strings from choices."}

Response

Content type already classified, or attribute value updated

OR