File

Validate an uploaded file against one or more document validation rules (validation-rules-api rules with input_type: document).

The file is referenced either by its file entity id or, for an upload that has not been saved as an entity yet (e.g. a journey upload in the temporary prefix), by its S3 reference. The service collects an observation of the file - deterministic facts such as the sniffed mime type, size, page count, image resolution, blank and password-protection detection - and evaluates every rule against it with the shared validation rules engine.

The response carries one result per rule with a per-condition outcome (pass, fail, uncertain, skipped), plus the observation the results were derived from. status is completed for checks that finish synchronously; pending is reserved for check levels that need asynchronous content extraction.

post/v1/files/validations

Request

  • Base URL
    https://file.sls.epilot.io
  • URL
    https://file.sls.epilot.io/v1/files/validations
  • Auth
    • HTTP bearer
    • or API key in cookie token

Request body

rule_idsstring[] required

Document validation rules to evaluate. Rules of another input type are rejected.

Example request

{
  "file": {
    "s3ref": {
      "bucket": "epilot-prod-user-content",
      "key": "123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf"
    }
  }
}

Response

The validation result

idstring required

Identifier of this validation run.

status'completed' | 'pending' | 'failed' | 'skipped' required

completed when every rule was evaluated. pending is reserved for check levels that need asynchronous content extraction; failed when the observation could not be produced; skipped when document validation is not enabled for the organisation - the file was not read and results is empty, so callers treat the file as accepted.

created_atstring date-time required

Example response

{
  "file": {
    "s3ref": {
      "bucket": "epilot-prod-user-content",
      "key": "123/4d689aeb-1497-4410-a9fe-b36ca9ac4389/document.pdf"
    }
  }
}

Changes