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:
- Classify the file:
{"action": "classify", "content_type_path": "legal:contract:nda"} - Set attribute values:
{"action": "set_value", "content_type_path": "legal:contract:nda", "attribute_name": "jurisdiction", "value": ["FR", "DE"]} - 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 valuesset_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→ stringnumber→ number or numeric stringdate→ date string, normalized toYYYY-MM-DDboolean→true/falseselect→ one string fromchoicesmulti-select→ array of strings fromchoices
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.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
Write operation for a file's facets (classifications + attribute values).
Explicit verb-noun actions per FAC0012:
classify/unclassify: T2 (file ↔ content type)set_value/clear_value: T3 (attribute value under an assigned content type)
Value actions require attribute_name; classification actions require only
content_type_path.
classify, unclassify, set_value, clear_value Assigned content type path, e.g. legal:contract:nda.
Attribute identifier in snake_case.
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.