{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cliponit-app/json-schema/cliponit-app-export-schema.json",
  "title": "Export",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cliponit-app-openapi.yml#/components/schemas/Export",
  "type": "object",
  "required": [
    "id",
    "clip_id",
    "orientation",
    "status",
    "progress",
    "created_at"
  ],
  "properties": {
    "id": {
      "$ref": "#/$defs/Uuid"
    },
    "clip_id": {
      "$ref": "#/$defs/Uuid"
    },
    "user_id": {
      "$ref": "#/$defs/Uuid"
    },
    "orientation": {
      "$ref": "#/$defs/Orientation"
    },
    "status": {
      "type": "string",
      "enum": [
        "queued",
        "running",
        "done",
        "failed",
        "canceled"
      ]
    },
    "progress": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100,
      "description": "Render progress in %"
    },
    "eta_s": {
      "type": [
        "number",
        "null"
      ],
      "description": "Estimated seconds left while `queued`/`running`: moving-average render ratio of the last 10 finished exports × (remaining clip seconds + clips ahead in the queue); null otherwise"
    },
    "started_at": {
      "type": [
        "string",
        "null"
      ]
    },
    "finished_at": {
      "type": [
        "string",
        "null"
      ]
    },
    "url": {
      "type": [
        "string",
        "null"
      ],
      "description": "`/files/exports/<id>.mp4` once `done` (relative to the server base URL)"
    },
    "output_path": {
      "type": [
        "string",
        "null"
      ]
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "created_at": {
      "type": "string"
    }
  },
  "$defs": {
    "Orientation": {
      "type": "string",
      "enum": [
        "vertical",
        "horizontal",
        "square",
        "portrait45"
      ],
      "default": "vertical",
      "description": "vertical = 9:16 1080x1920 (TikTok/Reels/Shorts), horizontal = 16:9 1920x1080 (YouTube), square = 1:1 1080x1080 (feed), portrait45 = 4:5 1080x1350 (Instagram feed). auto-reframe supports vertical|horizontal only."
    },
    "Uuid": {
      "type": "string",
      "format": "uuid"
    }
  }
}