Facets

Batch classify and set attribute values

Changed on

Execute multiple file facet actions in a single request.

All actions are validated upfront before any execution begins. If any action has invalid fields, the entire batch is rejected with a 422 response and no actions are executed.

On domain errors (e.g., unknown content type, sibling conflict), the batch fails fast at the failing action. The error response includes an "index" field (0-based) indicating which action caused the failure. Actions before the failing index are committed; their results are not returned. All verbs are idempotent — it is safe to re-send the entire batch after fixing the error.

Request: {"actions": [<action>, <action>, ...]}

Each action object follows the same schema as the single-action POST /api/v3/files/{file_id}/facets endpoint. Maximum 50 actions per batch.

Response: {"results": [{"status": <code>, "data": <body|null>}, ...]}

Results are in the same order as the input actions. The data key is null for 204 actions (unclassify, clear_value).

See POST /api/v3/files/{file_id}/facets for available actions and their fields.

Requires edit access to the file.

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

Request

  • Base URL
    https://api.lighton.ai
  • URL
    https://api.lighton.ai/api/v3/files/{file_id}/facets/batch
  • Auth
    HTTP bearer

Path parameters

file_idinteger required

Request body

Response

All actions executed successfully

Changes