{
  "openapi": "3.0.3",
  "info": {
    "title": "INI Opt Product API",
    "version": "1.3.2",
    "description": "API v1 integration contract for internal product backends. Image-only optimization on INI infrastructure. Documentation is public; product requests require a dedicated bearer key. Dashboard login and key administration are intentionally outside this integration contract. Contract 1.1.0 changes the omitted preset default from product-photo to none. To preserve earlier defaults, explicitly send preset=product-photo. Adds resize_percent, preserve_transparency and progressive_jpeg. PNG encoding includes a best-effort lossless OxiPNG pass, retaining the smaller candidate. This pass preserves all pixel values, runs only up to 16 million output pixels / 64 MiB encoded data, and falls back to Sharp on failure or after 10 seconds. Existing metadata removal, source-reuse safeguards, input limits and request/response fields are unchanged. Contract 1.3.2 decodes ordinary multipart filenames as UTF-8 and preserves Unicode letters in ZIP entries; individual downloads include UTF-8 Content-Disposition filename*."
  },
  "servers": [
    {
      "url": "https://opt.iniapp.com"
    }
  ],
  "security": [
    {
      "ProductKey": []
    }
  ],
  "tags": [
    {
      "name": "Images"
    },
    {
      "name": "Health"
    }
  ],
  "externalDocs": {
    "description": "Agent integration guide",
    "url": "https://opt.iniapp.com/docs/integration.md"
  },
  "paths": {
    "/healthz": {
      "get": {
        "operationId": "getHealth",
        "summary": "Check service health",
        "tags": [
          "Health"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "ok"
                      ]
                    }
                  },
                  "required": [
                    "status"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/presets": {
      "get": {
        "operationId": "listPresets",
        "summary": "Get presets and current limits",
        "tags": [
          "Images"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Presets"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/jobs": {
      "post": {
        "operationId": "createJob",
        "summary": "Submit one image for asynchronous optimization",
        "tags": [
          "Images"
        ],
        "responses": {
          "202": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request, options, multipart input or upload size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request body exceeds the application or proxy limit; proxy responses may not be JSON."
          },
          "429": {
            "description": "Queue, concurrent upload or per-product submission limit reached.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Service is restarting.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "507": {
            "description": "Temporary storage is nearly full.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "202 means accepted, not successfully encoded. Unsupported/corrupt contents fail asynchronously. No idempotency support: retrying POST creates another job.",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Upload"
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listJobs",
        "summary": "List the latest 200 jobs for this product",
        "tags": [
          "Images"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "jobs": {
                      "type": "array",
                      "maxItems": 200,
                      "items": {
                        "$ref": "#/components/schemas/Job"
                      }
                    }
                  },
                  "required": [
                    "jobs"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Newest first. No pagination or server-side filters in v0.1."
      }
    },
    "/api/v1/jobs/{id}": {
      "get": {
        "operationId": "getJob",
        "summary": "Poll job status",
        "tags": [
          "Images"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Job missing, inaccessible, or preview/archive unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Job ID from the upload response."
          }
        ],
        "description": "Poll about once per second with backoff. Stop on completed, failed, or expired. A 120-second worker limit excludes time spent waiting in the queue."
      }
    },
    "/api/v1/jobs/{id}/download": {
      "get": {
        "operationId": "downloadJob",
        "summary": "Download the optimized file",
        "tags": [
          "Images"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Job ID from the upload response."
          }
        ],
        "responses": {
          "200": {
            "description": "File attachment. Determine format from job.result.format; do not rely on the download Content-Type.",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Job missing, inaccessible, or preview/archive unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Output is not ready.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "File has expired or is no longer present.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/jobs/{id}/preview/{version}": {
      "get": {
        "operationId": "previewJob",
        "summary": "Preview source or output of a completed job",
        "tags": [
          "Images"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Job ID from the upload response."
          },
          {
            "name": "version",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "source",
                "output"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Image bytes with the source/output MIME type.",
            "content": {
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/webp": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/avif": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Job missing, inaccessible, or preview/archive unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "File has expired or is no longer present.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/archive": {
      "get": {
        "operationId": "downloadArchiveQuery",
        "summary": "Download 1\u201350 completed jobs as a ZIP",
        "tags": [
          "Images"
        ],
        "responses": {
          "200": {
            "description": "Streamed ZIP attachment. All jobs must belong to this key and have an available output.",
            "content": {
              "application/zip": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request, options, multipart input or upload size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Job missing, inaccessible, or preview/archive unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "ids",
            "in": "query",
            "required": true,
            "style": "form",
            "explode": false,
            "schema": {
              "type": "array",
              "minItems": 1,
              "maxItems": 50,
              "items": {
                "type": "string"
              }
            },
            "description": "Comma-separated job IDs."
          }
        ]
      },
      "post": {
        "operationId": "downloadArchive",
        "summary": "Download 1\u201350 completed jobs as a ZIP",
        "tags": [
          "Images"
        ],
        "responses": {
          "200": {
            "description": "Streamed ZIP attachment. All jobs must belong to this key and have an available output.",
            "content": {
              "application/zip": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request, options, multipart input or upload size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Job missing, inaccessible, or preview/archive unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ArchiveRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/stats": {
      "get": {
        "operationId": "getStats",
        "summary": "Get cumulative usage and current queue",
        "tags": [
          "Images"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Stats"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Counts are scoped to this API key. Cumulative usage survives file expiry."
      }
    },
    "/api/v1/activity": {
      "get": {
        "operationId": "listActivity",
        "summary": "Read this product\u2019s activity history",
        "description": "Newest first, retained for 90 days. No history is reconstructed for requests before logging was introduced. Successful polling is not recorded. Events describe server-side actions; download.sent means the server finished sending, not proof the caller saved the file. No credentials or image contents are included.",
        "tags": [
          "Images"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "before",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Use next_cursor from the previous page for older events."
          }
        ],
        "responses": {
          "200": {
            "description": "Product-scoped activity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActivityPage"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request, options, multipart input or upload size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or revoked API key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ProductKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "Dedicated product key issued through Product access. Keep it in backend secrets; never use administrator credentials or expose it in browser code."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          }
        },
        "required": [
          "error"
        ]
      },
      "Result": {
        "type": "object",
        "properties": {
          "format": {
            "type": "string",
            "enum": [
              "jpeg",
              "png",
              "webp",
              "avif"
            ]
          },
          "source_format": {
            "type": "string",
            "enum": [
              "jpeg",
              "png",
              "webp",
              "avif"
            ]
          },
          "width": {
            "type": "integer",
            "minimum": 1
          },
          "height": {
            "type": "integer",
            "minimum": 1
          },
          "output_bytes": {
            "type": "integer",
            "minimum": 0
          },
          "input_bytes": {
            "type": "integer",
            "minimum": 0
          },
          "saved_bytes": {
            "type": "integer",
            "description": "Can be negative when output is larger."
          },
          "quality": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100,
            "nullable": true,
            "description": "Null for PNG or original-file reuse."
          },
          "kept_original": {
            "type": "boolean"
          },
          "target_met": {
            "type": "boolean",
            "nullable": true,
            "description": "Null when no target was requested; false is a completed encode that missed the target."
          },
          "has_alpha": {
            "type": "boolean",
            "description": "Whether output retains an alpha channel. May be absent on jobs created before contract 1.1.0."
          },
          "progressive_jpeg": {
            "type": "boolean",
            "nullable": true,
            "description": "Actual JPEG progressive setting; null for other formats. May be absent on older jobs."
          }
        },
        "required": [
          "format",
          "source_format",
          "width",
          "height",
          "output_bytes",
          "input_bytes",
          "saved_bytes",
          "quality",
          "kept_original",
          "target_met"
        ],
        "nullable": true
      },
      "Job": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "filename": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "processing",
              "completed",
              "failed",
              "expired"
            ]
          },
          "preset": {
            "type": "string",
            "enum": [
              "none",
              "product-photo",
              "thumbnail",
              "website-banner",
              "keep-format"
            ]
          },
          "input_bytes": {
            "type": "integer",
            "minimum": 0
          },
          "result": {
            "$ref": "#/components/schemas/Result"
          },
          "error": {
            "type": "string",
            "nullable": true
          },
          "created": {
            "type": "integer",
            "format": "int64",
            "description": "Unix milliseconds."
          },
          "expires": {
            "type": "integer",
            "format": "int64",
            "description": "Unix milliseconds. Files expire after the retention period; cleanup runs every minute."
          },
          "download_url": {
            "type": "string",
            "nullable": true,
            "description": "Origin-relative path, not relative to /api/v1. Null unless completed. Requires the same bearer key."
          }
        },
        "required": [
          "id",
          "filename",
          "status",
          "preset",
          "input_bytes",
          "result",
          "error",
          "created",
          "expires",
          "download_url"
        ]
      },
      "Upload": {
        "type": "object",
        "properties": {
          "file": {
            "type": "string",
            "format": "binary",
            "description": "Exactly one nonempty static JPEG, PNG, WebP or AVIF; at most 26,214,400 bytes and 40 million decoded pixels."
          },
          "preset": {
            "type": "string",
            "enum": [
              "none",
              "product-photo",
              "thumbnail",
              "website-banner",
              "keep-format"
            ],
            "default": "none",
            "description": "Omitted or empty means none: original format, original dimensions, quality 82. Explicit existing presets retain their settings."
          },
          "format": {
            "type": "string",
            "enum": [
              "jpeg",
              "png",
              "webp",
              "avif",
              "original"
            ],
            "description": "Overrides preset output format; original retains source format."
          },
          "width": {
            "type": "integer",
            "minimum": 0,
            "maximum": 8192,
            "description": "Overrides preset width. 0 preserves width; aspect ratio preserved, never upscales. Cannot combine a positive width with resize_percent."
          },
          "quality": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100,
            "description": "Overrides preset quality. Ignored for lossless PNG."
          },
          "target_kb": {
            "type": "integer",
            "minimum": 0,
            "maximum": 25000,
            "default": 0,
            "description": "Best effort, 1024 bytes per KB. May lower quality. Check result.target_met."
          },
          "resize_percent": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100,
            "description": "Output width as a percentage of the oriented original width, rounded to nearest pixel (minimum 1). Height follows aspect ratio. 70 means 30% smaller dimensions. Overrides preset width; cannot be combined with explicit width > 0. Does not target a byte-size percentage."
          },
          "preserve_transparency": {
            "oneOf": [
              {
                "type": "boolean"
              },
              {
                "type": "string",
                "enum": [
                  "auto"
                ]
              }
            ],
            "default": "auto",
            "description": "Omitted/empty/auto protects only PNG inputs containing non-opaque pixels: JPEG requests then output PNG. Opaque PNGs and other input formats do not activate automatic protection. Explicit true protects any alpha-channel input; false permits white-background JPEG flattening. PNG/WebP/AVIF outputs retain alpha regardless. Multipart values: auto, true or false. Always inspect result.format."
          },
          "progressive_jpeg": {
            "type": "boolean",
            "default": true,
            "description": "Progressive JPEG encoding; false produces baseline JPEG. Applies only when actual output is JPEG. Multipart values must be true or false."
          }
        },
        "required": [
          "file"
        ]
      },
      "ArchiveRequest": {
        "type": "object",
        "properties": {
          "ids": {
            "type": "array",
            "minItems": 1,
            "maxItems": 50,
            "items": {
              "type": "string"
            },
            "description": "Completed jobs belonging to this key. Duplicates are removed."
          }
        },
        "required": [
          "ids"
        ]
      },
      "Preset": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "format": {
            "type": "string",
            "enum": [
              "original",
              "jpeg",
              "png",
              "webp",
              "avif"
            ]
          },
          "width": {
            "type": "integer",
            "minimum": 0,
            "maximum": 8192
          },
          "quality": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          }
        },
        "required": [
          "label",
          "description",
          "format",
          "width",
          "quality"
        ]
      },
      "Presets": {
        "type": "object",
        "properties": {
          "presets": {
            "type": "object",
            "properties": {
              "none": {
                "$ref": "#/components/schemas/Preset"
              },
              "product-photo": {
                "$ref": "#/components/schemas/Preset"
              },
              "thumbnail": {
                "$ref": "#/components/schemas/Preset"
              },
              "website-banner": {
                "$ref": "#/components/schemas/Preset"
              },
              "keep-format": {
                "$ref": "#/components/schemas/Preset"
              }
            },
            "required": [
              "none",
              "product-photo",
              "thumbnail",
              "website-banner",
              "keep-format"
            ]
          },
          "limits": {
            "type": "object",
            "properties": {
              "max_file_mb": {
                "type": "integer",
                "minimum": 0,
                "description": "Binary MiB despite the field name."
              },
              "max_pixels": {
                "type": "integer",
                "minimum": 0
              },
              "retention_hours": {
                "type": "number"
              }
            },
            "required": [
              "max_file_mb",
              "max_pixels",
              "retention_hours"
            ]
          }
        },
        "required": [
          "presets",
          "limits"
        ]
      },
      "Stats": {
        "type": "object",
        "properties": {
          "completed": {
            "type": "integer",
            "minimum": 0
          },
          "input_bytes": {
            "type": "integer",
            "minimum": 0
          },
          "output_bytes": {
            "type": "integer",
            "minimum": 0
          },
          "queued": {
            "type": "integer",
            "minimum": 0,
            "description": "Includes queued and processing jobs."
          },
          "retention_hours": {
            "type": "number"
          }
        },
        "required": [
          "completed",
          "input_bytes",
          "output_bytes",
          "queued",
          "retention_hours"
        ]
      },
      "ActivityEvent": {
        "type": "object",
        "required": [
          "id",
          "owner",
          "event",
          "job_id",
          "actor",
          "status",
          "details",
          "created"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "owner": {
            "type": "string",
            "description": "Product key ID, never its secret."
          },
          "event": {
            "type": "string",
            "description": "key.created, key.revoked, job.submitted, job.processing, job.completed, job.failed, job.expired, job.requeued, download.sent, preview.sent, archive.sent, request.failed or request.aborted. Clients should tolerate future events."
          },
          "job_id": {
            "type": "string",
            "nullable": true
          },
          "actor": {
            "type": "string",
            "enum": [
              "dashboard",
              "product",
              "system"
            ]
          },
          "status": {
            "type": "integer",
            "nullable": true,
            "description": "HTTP status when applicable."
          },
          "details": {
            "type": "object",
            "additionalProperties": true,
            "description": "Event-specific filename, settings, result sizes, failure message, route template, duration_ms or archive job_ids. Never request headers, tokens or image bytes."
          },
          "created": {
            "type": "integer",
            "format": "int64",
            "description": "Unix milliseconds."
          }
        }
      },
      "ActivityPage": {
        "type": "object",
        "required": [
          "events",
          "next_cursor",
          "retention_days"
        ],
        "properties": {
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ActivityEvent"
            }
          },
          "next_cursor": {
            "type": "integer",
            "nullable": true
          },
          "retention_days": {
            "type": "integer",
            "example": 90
          }
        }
      }
    }
  }
}
