{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/skycloak-io/json-schema/skycloak-io-export-schema.json",
  "title": "Export",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/skycloak-io-openapi.yaml#/components/schemas/Export",
  "type": "object",
  "required": [
    "id",
    "cluster_id",
    "format",
    "status",
    "expires_at",
    "created_at",
    "started_at",
    "completed_at",
    "progress",
    "include_credentials",
    "is_encrypted",
    "file_size_bytes",
    "sha256_checksum",
    "download_url",
    "error_message"
  ],
  "properties": {
    "id": {
      "$ref": "#/$defs/ExportId"
    },
    "cluster_id": {
      "$ref": "#/$defs/ClusterId"
    },
    "format": {
      "$ref": "#/$defs/ExportFormat"
    },
    "status": {
      "$ref": "#/$defs/ExportStatus"
    },
    "expires_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the archive will be deleted from storage."
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "started_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "completed_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "progress": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100,
      "description": "Completion percentage of the export job, from 0 to 100."
    },
    "include_credentials": {
      "type": "boolean",
      "description": "Whether the dump includes the `credential` and related Keycloak tables."
    },
    "is_encrypted": {
      "type": "boolean",
      "description": "Whether the archive is AES-256-CBC encrypted with the password provided at creation time."
    },
    "file_size_bytes": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Size of the produced ZIP archive in bytes. Only set once `status` is `completed`."
    },
    "sha256_checksum": {
      "type": [
        "string",
        "null"
      ],
      "x-oapi-codegen-extra-tags": {
        "validate": "omitnil,max=500"
      },
      "description": "SHA-256 checksum of the produced ZIP archive (hex). Only set once `status` is `completed`."
    },
    "download_url": {
      "type": [
        "string",
        "null"
      ],
      "x-oapi-codegen-extra-tags": {
        "validate": "omitnil,max=500"
      },
      "format": "uri",
      "description": "Time-limited presigned URL to download the archive. Only set when `status` is `completed` and `expires_at` is in the future. Returned URLs are valid for at least one hour."
    },
    "error_message": {
      "type": [
        "string",
        "null"
      ],
      "x-oapi-codegen-extra-tags": {
        "validate": "omitnil,max=500"
      },
      "description": "Failure description. Only set when `status` is `failed`."
    }
  },
  "$defs": {
    "ClusterId": {
      "type": "string",
      "format": "uuid"
    },
    "ExportFormat": {
      "type": "string",
      "enum": [
        "sql",
        "pgdump"
      ]
    },
    "ExportId": {
      "type": "string",
      "format": "uuid"
    },
    "ExportStatus": {
      "type": "string",
      "enum": [
        "pending",
        "processing",
        "completed",
        "failed"
      ]
    }
  }
}