> ## 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.

# Submit a job

> Canonical job submission. Each entry in `sources[]` is one source file plus the ordered `steps[]` to run on it. Async (201) by default; set `sync: true` to wait up to ~27s.



## OpenAPI

````yaml /openapi.json post /jobs
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:
    post:
      tags:
        - Jobs
      summary: Submit a job
      description: >-
        Canonical job submission. Each entry in `sources[]` is one source file
        plus the ordered `steps[]` to run on it. Async (201) by default; set
        `sync: true` to wait up to ~27s.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JobsPost'
      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:
    JobsPost:
      title: POST /jobs
      description: >-
        Canonical job submission. Each entry in `sources[]` is a single source
        file plus the ordered `steps[]` to run on it. Step types compatible with
        the source's auto-detected fileType are kept; incompatible steps are
        recorded as `skipped` in the audit log. Async (201) by default; set
        `sync: true` to wait up to ~27 s for completion (200) or 202 + `pending:
        true` on timeout. An optional `webhook` is called when the job reaches a
        terminal status regardless of sync mode.
      type: object
      additionalProperties: false
      required:
        - sources
      properties:
        sources:
          type: array
          minItems: 1
          maxItems: 50
          items: e7259ca0-2880-4db6-b6fe-672b2142dd1b
          description: >-
            List of source files to process. Each becomes its own Task under a
            single Job.
        ruleId:
          type: string
          description: >-
            Optional Rule id (rule_xxx) recorded on the Job for downstream
            routing/reporting. Not consumed by the pipeline itself.
        channel:
          type: string
          enum:
            - api
            - store
            - admin
          default: api
        customerId:
          type:
            - string
            - 'null'
        orderId:
          type:
            - string
            - 'null'
        policy:
          type: object
          additionalProperties: false
          properties:
            onFail:
              type: string
              enum:
                - reject
                - accept_with_warnings
                - manual_review
              default: reject
        sync:
          type: boolean
          default: false
          description: >-
            When true, wait up to ~27 s for the job to reach a terminal status.
            Returns 200 with `{ job }` on completion or 202 with `pending: true`
            on timeout. Default false (async 201).
        webhook: 04008a1d-f6b1-45fa-bd15-deee4166365e
        metaData: c247009d-95a2-4f18-aa75-3de90f4e98a8
      $defs:
        stepType:
          type: string
          enum:
            - preflight
            - autofix
            - repreflight
            - validate
            - previews
            - optimize
            - convert
            - upscale
            - removebg
            - deliver
        step:
          type: object
          additionalProperties: false
          required:
            - type
          properties:
            type:
              $ref: '#/components/schemas/JobsPost/$defs/stepType'
            params:
              type:
                - object
                - 'null'
              description: >-
                Step-type-specific parameters. Validated by the action Lambda;
                unknown keys are ignored.
              additionalProperties: true
            label:
              type: string
              description: Optional human-friendly label echoed in the audit log.
        sourceObject:
          type: object
          additionalProperties: false
          required:
            - steps
          oneOf:
            - required:
                - url
            - required:
                - source
            - required:
                - file
            - required:
                - fileRef
          properties:
            url:
              type: string
              format: uri
              pattern: ^https?://
              description: Public or authenticated URL of the file.
            source:
              type: string
              description: URL or base64 file contents (alias for url|file).
            file:
              type: string
              contentEncoding: base64
              description: >-
                Inline base64-encoded file contents. String length must be ≤ 9.3
                MB. 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.
            headers:
              type: object
              description: >-
                Optional HTTP headers sent when fetching the URL (e.g.
                Authorization).
              additionalProperties:
                type: string
              maxProperties: 16
            params:
              type: object
              description: Free-form per-source extras carried through to the audit log.
              additionalProperties: true
            steps:
              type: array
              minItems: 1
              maxItems: 16
              items:
                $ref: '#/components/schemas/JobsPost/$defs/step'
              description: >-
                Ordered list of steps to run on this source. Steps execute
                sequentially; the runner threads a `currentArtifact` reference
                between steps.
            name:
              type: string
              description: Original filename hint (used when `file` is provided).
        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.

````