{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/warplink-app/json-schema/warplink-app-export-job-schema.json",
  "title": "ExportJob",
  "description": "A click export job and its manifest. The same object is returned when the job is created, while it runs, and after it completes.",
  "x-generated": "2026-11-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/warplink-app-openapi.json#/components/schemas/ExportJob",
  "type": "object",
  "properties": {
    "job_id": {
      "type": "string",
      "format": "uuid"
    },
    "snapshot_id": {
      "type": "string",
      "format": "uuid",
      "description": "Equal to job_id."
    },
    "org_id": {
      "type": "string",
      "format": "uuid"
    },
    "status": {
      "type": "string",
      "enum": [
        "created",
        "cut",
        "running",
        "complete",
        "failed"
      ],
      "description": "There is no expired status: a job is expired once expires_at has passed."
    },
    "error": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "too_large",
        "assumption_violated",
        "attempts_exhausted",
        "storage_unavailable",
        "abandoned",
        null
      ],
      "description": "Set when status is failed."
    },
    "scope": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "org",
        "own_links",
        null
      ],
      "description": "The role scope applied to the rows."
    },
    "filters": {
      "type": [
        "object",
        "null"
      ],
      "description": "Request filters, such as linkId for a single-link export."
    },
    "window_requested_from": {
      "type": "string",
      "format": "date-time"
    },
    "window_requested_to": {
      "type": "string",
      "format": "date-time"
    },
    "window_from": {
      "type": "string",
      "format": "date-time",
      "description": "The window actually exported, after the plan's data retention was applied."
    },
    "window_to": {
      "type": "string",
      "format": "date-time"
    },
    "retention_days": {
      "type": [
        "integer",
        "null"
      ]
    },
    "clipped": {
      "type": "boolean",
      "description": "True when the requested window was narrowed to the plan's data retention."
    },
    "clipped_reason": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "retention",
        null
      ]
    },
    "cut_snapshot": {
      "type": [
        "string",
        "null"
      ],
      "description": "The database snapshot the export was cut at. Rows committed after it are never in this export."
    },
    "cut_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "server_version_num": {
      "type": [
        "integer",
        "null"
      ]
    },
    "membership_max_rows": {
      "type": "integer",
      "description": "The most rows one export may hold. A larger request fails as too_large."
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "completed_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time",
      "description": "Downloads stop working at this time."
    },
    "expired_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the stored file was removed after expiry."
    },
    "completeness": {
      "type": "string",
      "enum": [
        "unmeasured",
        "measured"
      ]
    },
    "complete_through": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "rows_in_cut": {
      "type": [
        "integer",
        "null"
      ]
    },
    "rows_written": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Data rows in the file."
    },
    "deletions_observed": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Rows in the cut that were deleted before their page was read. rows_written plus deletions_observed equals rows_in_cut."
    },
    "first_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "last_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "order": {
      "type": "string",
      "enum": [
        "id asc"
      ]
    },
    "columns": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "schema_version": {
      "type": "integer"
    },
    "page_width": {
      "type": [
        "integer",
        "null"
      ]
    },
    "page_count": {
      "type": [
        "integer",
        "null"
      ]
    },
    "pages": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "page": {
            "type": "integer"
          },
          "seq_from": {
            "type": "integer"
          },
          "seq_to": {
            "type": "integer"
          },
          "rows": {
            "type": "integer"
          },
          "bytes": {
            "type": "integer"
          },
          "sha256": {
            "type": "string"
          },
          "first_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "unknown_counts": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          }
        }
      }
    },
    "sha256": {
      "type": [
        "string",
        "null"
      ],
      "description": "SHA-256 of the whole file. Every download of a complete job returns identical bytes with this checksum."
    },
    "unknown_counts": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      },
      "description": "Per column, the number of empty cells."
    }
  }
}