> ## Documentation Index
> Fetch the complete documentation index at: https://docs.filecheck.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Validate a file

> Sugar wrapper. Validates a file against one or more PDF/A or PDF/UA conformance levels. Sync by default; set `async: true` to return 201 immediately.



## OpenAPI

````yaml /openapi.json post /jobs/validate
openapi: 3.1.0
info:
  title: Filecheck API
  version: 1.0.0
  description: >-
    The Filecheck REST API. Submit files as jobs, fetch results, and read your
    workflows, rules, connectors, profiles, and optimize presets. All requests
    are authenticated server-side with your secret key (`sk_live_…`).
servers:
  - url: https://api.filecheck.io
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Jobs
    description: >-
      Submit files for preflight, fixing, optimization, validation, and
      previews.
  - name: Uploads
    description: Mint presigned credentials to upload large files directly.
  - name: Orders
    description: Attach jobs to commerce orders.
  - name: Workflows
  - name: Connectors
  - name: Rules
  - name: Profiles
  - name: OptimizePresets
paths:
  /jobs/validate:
    post:
      tags:
        - Jobs
      summary: Validate a file
      description: >-
        Sugar wrapper. Validates a file against one or more PDF/A or PDF/UA
        conformance levels. Sync by default; set `async: true` to return 201
        immediately.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JobsValidatePost'
      responses:
        '200':
          description: 'Sync completion (sync: true)'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobResponse'
        '201':
          description: Accepted, processing asynchronously
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobResponse'
        '202':
          description: Sync timed out; still pending
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobPendingResponse'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing or invalid key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: A referenced fileRef is not owned by the caller
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    JobsValidatePost:
      title: POST /jobs/validate
      description: >-
        Validate one or more files against PDF/A or PDF/UA conformance levels.
        Each source carries its own `profile` (one or more codes). The request
        is synchronous by default — the response is 200 with `{ job }` on
        completion, or 202 with `pending: true` if the job does not finish
        within ~27 s. An optional `webhook` is called when the job reaches a
        terminal status.
      type: object
      additionalProperties: false
      required:
        - sources
      properties:
        sources:
          type: array
          minItems: 1
          maxItems: 50
          items: 3cc7aa19-0939-4cc9-8c15-cc8df842f1e8
          description: >-
            List of files to validate. Each item must include a `profile` field.
            Even a single file must be wrapped in an array.
        async:
          type: boolean
          default: false
          description: >-
            When true, return 201 immediately with `{ job, pending: true }` and
            let the webhook (if any) deliver the terminal result. When false
            (default), the request is synchronous — 200 on completion, or 202
            with `pending: true` if the job does not finish within ~27 s.
        webhook: d56949a8-e577-4c4f-bd5b-9ce7ec4cb1d3
        metaData: 1091ce85-cd58-4811-9b3c-26e184127860
      $defs:
        profileCode:
          type: string
          enum:
            - auto
            - 1a
            - 1b
            - 2a
            - 2b
            - 2u
            - 3a
            - 3b
            - 3u
            - '4'
            - 4e
            - 4f
            - ua1
            - ua2
          description: >-
            PDF/A or PDF/UA conformance level code, or 'auto' to let the
            validator infer the closest matching profile from the file itself.
            PDF/A: 1a 1b 2a 2b 2u 3a 3b 3u 4 4e 4f. PDF/UA: ua1 ua2.
        source:
          oneOf:
            - type: string
              format: uri
              pattern: ^https?://
              description: Public or authenticated URL of the file.
            - $ref: '#/components/schemas/JobsValidatePost/$defs/sourceObject'
        sourceObject:
          type: object
          additionalProperties: false
          oneOf:
            - required:
                - url
            - required:
                - file
            - required:
                - fileRef
          properties:
            url:
              type: string
              format: uri
              pattern: ^https?://
              description: Public or authenticated URL of the file.
            file:
              type: string
              contentEncoding: base64
              description: >-
                Inline base64-encoded file contents. String length must be ≤ 9.3
                MB (the ~7 MB decoded equivalent). Prefer `url` or `fileRef` for
                large files.
            fileRef:
              type: string
              pattern: ^upload_[A-Za-z0-9._-]+$
              description: >-
                Reference id returned by POST /uploads. Use for large files to
                avoid body-size limits.
            profile:
              description: >-
                One or more conformance level codes to validate this file
                against. Optional — when omitted, defaults to 'auto' which
                infers the closest matching profile from the file itself.
              oneOf:
                - $ref: '#/components/schemas/JobsValidatePost/$defs/profileCode'
                - type: array
                  minItems: 1
                  uniqueItems: true
                  items:
                    $ref: '#/components/schemas/JobsValidatePost/$defs/profileCode'
            headers:
              type: object
              description: >-
                Optional HTTP headers sent when fetching the URL (e.g.
                Authorization).
              additionalProperties:
                type: string
              maxProperties: 16
            name:
              type: string
              description: Original filename hint (used when `file` is provided).
            mimeType:
              type: string
              description: MIME type hint (e.g. application/pdf).
        webhook:
          type: object
          additionalProperties: false
          required:
            - url
          description: >-
            Endpoint called when the job reaches a terminal status (done |
            skipped | error). Inspect the separate `outcome` field for the
            verdict.
          properties:
            url:
              type: string
              format: uri
              pattern: ^https?://
              description: HTTPS endpoint to POST the job result to.
            headers:
              type: object
              description: >-
                Optional headers sent with the webhook callback (e.g.
                Authorization).
              additionalProperties:
                type: string
              maxProperties: 16
        metaData:
          type: object
          description: >-
            Free-form caller context echoed back on the response and on webhook
            callbacks. JSON-serialized payload must be ≤ 4 KB.
          additionalProperties: true
    JobResponse:
      type: object
      properties:
        job:
          $ref: '#/components/schemas/Job'
    JobPendingResponse:
      type: object
      properties:
        pending:
          type: boolean
        job:
          $ref: '#/components/schemas/Job'
    Error:
      type: object
      properties:
        error:
          type: boolean
        message:
          type: string
    Job:
      type: object
      properties:
        id:
          type: string
        createdAt:
          type:
            - string
            - 'null'
        modifiedAt:
          type:
            - string
            - 'null'
        status:
          type: string
          description: idle, incomplete, uploading, processing, ready, partial, rejected
        outcome:
          type:
            - string
            - 'null'
        channel:
          type:
            - string
            - 'null'
          enum:
            - api
            - store
            - admin
            - null
        ruleId:
          type:
            - string
            - 'null'
        workflowId:
          type:
            - string
            - 'null'
        metaData:
          type:
            - object
            - 'null'
        tasks:
          type: array
          items:
            $ref: '#/components/schemas/Task'
        orderId:
          type:
            - string
            - 'null'
        customerId:
          type:
            - string
            - 'null'
        customerEmail:
          type:
            - string
            - 'null'
        summary:
          type: object
          description: Present on non-lean responses.
        results:
          type: object
          description: >-
            Aggregated validate / preflight / optimize results on non-lean
            responses.
    Task:
      type: object
      properties:
        id:
          type: string
        createdAt:
          type:
            - string
            - 'null'
        updatedAt:
          type:
            - string
            - 'null'
        status:
          type: string
        outcome:
          type:
            - string
            - 'null'
        fileType:
          type:
            - string
            - 'null'
        mimeType:
          type:
            - string
            - 'null'
        source:
          type:
            - string
            - 'null'
        fileRef:
          type:
            - string
            - 'null'
        clientRef:
          type:
            - string
            - 'null'
        jobId:
          type:
            - string
            - 'null'
        originalArtifact:
          type:
            - object
            - 'null'
        outputArtifacts:
          type: array
          items:
            $ref: '#/components/schemas/OutputArtifact'
        steps:
          type: array
          items:
            $ref: '#/components/schemas/Step'
    OutputArtifact:
      type: object
      properties:
        kind:
          type: string
        role:
          type: string
        bucket:
          type: string
        key:
          type: string
        downloadUrl:
          type:
            - string
            - 'null'
        expiresIn:
          type:
            - integer
            - 'null'
    Step:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
          description: preflight, repreflight, autofix, optimize, validate, previews, proof
        status:
          type: string
        outcome:
          type:
            - string
            - 'null'
          enum:
            - pass
            - warn
            - fail
            - null
        reason:
          type:
            - string
            - 'null'
        params:
          type:
            - object
            - 'null'
        runtimeParams:
          type:
            - object
            - 'null'
        started:
          type:
            - string
            - 'null'
        ended:
          type:
            - string
            - 'null'
        duration:
          type:
            - number
            - 'null'
        outputs:
          type: array
          items:
            type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your secret key as a bearer token, e.g. `Authorization: Bearer
        sk_live_…`. Secret keys are server-side only.

````