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

# What an on-demand run would do, without running it



## OpenAPI

````yaml post /api/maintenance/runs/preview
openapi: 3.1.0
info:
  title: Nx1 AI API
  description: |

    AI API for Nx1 Data Platform Management and Automated Data Tasks.

    Authentication is required via PSK in Authorization header.

    Default PSK is | [ask a friend] |
  version: 0.10.2
servers: []
security: []
paths:
  /api/maintenance/runs/preview:
    post:
      tags:
        - Iceberg maintenance
      summary: What an on-demand run would do, without running it
      operationId: preview_run_api_maintenance_runs_preview_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RunRequestIn'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RunPreviewOut'
        '403':
          description: Not allowed (role, platform key, or Ranger denies alter).
        '404':
          description: Unknown catalog, table or run.
        '422':
          description: Invalid scope, operations or overrides.
        '502':
          description: Airflow couldn't be reached.
        '503':
          description: Maintenance is off, its DAG is paused, or the access check is down.
      security:
        - OAuth2AuthorizationCodeBearer: []
        - APIKeyHeader: []
components:
  schemas:
    RunRequestIn:
      properties:
        scope:
          $ref: '#/components/schemas/RunScopeIn'
        operations:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Operations
          description: >-
            Operations to run: compaction, compact_deletes, rewrite_manifests,
            expire_snapshots, remove_orphans. Leave out to run every operation
            the policy enables.
        mode:
          type: string
          enum:
            - if_needed
            - force
          title: Mode
          description: >-
            if_needed skips the schedule but keeps the trigger conditions, so
            healthy tables are reported as skipped:healthy. force runs the
            selected operations regardless.
          default: if_needed
        dry_run:
          type: boolean
          title: Dry Run
          description: >-
            Run orphan removal as a dry run. The other operations have no
            dry-run mode; use the preview to see what would run.
          default: false
        overrides:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Overrides
          description: >-
            Policy fields for this run only. Never saved; locks and floors still
            apply. null is the same as {}.
        overrides_yaml:
          anyOf:
            - type: string
              maxLength: 100000
            - type: 'null'
          title: Overrides Yaml
          description: >-
            The same overrides as YAML (the portal sends this). Not with
            overrides.
        priority:
          anyOf:
            - type: string
              enum:
                - low
                - normal
                - high
            - type: 'null'
          title: Priority
          description: Overrides the policy's priority for this run.
        ignore_window:
          type: boolean
          title: Ignore Window
          description: Run outside the maintenance window.
          default: false
      additionalProperties: false
      type: object
      required:
        - scope
      title: RunRequestIn
      description: An on-demand maintenance run (§5.5).
    RunPreviewOut:
      properties:
        tables:
          items:
            $ref: '#/components/schemas/TablePreviewOut'
          type: array
          title: Tables
        tables_in_scope:
          type: integer
          title: Tables In Scope
        tables_to_run:
          type: integer
          title: Tables To Run
        operations_to_run:
          additionalProperties:
            type: integer
          type: object
          title: Operations To Run
        warnings:
          items:
            type: string
          type: array
          title: Warnings
      type: object
      required:
        - tables
        - tables_in_scope
        - tables_to_run
        - operations_to_run
      title: RunPreviewOut
      description: What an on-demand run would do, without doing it.
    RunScopeIn:
      properties:
        catalog:
          type: string
          maxLength: 128
          minLength: 1
          title: Catalog
          description: The catalog to maintain.
        namespace:
          anyOf:
            - type: string
              maxLength: 512
              minLength: 1
            - type: 'null'
          title: Namespace
          description: One schema (namespace). Nested namespaces under it are included.
        namespaces:
          anyOf:
            - items:
                type: string
              type: array
              maxItems: 100
            - type: 'null'
          title: Namespaces
          description: Several schemas. Nested namespaces under each are included.
        tables:
          anyOf:
            - items:
                type: string
              type: array
              maxItems: 1000
            - type: 'null'
          title: Tables
          description: >-
            Tables, as bare names with exactly one namespace given, or as
            namespace.table (the last dot separates the table).
      additionalProperties: false
      type: object
      required:
        - catalog
      title: RunScopeIn
      description: >-
        What an on-demand run covers: a catalog, schemas, or tables.


        Combinations (namespace vs namespaces, bare table names) are checked by

        ``OnDemandService`` so the answer can name the offending field (422
        issues).
    TablePreviewOut:
      properties:
        registration_id:
          type: string
          format: uuid
          title: Registration Id
        table:
          type: string
          title: Table
        role:
          type: string
          title: Role
        health:
          anyOf:
            - type: integer
            - type: 'null'
          title: Health
        error_kind:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Kind
        est_bytes:
          type: integer
          title: Est Bytes
          default: 0
        score:
          type: number
          title: Score
          default: 0
        policy_version:
          type: string
          title: Policy Version
        operations:
          items:
            $ref: '#/components/schemas/OpPreviewOut'
          type: array
          title: Operations
      type: object
      required:
        - registration_id
        - table
        - role
        - policy_version
        - operations
      title: TablePreviewOut
      description: What a run would do on one table.
    OpPreviewOut:
      properties:
        operation:
          type: string
          title: Operation
        action:
          type: string
          enum:
            - run
            - skip
            - not_due
            - outside_window
          title: Action
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
        reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Reason
        dry_run:
          type: boolean
          title: Dry Run
          default: false
        triggers:
          items:
            type: string
          type: array
          title: Triggers
      type: object
      required:
        - operation
        - action
      title: OpPreviewOut
      description: What one operation would do on one table.
  securitySchemes:
    OAuth2AuthorizationCodeBearer:
      type: oauth2
      flows:
        authorizationCode:
          scopes: {}
          authorizationUrl: >-
            https://sso-rapid.rapid.nx1cloud.com/realms/rapid/protocol/openid-connect/auth
          tokenUrl: >-
            https://sso-rapid.rapid.nx1cloud.com/realms/rapid/protocol/openid-connect/token
    APIKeyHeader:
      type: apiKey
      in: header
      name: Authorization-PSK

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.