{
  "openapi": "3.1.0",
  "info": {
    "title": "Melodee Native API",
    "version": "1.0.1",
    "summary": "Versioned native client API",
    "description": "Melodee native API. Remediation candidate 1.0.1: the independent-review remediation of the 1.0.0 release baseline, still not published or production-qualified. URL major remains /api/v1. 1.0.0 was never published or supported; downstream consumers of the 1.0.0 candidate must adopt the documented cursor and playback-authorization changes. Development-era 1.x revisions through 1.8.0 were internal pre-release engineering revisions.",
    "license": {
      "name": "MIT",
      "identifier": "MIT"
    }
  },
  "x-melodee-api-major": "1",
  "x-melodee-contract-status": "remediation-candidate",
  "servers": [
    {
      "url": "/",
      "description": "Same origin as the API"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "opaque session or scoped automation token"
      },
      "cookieAuth": {
        "type": "apiKey",
        "in": "cookie",
        "name": "melodee_session",
        "description": "HttpOnly interactive session cookie. Mutations using this cookie require the X-CSRF-Token header matching the melodee_csrf cookie."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "fields": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              }
            }
          }
        }
      },
      "Liveness": {
        "type": "object",
        "required": [
          "status",
          "service",
          "version"
        ],
        "properties": {
          "status": {
            "const": "ok"
          },
          "service": {
            "type": "string"
          },
          "version": {
            "type": "string"
          }
        }
      },
      "Capabilities": {
        "type": "object",
        "required": [
          "apiVersion",
          "serverVersion",
          "authentication",
          "maxPageSize",
          "rangeStreaming",
          "streamValidator",
          "playPolicyRevision",
          "playMinimumPlayedMs",
          "playMinimumFractionBasisPoints"
        ],
        "properties": {
          "apiVersion": {
            "type": "string"
          },
          "serverVersion": {
            "type": "string"
          },
          "authentication": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "maxPageSize": {
            "type": "integer"
          },
          "rangeStreaming": {
            "type": "boolean"
          },
          "streamValidator": {
            "type": "string"
          },
          "playPolicyRevision": {
            "type": "integer"
          },
          "playMinimumPlayedMs": {
            "type": "integer"
          },
          "playMinimumFractionBasisPoints": {
            "type": "integer"
          }
        }
      },
      "Artist": {
        "type": "object",
        "required": [
          "id",
          "name"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "Release": {
        "type": "object",
        "required": [
          "id",
          "title",
          "kind",
          "classification",
          "originalYear",
          "revision",
          "mainArtist"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "classification": {
            "type": "string"
          },
          "originalYear": {
            "type": "integer"
          },
          "revision": {
            "type": "integer"
          },
          "mainArtist": {
            "$ref": "#/components/schemas/Artist"
          }
        }
      },
      "Track": {
        "type": "object",
        "required": [
          "id",
          "title",
          "favorite"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "durationMs": {
            "type": [
              "integer",
              "null"
            ]
          },
          "favorite": {
            "type": "boolean"
          }
        }
      },
      "PreferredAsset": {
        "type": "object",
        "required": [
          "id",
          "format",
          "digest",
          "playable",
          "streamUrl"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "format": {
            "type": "string"
          },
          "digest": {
            "type": "string"
          },
          "playable": {
            "type": "boolean"
          },
          "streamUrl": {
            "type": "string"
          }
        }
      },
      "TrackDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Track"
          },
          {
            "type": "object",
            "properties": {
              "preferredAsset": {
                "$ref": "#/components/schemas/PreferredAsset"
              },
              "genres": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "genres"
            ]
          }
        ]
      },
      "Membership": {
        "type": "object",
        "required": [
          "id",
          "discNumber",
          "position",
          "isAddition",
          "track"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "discNumber": {
            "type": "integer"
          },
          "position": {
            "type": "integer"
          },
          "isAddition": {
            "type": "boolean"
          },
          "displayTitle": {
            "type": "string"
          },
          "track": {
            "$ref": "#/components/schemas/TrackRef"
          }
        }
      },
      "ReleaseDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Release"
          },
          {
            "type": "object",
            "required": [
              "tracks"
            ],
            "properties": {
              "tracks": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Membership"
                }
              }
            }
          }
        ]
      },
      "Favorite": {
        "type": "object",
        "required": [
          "trackId",
          "favorite"
        ],
        "properties": {
          "trackId": {
            "type": "string",
            "format": "uuid"
          },
          "favorite": {
            "type": "boolean"
          }
        }
      },
      "Search": {
        "type": "object",
        "required": [
          "artists",
          "releases",
          "tracks"
        ],
        "properties": {
          "artists": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Artist"
            }
          },
          "releases": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Release"
            }
          },
          "tracks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Track"
            }
          }
        }
      },
      "PlayRequest": {
        "type": "object",
        "required": [
          "eventId",
          "trackId",
          "playedMs",
          "completion"
        ],
        "properties": {
          "eventId": {
            "type": "string"
          },
          "trackId": {
            "type": "string",
            "format": "uuid"
          },
          "playedMs": {
            "type": "integer",
            "minimum": 0
          },
          "completion": {
            "type": "string",
            "enum": [
              "completed",
              "skipped",
              "interrupted",
              "unknown"
            ]
          },
          "occurredAtMillis": {
            "type": "integer"
          }
        }
      },
      "PlayResult": {
        "type": "object",
        "required": [
          "eventId",
          "qualification",
          "recorded"
        ],
        "properties": {
          "eventId": {
            "type": "string"
          },
          "qualification": {
            "type": "string"
          },
          "recorded": {
            "type": "boolean"
          }
        }
      },
      "AutomationTokenRequest": {
        "type": "object",
        "required": [
          "name",
          "purpose",
          "expiresAtMillis",
          "scopes"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "purpose": {
            "type": "string"
          },
          "expiresAtMillis": {
            "type": "integer"
          },
          "scopes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AutomationScope"
            }
          }
        }
      },
      "AutomationTokenIssued": {
        "type": "object",
        "required": [
          "id",
          "token",
          "scopes",
          "expiresAtMillis"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "token": {
            "type": "string"
          },
          "scopes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AutomationScope"
            }
          },
          "expiresAtMillis": {
            "type": "integer"
          }
        }
      },
      "AutomationToken": {
        "type": "object",
        "required": [
          "id",
          "name",
          "purpose",
          "scopes",
          "expiresAtMillis",
          "revoked"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "purpose": {
            "type": "string"
          },
          "scopes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AutomationScope"
            }
          },
          "expiresAtMillis": {
            "type": "integer"
          },
          "revoked": {
            "type": "boolean"
          },
          "lastUsedAtMillis": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      },
      "PageArtist": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Artist"
            }
          },
          "nextCursor": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "PageRelease": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Release"
            }
          },
          "nextCursor": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "PageTrack": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Track"
            }
          },
          "nextCursor": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "Session": {
        "type": "object",
        "required": [
          "token",
          "expiresAtMillis",
          "accountId"
        ],
        "properties": {
          "token": {
            "type": "string"
          },
          "expiresAtMillis": {
            "type": "integer"
          },
          "accountId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "DeviceCodeRequest": {
        "type": "object",
        "required": [
          "clientId",
          "scopes"
        ],
        "properties": {
          "clientId": {
            "type": "string"
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "DeviceCodeResponse": {
        "type": "object",
        "required": [
          "deviceCode",
          "userCode",
          "verificationUri",
          "expiresIn",
          "interval"
        ],
        "properties": {
          "deviceCode": {
            "type": "string"
          },
          "userCode": {
            "type": "string"
          },
          "verificationUri": {
            "type": "string",
            "format": "uri",
            "description": "Absolute Auth UI verification URL"
          },
          "expiresIn": {
            "type": "integer"
          },
          "interval": {
            "type": "integer"
          }
        }
      },
      "DeviceTokenResponse": {
        "type": "object",
        "required": [
          "accessToken",
          "tokenType",
          "expiresIn",
          "scopes"
        ],
        "properties": {
          "accessToken": {
            "type": "string"
          },
          "tokenType": {
            "type": "string"
          },
          "expiresIn": {
            "type": "integer"
          },
          "scopes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AutomationScope"
            }
          }
        }
      },
      "TrackRef": {
        "type": "object",
        "required": [
          "id",
          "title"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          }
        }
      },
      "ProviderCircuit": {
        "type": "object",
        "required": [
          "host",
          "consecutiveFailures"
        ],
        "properties": {
          "host": {
            "type": "string"
          },
          "consecutiveFailures": {
            "type": "integer"
          },
          "openedUntilMs": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      },
      "ReportCatalog": {
        "type": "object",
        "required": [
          "artists",
          "systemArtists",
          "releases",
          "tracks",
          "memberships",
          "playableTracks",
          "unknownDurationTracks",
          "totalDurationMs",
          "dictionaryVersion",
          "generatedAt"
        ],
        "properties": {
          "artists": {
            "type": "integer"
          },
          "systemArtists": {
            "type": "integer"
          },
          "releases": {
            "type": "integer"
          },
          "tracks": {
            "type": "integer"
          },
          "memberships": {
            "type": "integer"
          },
          "playableTracks": {
            "type": "integer"
          },
          "unknownDurationTracks": {
            "type": "integer"
          },
          "totalDurationMs": {
            "type": "integer"
          },
          "dictionaryVersion": {
            "type": "integer"
          },
          "generatedAt": {
            "type": "string"
          }
        }
      },
      "ReportStorage": {
        "type": "object",
        "required": [
          "volumes",
          "assetsByLifecycle",
          "locationsByState",
          "availableBytes",
          "retiredLocationBytes",
          "dictionaryVersion",
          "generatedAt"
        ],
        "properties": {
          "volumes": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "assetsByLifecycle": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "locationsByState": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "availableBytes": {
            "type": "integer"
          },
          "retiredLocationBytes": {
            "type": "integer"
          },
          "dictionaryVersion": {
            "type": "integer"
          },
          "generatedAt": {
            "type": "string"
          }
        }
      },
      "ReportQuality": {
        "type": "object",
        "required": [
          "reviewByState",
          "openReviewByReason",
          "openReviews",
          "attemptOutcomes24h",
          "effectOutcomes",
          "assessmentCoverage",
          "dictionaryVersion",
          "generatedAt"
        ],
        "properties": {
          "reviewByState": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "openReviewByReason": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "openReviews": {
            "type": "integer"
          },
          "oldestOpenReviewAgeMs": {
            "type": [
              "integer",
              "null"
            ]
          },
          "attemptOutcomes24h": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "effectOutcomes": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "assessmentCoverage": {
            "type": "string"
          },
          "dictionaryVersion": {
            "type": "integer"
          },
          "generatedAt": {
            "type": "string"
          }
        }
      },
      "ReportJobs": {
        "type": "object",
        "required": [
          "byState",
          "byKind",
          "recentAttemptOutcomes",
          "retrying",
          "failed",
          "cancelRequested",
          "dictionaryVersion",
          "generatedAt"
        ],
        "properties": {
          "byState": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "byKind": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "recentAttemptOutcomes": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "oldestQueuedAgeMs": {
            "type": [
              "integer",
              "null"
            ]
          },
          "retrying": {
            "type": "integer"
          },
          "failed": {
            "type": "integer"
          },
          "cancelRequested": {
            "type": "integer"
          },
          "dictionaryVersion": {
            "type": "integer"
          },
          "generatedAt": {
            "type": "string"
          }
        }
      },
      "ReportProviders": {
        "type": "object",
        "required": [
          "snapshotsByStatus",
          "snapshotsByProvider",
          "cacheEntries",
          "negativeCacheEntries",
          "expiredCacheEntries",
          "budgetWindows",
          "circuits",
          "openCircuits",
          "dictionaryVersion",
          "generatedAt"
        ],
        "properties": {
          "snapshotsByStatus": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "snapshotsByProvider": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "cacheEntries": {
            "type": "integer"
          },
          "negativeCacheEntries": {
            "type": "integer"
          },
          "expiredCacheEntries": {
            "type": "integer"
          },
          "budgetWindows": {
            "type": "integer"
          },
          "circuits": {
            "type": "integer"
          },
          "openCircuits": {
            "type": "integer"
          },
          "dictionaryVersion": {
            "type": "integer"
          },
          "generatedAt": {
            "type": "string"
          }
        }
      },
      "ReportIngestion": {
        "type": "object",
        "required": [
          "fromDay",
          "toDay",
          "timezone",
          "dictionaryVersion",
          "coverage",
          "days",
          "totals"
        ],
        "properties": {
          "fromDay": {
            "type": "string"
          },
          "toDay": {
            "type": "string"
          },
          "timezone": {
            "type": "string"
          },
          "dictionaryVersion": {
            "type": "integer"
          },
          "generatedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "sourceWatermark": {
            "type": [
              "string",
              "null"
            ]
          },
          "coverage": {
            "type": "string"
          },
          "days": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "day",
                "metrics",
                "coverage"
              ],
              "properties": {
                "day": {
                  "type": "string"
                },
                "metrics": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "integer"
                  }
                },
                "coverage": {
                  "type": "string"
                }
              }
            }
          },
          "totals": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          }
        }
      },
      "ReportSnapshotMeta": {
        "type": "object",
        "required": [
          "id",
          "kind",
          "generatedAt",
          "dictionaryVersion"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "kind": {
            "type": "string"
          },
          "generatedAt": {
            "type": "string"
          },
          "dictionaryVersion": {
            "type": "integer"
          }
        }
      },
      "SnapshotCreated": {
        "type": "object",
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "JobControl": {
        "type": "object",
        "required": [
          "kind",
          "enabled",
          "paused",
          "maxRunning",
          "priorityDelta",
          "timeoutMs",
          "maxAttempts",
          "retryDelayMs",
          "batchSize",
          "revision"
        ],
        "properties": {
          "maxRunning": {
            "type": "integer"
          },
          "priorityDelta": {
            "type": "integer"
          },
          "timeoutMs": {
            "type": "integer"
          },
          "maxAttempts": {
            "type": "integer"
          },
          "retryDelayMs": {
            "type": "integer"
          },
          "batchSize": {
            "type": "integer"
          },
          "revision": {
            "type": "integer"
          },
          "kind": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "paused": {
            "type": "boolean"
          }
        }
      },
      "JobSchedule": {
        "type": "object",
        "required": [
          "id",
          "kind",
          "intervalMs",
          "nextRunAtMs",
          "enabled",
          "overlapPolicy",
          "revision",
          "hasPayload"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "kind": {
            "type": "string"
          },
          "intervalMs": {
            "type": "integer"
          },
          "nextRunAtMs": {
            "type": "integer"
          },
          "enabled": {
            "type": "boolean"
          },
          "overlapPolicy": {
            "type": "string"
          },
          "revision": {
            "type": "integer"
          },
          "hasPayload": {
            "type": "boolean"
          }
        }
      },
      "JobSnapshot": {
        "type": "object",
        "required": [
          "id",
          "kind",
          "state",
          "cancelRequested"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "kind": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "cancelRequested": {
            "type": "boolean"
          },
          "stage": {
            "type": "string"
          },
          "percent": {
            "type": "integer"
          },
          "bytesProcessed": {
            "type": "integer"
          }
        }
      },
      "Revision": {
        "type": "object",
        "required": [
          "revision"
        ],
        "properties": {
          "revision": {
            "type": "integer"
          }
        }
      },
      "StorageVolume": {
        "type": "object",
        "required": [
          "id",
          "name",
          "kind",
          "mountPath",
          "status",
          "ownerEpoch",
          "priority",
          "minFreeBytes"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "mountPath": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "ownerEpoch": {
            "type": "integer"
          },
          "priority": {
            "type": "integer"
          },
          "minFreeBytes": {
            "type": "integer"
          }
        }
      },
      "DeviceApproval": {
        "type": "object",
        "required": [
          "accountId",
          "clientId",
          "scopes",
          "expiresAtMs"
        ],
        "properties": {
          "accountId": {
            "type": "string",
            "format": "uuid"
          },
          "clientId": {
            "type": "string"
          },
          "scopes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AutomationScope"
            }
          },
          "expiresAtMs": {
            "type": "integer"
          }
        }
      },
      "JobControlUpdate": {
        "type": "object",
        "required": [
          "enabled",
          "paused",
          "maxRunning",
          "timeoutMs",
          "maxAttempts",
          "expectedRevision"
        ],
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "paused": {
            "type": "boolean"
          },
          "maxRunning": {
            "type": "integer"
          },
          "priorityDelta": {
            "type": "integer"
          },
          "timeoutMs": {
            "type": "integer"
          },
          "maxAttempts": {
            "type": "integer"
          },
          "retryDelayMs": {
            "type": "integer"
          },
          "batchSize": {
            "type": "integer"
          },
          "expectedRevision": {
            "type": "integer"
          }
        }
      },
      "JobReason": {
        "type": "object",
        "required": [
          "reason"
        ],
        "properties": {
          "reason": {
            "type": "string"
          }
        }
      },
      "JobProgress": {
        "type": "object",
        "required": [
          "stage"
        ],
        "properties": {
          "stage": {
            "type": "string"
          },
          "percent": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 100
          },
          "bytesProcessed": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      },
      "ScheduleCreate": {
        "type": "object",
        "required": [
          "kind",
          "intervalMs",
          "nextRunAtMillis"
        ],
        "properties": {
          "kind": {
            "type": "string"
          },
          "intervalMs": {
            "type": "integer"
          },
          "nextRunAtMillis": {
            "type": "integer"
          },
          "overlapPolicy": {
            "type": "string"
          },
          "payload": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ScheduleUpdate": {
        "type": "object",
        "required": [
          "enabled",
          "expectedRevision"
        ],
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "expectedRevision": {
            "type": "integer"
          }
        }
      },
      "VolumeControl": {
        "type": "object",
        "required": [
          "status",
          "priority",
          "expectedOwnerEpoch"
        ],
        "properties": {
          "status": {
            "type": "string"
          },
          "priority": {
            "type": "integer"
          },
          "minFreeBytes": {
            "type": "integer"
          },
          "expectedOwnerEpoch": {
            "type": "integer"
          }
        }
      },
      "SnapshotRequest": {
        "type": "object",
        "required": [
          "kind"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "catalog",
              "storage",
              "quality",
              "jobs",
              "providers"
            ]
          }
        }
      },
      "StorageMove": {
        "type": "object",
        "required": [
          "targetVolumeId",
          "targetOwnerEpoch"
        ],
        "properties": {
          "targetVolumeId": {
            "type": "string",
            "format": "uuid"
          },
          "targetOwnerEpoch": {
            "type": "integer"
          }
        }
      },
      "StorageMoveJob": {
        "type": "object",
        "required": [
          "targetVolumeId"
        ],
        "properties": {
          "targetVolumeId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "MoveResult": {
        "type": "object",
        "required": [
          "generation",
          "relativePath",
          "oldReclaimed"
        ],
        "properties": {
          "generation": {
            "type": "integer"
          },
          "relativePath": {
            "type": "string"
          },
          "oldReclaimed": {
            "type": "boolean"
          }
        }
      },
      "MoveJobResult": {
        "type": "object",
        "required": [
          "jobId",
          "state"
        ],
        "properties": {
          "jobId": {
            "type": "string",
            "format": "uuid"
          },
          "state": {
            "type": "string"
          }
        }
      },
      "Review": {
        "type": "object",
        "required": [
          "id",
          "operationId",
          "generation",
          "subject",
          "reasonCode",
          "missingFields",
          "state"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "operationId": {
            "type": "string"
          },
          "generation": {
            "type": "integer"
          },
          "subject": {
            "type": "string"
          },
          "reasonCode": {
            "type": "string"
          },
          "missingFields": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "state": {
            "type": "string"
          }
        }
      },
      "ReviewPage": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Review"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ReviewResolveRequest": {
        "type": "object",
        "required": [
          "state",
          "note"
        ],
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "resolved",
              "rejected"
            ]
          },
          "note": {
            "type": "string"
          }
        }
      },
      "Lock": {
        "type": "object",
        "required": [
          "field",
          "value",
          "actor",
          "reason"
        ],
        "properties": {
          "field": {
            "type": "string"
          },
          "value": {
            "type": "string"
          },
          "actor": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          }
        }
      },
      "TrackLocks": {
        "type": "object",
        "required": [
          "fields",
          "assetLocked"
        ],
        "properties": {
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Lock"
            }
          },
          "assetLocked": {
            "type": "boolean"
          }
        }
      },
      "LockRequest": {
        "type": "object",
        "required": [
          "value",
          "reason"
        ],
        "properties": {
          "value": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          }
        }
      },
      "AssetLockRequest": {
        "type": "object",
        "required": [
          "reason"
        ],
        "properties": {
          "reason": {
            "type": "string"
          }
        }
      },
      "MatchDecisionRequest": {
        "type": "object",
        "required": [
          "scopeNamespace",
          "scopeValue",
          "subjectKind",
          "subjectId",
          "decision",
          "reason"
        ],
        "properties": {
          "scopeNamespace": {
            "type": "string"
          },
          "scopeValue": {
            "type": "string"
          },
          "subjectKind": {
            "type": "string",
            "enum": [
              "artist",
              "release",
              "track"
            ]
          },
          "subjectId": {
            "type": "string",
            "format": "uuid"
          },
          "decision": {
            "type": "string",
            "enum": [
              "accept",
              "reject"
            ]
          },
          "evidenceRef": {
            "type": [
              "string",
              "null"
            ]
          },
          "reason": {
            "type": "string"
          }
        }
      },
      "MatchDecision": {
        "type": "object",
        "required": [
          "id",
          "decision"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "decision": {
            "type": "string"
          }
        }
      },
      "MergeRequest": {
        "type": "object",
        "required": [
          "targetTrackId",
          "reason"
        ],
        "properties": {
          "targetTrackId": {
            "type": "string",
            "format": "uuid"
          },
          "reason": {
            "type": "string"
          }
        }
      },
      "MergeResult": {
        "type": "object",
        "required": [
          "mergeId",
          "from",
          "to",
          "memberships",
          "assets",
          "credits",
          "favorites",
          "events"
        ],
        "properties": {
          "mergeId": {
            "type": "string",
            "format": "uuid"
          },
          "from": {
            "type": "string",
            "format": "uuid"
          },
          "to": {
            "type": "string",
            "format": "uuid"
          },
          "memberships": {
            "type": "integer"
          },
          "assets": {
            "type": "integer"
          },
          "credits": {
            "type": "integer"
          },
          "favorites": {
            "type": "integer"
          },
          "events": {
            "type": "integer"
          }
        }
      },
      "SplitRequest": {
        "type": "object",
        "required": [
          "reason"
        ],
        "properties": {
          "reason": {
            "type": "string"
          }
        }
      },
      "ClassificationRequest": {
        "type": "object",
        "required": [
          "classification",
          "expectedRevision",
          "reason"
        ],
        "properties": {
          "classification": {
            "type": "string"
          },
          "expectedRevision": {
            "type": "integer"
          },
          "reason": {
            "type": "string"
          }
        }
      },
      "PreferredAssetRequest": {
        "type": "object",
        "required": [
          "assetId"
        ],
        "properties": {
          "assetId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "Assessment": {
        "type": "object",
        "required": [
          "coverage",
          "flags"
        ],
        "properties": {
          "coverage": {
            "type": "string"
          },
          "id": {
            "type": [
              "string",
              "null"
            ]
          },
          "revision": {
            "type": [
              "integer",
              "null"
            ]
          },
          "policyRevision": {
            "type": [
              "integer",
              "null"
            ]
          },
          "metadataScore": {
            "type": [
              "integer",
              "null"
            ]
          },
          "audioScore": {
            "type": [
              "integer",
              "null"
            ]
          },
          "combinedScore": {
            "type": [
              "integer",
              "null"
            ]
          },
          "metadataStatus": {
            "type": [
              "string",
              "null"
            ]
          },
          "audioStatus": {
            "type": [
              "string",
              "null"
            ]
          },
          "eligible": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "evidenceMask": {
            "type": [
              "integer",
              "null"
            ]
          },
          "flags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "assessedAtMillis": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      },
      "ReassessResult": {
        "type": "object",
        "required": [
          "scanned",
          "reassessed",
          "failed"
        ],
        "properties": {
          "scanned": {
            "type": "integer"
          },
          "reassessed": {
            "type": "integer"
          },
          "failed": {
            "type": "integer"
          }
        }
      },
      "AliasRequest": {
        "type": "object",
        "required": [
          "name",
          "scope"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "scope": {
            "type": "string"
          }
        }
      },
      "CorrectionAlias": {
        "type": "object",
        "required": [
          "artistId",
          "name",
          "scope"
        ],
        "properties": {
          "artistId": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "scope": {
            "type": "string"
          }
        }
      },
      "CorrectionDecision": {
        "type": "object",
        "required": [
          "scopeNamespace",
          "scopeValue",
          "subjectKind",
          "subjectId",
          "decision",
          "actor",
          "reason"
        ],
        "properties": {
          "scopeNamespace": {
            "type": "string"
          },
          "scopeValue": {
            "type": "string"
          },
          "subjectKind": {
            "type": "string"
          },
          "subjectId": {
            "type": "string",
            "format": "uuid"
          },
          "decision": {
            "type": "string"
          },
          "evidenceRef": {
            "type": [
              "string",
              "null"
            ]
          },
          "actor": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          }
        }
      },
      "CorrectionFieldLock": {
        "type": "object",
        "required": [
          "ownerKind",
          "ownerId",
          "field",
          "value",
          "actor",
          "reason"
        ],
        "properties": {
          "ownerKind": {
            "type": "string"
          },
          "ownerId": {
            "type": "string",
            "format": "uuid"
          },
          "field": {
            "type": "string"
          },
          "value": {
            "type": "string"
          },
          "actor": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          }
        }
      },
      "CorrectionAssetLock": {
        "type": "object",
        "required": [
          "trackId",
          "actor",
          "reason"
        ],
        "properties": {
          "trackId": {
            "type": "string",
            "format": "uuid"
          },
          "actor": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          }
        }
      },
      "CorrectionMerge": {
        "type": "object",
        "required": [
          "mergeId",
          "fromTrackId",
          "toTrackId",
          "actor",
          "reason",
          "mergedAtMs",
          "reversed"
        ],
        "properties": {
          "mergeId": {
            "type": "string",
            "format": "uuid"
          },
          "fromTrackId": {
            "type": "string",
            "format": "uuid"
          },
          "toTrackId": {
            "type": "string",
            "format": "uuid"
          },
          "actor": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "mergedAtMs": {
            "type": "integer"
          },
          "reversed": {
            "type": "boolean"
          }
        }
      },
      "CorrectionDocument": {
        "type": "object",
        "required": [
          "schemaVersion",
          "exportedAtMs"
        ],
        "properties": {
          "schemaVersion": {
            "type": "integer"
          },
          "exportedAtMs": {
            "type": "integer"
          },
          "aliases": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CorrectionAlias"
            }
          },
          "decisions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CorrectionDecision"
            }
          },
          "fieldLocks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CorrectionFieldLock"
            }
          },
          "assetLocks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CorrectionAssetLock"
            }
          },
          "merges": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CorrectionMerge"
            }
          }
        }
      },
      "SectionCounts": {
        "type": "object",
        "required": [
          "created",
          "skipped",
          "conflicts"
        ],
        "properties": {
          "created": {
            "type": "integer"
          },
          "skipped": {
            "type": "integer"
          },
          "conflicts": {
            "type": "integer"
          }
        }
      },
      "CorrectionImportReport": {
        "type": "object",
        "required": [
          "dryRun",
          "aliases",
          "decisions",
          "fieldLocks",
          "assetLocks",
          "merges"
        ],
        "properties": {
          "dryRun": {
            "type": "boolean"
          },
          "aliases": {
            "$ref": "#/components/schemas/SectionCounts"
          },
          "decisions": {
            "$ref": "#/components/schemas/SectionCounts"
          },
          "fieldLocks": {
            "$ref": "#/components/schemas/SectionCounts"
          },
          "assetLocks": {
            "$ref": "#/components/schemas/SectionCounts"
          },
          "merges": {
            "$ref": "#/components/schemas/SectionCounts"
          }
        }
      },
      "LegacyTrackRow": {
        "type": "object",
        "properties": {
          "Id": {
            "type": "string"
          },
          "ApiKey": {
            "type": "string"
          },
          "AlbumId": {
            "type": "string"
          },
          "Title": {
            "type": "string"
          },
          "TitleSort": {
            "type": "string"
          },
          "SongNumber": {
            "type": "integer"
          },
          "SortOrder": {
            "type": "integer"
          },
          "FileName": {
            "type": "string"
          },
          "FileSize": {
            "type": "integer"
          },
          "FileHash": {
            "type": "string"
          },
          "Duration": {
            "type": "integer"
          },
          "SamplingRate": {
            "type": "integer"
          },
          "BitRate": {
            "type": "integer"
          },
          "ChannelCount": {
            "type": "integer"
          },
          "IsLocked": {
            "type": "boolean"
          },
          "MusicBrainzId": {
            "type": "string"
          },
          "SpotifyId": {
            "type": "string"
          },
          "LastPlayedAt": {
            "type": "string"
          },
          "PlayedCount": {
            "type": "integer"
          },
          "CalculatedRating": {
            "type": "string"
          },
          "Genres": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "additionalProperties": true
      },
      "LegacyExport": {
        "type": "object",
        "required": [
          "schemaVersion"
        ],
        "properties": {
          "schemaVersion": {
            "type": "integer"
          },
          "tracks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LegacyTrackRow"
            }
          }
        }
      },
      "LegacyPreviewTrack": {
        "type": "object",
        "required": [
          "legacyId",
          "title",
          "externalIds",
          "deferredFields",
          "unknownFields"
        ],
        "properties": {
          "legacyId": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "albumId": {
            "type": [
              "string",
              "null"
            ]
          },
          "fileName": {
            "type": [
              "string",
              "null"
            ]
          },
          "durationMs": {
            "type": [
              "integer",
              "null"
            ]
          },
          "externalIds": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "deferredFields": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "unknownFields": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "LegacyRejectedTrack": {
        "type": "object",
        "required": [
          "index",
          "reasons"
        ],
        "properties": {
          "index": {
            "type": "integer"
          },
          "reasons": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "LegacyPreview": {
        "type": "object",
        "required": [
          "schemaVersion",
          "rows",
          "accepted",
          "rejected",
          "hasUnknownFields",
          "writes"
        ],
        "properties": {
          "schemaVersion": {
            "type": "integer"
          },
          "rows": {
            "type": "integer"
          },
          "accepted": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LegacyPreviewTrack"
            }
          },
          "rejected": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LegacyRejectedTrack"
            }
          },
          "hasUnknownFields": {
            "type": "boolean"
          },
          "writes": {
            "type": "boolean"
          }
        }
      },
      "ReconcileCandidate": {
        "type": "object",
        "required": [
          "trackId",
          "title"
        ],
        "properties": {
          "trackId": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "durationMs": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      },
      "ReconcileRow": {
        "type": "object",
        "required": [
          "legacyId",
          "title",
          "status",
          "candidates"
        ],
        "properties": {
          "legacyId": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "candidates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReconcileCandidate"
            }
          }
        }
      },
      "ReconcileReport": {
        "type": "object",
        "required": [
          "rows",
          "matched",
          "ambiguous",
          "unmatched",
          "outcomes",
          "writes"
        ],
        "properties": {
          "rows": {
            "type": "integer"
          },
          "matched": {
            "type": "integer"
          },
          "ambiguous": {
            "type": "integer"
          },
          "unmatched": {
            "type": "integer"
          },
          "outcomes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReconcileRow"
            }
          },
          "writes": {
            "type": "boolean"
          }
        }
      },
      "LegacyTrackField": {
        "type": "object",
        "required": [
          "legacy",
          "nativeOwnership",
          "disposition",
          "note"
        ],
        "properties": {
          "legacy": {
            "type": "string"
          },
          "nativeOwnership": {
            "type": "string"
          },
          "disposition": {
            "type": "string"
          },
          "note": {
            "type": "string"
          }
        }
      },
      "LegacyInventory": {
        "type": "object",
        "required": [
          "inventoryVersion",
          "fields"
        ],
        "properties": {
          "inventoryVersion": {
            "type": "integer"
          },
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LegacyTrackField"
            }
          }
        }
      },
      "QueuedJob": {
        "type": "object",
        "required": [
          "jobId",
          "state"
        ],
        "properties": {
          "jobId": {
            "type": "string",
            "format": "uuid"
          },
          "state": {
            "type": "string"
          }
        }
      },
      "IngestJobRequest": {
        "type": "object",
        "required": [
          "volume",
          "sourcePath",
          "generation",
          "currentYear",
          "mainArtistKind",
          "creditKind"
        ],
        "properties": {
          "volume": {
            "type": "string",
            "format": "uuid"
          },
          "sourcePath": {
            "type": "string"
          },
          "generation": {
            "type": "integer",
            "minimum": 1
          },
          "currentYear": {
            "type": "integer",
            "minimum": 1900,
            "maximum": 2200
          },
          "mainArtistKind": {
            "type": "string"
          },
          "creditKind": {
            "type": "string"
          }
        }
      },
      "NormalizeJobRequest": {
        "type": "object",
        "required": [
          "volume",
          "sourcePath",
          "outputPath"
        ],
        "properties": {
          "volume": {
            "type": "string",
            "format": "uuid"
          },
          "sourcePath": {
            "type": "string"
          },
          "outputPath": {
            "type": "string"
          }
        }
      },
      "AutomationScope": {
        "type": "string",
        "enum": [
          "catalog.read",
          "catalog.favorite.write",
          "playback.report",
          "reporting.read",
          "operations.read",
          "operations.write",
          "catalog.admin.read",
          "catalog.admin.write"
        ]
      },
      "ArtworkResponse": {
        "type": "object",
        "required": [
          "id",
          "revision",
          "width",
          "height",
          "sizes",
          "basePath"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "revision": {
            "type": "integer"
          },
          "width": {
            "type": "integer"
          },
          "height": {
            "type": "integer"
          },
          "sizes": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "basePath": {
            "type": "string"
          }
        }
      },
      "ArtworkFetchRequest": {
        "type": "object",
        "required": [
          "url"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "JobInventoryItem": {
        "type": "object",
        "required": [
          "id",
          "kind",
          "state",
          "priority",
          "createdAtMs",
          "runAfterMs",
          "updatedAtMs",
          "attempts",
          "maxAttempts",
          "retryEligible",
          "cancelEligible"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "kind": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "priority": {
            "type": "integer"
          },
          "createdAtMs": {
            "type": "integer",
            "format": "int64"
          },
          "runAfterMs": {
            "type": "integer",
            "format": "int64"
          },
          "startedAtMs": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "completedAtMs": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "updatedAtMs": {
            "type": "integer",
            "format": "int64"
          },
          "stage": {
            "type": [
              "string",
              "null"
            ]
          },
          "percent": {
            "type": [
              "integer",
              "null"
            ]
          },
          "processedBytes": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "processedItems": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "totalItems": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "attempts": {
            "type": "integer"
          },
          "maxAttempts": {
            "type": "integer"
          },
          "retryEligible": {
            "type": "boolean"
          },
          "cancelEligible": {
            "type": "boolean"
          },
          "scheduleId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "storageVolumeId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "failureClass": {
            "type": [
              "string",
              "null"
            ]
          },
          "failureSummary": {
            "type": [
              "string",
              "null"
            ]
          },
          "correlationId": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "JobInventoryPage": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JobInventoryItem"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          }
        }
      },
      "StorageAssetInventoryItem": {
        "type": "object",
        "required": [
          "id",
          "trackId",
          "mediaFormat",
          "digestAlgorithm",
          "contentDigest",
          "byteSize",
          "lifecycleState",
          "preferred",
          "quarantined",
          "locked",
          "available",
          "createdAtMs"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "trackId": {
            "type": "string",
            "format": "uuid"
          },
          "mediaFormat": {
            "type": "string"
          },
          "digestAlgorithm": {
            "type": "string"
          },
          "contentDigest": {
            "type": "string"
          },
          "storageVolumeId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "relativePath": {
            "type": [
              "string",
              "null"
            ]
          },
          "byteSize": {
            "type": "integer",
            "format": "int64"
          },
          "durationMs": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "sampleRateHz": {
            "type": [
              "integer",
              "null"
            ]
          },
          "channelCount": {
            "type": [
              "integer",
              "null"
            ]
          },
          "bitrateKbps": {
            "type": [
              "integer",
              "null"
            ]
          },
          "lifecycleState": {
            "type": "string"
          },
          "locationState": {
            "type": [
              "string",
              "null"
            ]
          },
          "preferred": {
            "type": "boolean"
          },
          "quarantined": {
            "type": "boolean"
          },
          "locked": {
            "type": "boolean"
          },
          "available": {
            "type": "boolean"
          },
          "createdAtMs": {
            "type": "integer",
            "format": "int64"
          },
          "locationCreatedAtMs": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "verifiedAtMs": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "quarantinedAtMs": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          }
        }
      },
      "StorageAssetInventoryPage": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StorageAssetInventoryItem"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          }
        }
      },
      "ReviewEvidence": {
        "type": "object",
        "required": [
          "kind",
          "summary"
        ],
        "properties": {
          "kind": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          }
        }
      },
      "ReviewDecision": {
        "type": "object",
        "required": [
          "actor",
          "action",
          "detail",
          "atMs"
        ],
        "properties": {
          "actor": {
            "type": "string"
          },
          "action": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          },
          "atMs": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "ReviewDetail": {
        "type": "object",
        "required": [
          "id",
          "operationId",
          "operationKind",
          "namespace",
          "generation",
          "discoveredAtMs",
          "subject",
          "reasonCode",
          "missingFields",
          "state",
          "createdAtMs",
          "evidence",
          "candidateArtists",
          "candidateReleases",
          "candidateTracks",
          "candidateEvidenceAvailable",
          "appliedRules",
          "locks",
          "previousDecisions",
          "availableActions"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "operationId": {
            "type": "string",
            "format": "uuid"
          },
          "operationKind": {
            "type": "string"
          },
          "namespace": {
            "type": "string"
          },
          "generation": {
            "type": "integer"
          },
          "discoveredAtMs": {
            "type": "integer",
            "format": "int64"
          },
          "subject": {
            "type": "string"
          },
          "sourcePath": {
            "type": [
              "string",
              "null"
            ]
          },
          "reasonCode": {
            "type": "string"
          },
          "missingFields": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "state": {
            "type": "string"
          },
          "createdAtMs": {
            "type": "integer",
            "format": "int64"
          },
          "resolvedAtMs": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "resolutionNote": {
            "type": [
              "string",
              "null"
            ]
          },
          "evidence": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReviewEvidence"
            }
          },
          "candidateArtists": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "candidateReleases": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "candidateTracks": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "candidateEvidenceAvailable": {
            "type": "boolean"
          },
          "appliedRules": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "locks": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "previousDecisions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReviewDecision"
            }
          },
          "availableActions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "RefreshRequest": {
        "type": "object",
        "description": "Native clients send refreshToken. A browser may omit the body and present the HttpOnly session cookie instead.",
        "properties": {
          "refreshToken": {
            "type": "string",
            "maxLength": 512
          }
        }
      },
      "RefreshResponse": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/BrowserSession"
          },
          {
            "$ref": "#/components/schemas/NativeRefresh"
          }
        ],
        "description": "Browser requests receive rotated cookies and no token; native requests receive a replacement accessToken and no cookies."
      },
      "NotificationDelivery": {
        "type": "object",
        "required": [
          "id",
          "eventKind",
          "severity",
          "summary",
          "state",
          "attempts",
          "createdAtMs",
          "channel",
          "occurrences"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "eventKind": {
            "type": "string"
          },
          "severity": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "attempts": {
            "type": "integer"
          },
          "lastErrorClass": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAtMs": {
            "type": "integer",
            "format": "int64"
          },
          "sentAtMs": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "channel": {
            "type": "string",
            "enum": [
              "in_app",
              "email",
              "telegram"
            ]
          },
          "occurrences": {
            "type": "integer",
            "minimum": 1
          }
        }
      },
      "NotificationTest": {
        "type": "object",
        "required": [
          "queued"
        ],
        "properties": {
          "queued": {
            "type": "boolean"
          }
        }
      },
      "InboundEntry": {
        "type": "object",
        "required": [
          "name",
          "kind"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "size": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "modifiedAtMs": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          }
        }
      },
      "BrowserSession": {
        "type": "object",
        "description": "Browser session. The reusable credential is delivered only as an HttpOnly cookie; the body carries no token.",
        "required": [
          "accountId",
          "rotateAtMillis",
          "sessionExpiresAtMillis"
        ],
        "properties": {
          "accountId": {
            "type": "string",
            "format": "uuid"
          },
          "rotateAtMillis": {
            "type": "integer",
            "format": "int64"
          },
          "sessionExpiresAtMillis": {
            "type": "integer",
            "format": "int64"
          }
        },
        "additionalProperties": false
      },
      "NativeSession": {
        "type": "object",
        "description": "Native-client session. Returned only to requests without browser headers; the bearer is stored in the platform keystore.",
        "required": [
          "token",
          "tokenType",
          "expiresAtMillis",
          "rotateAtMillis",
          "sessionExpiresAtMillis",
          "accountId"
        ],
        "properties": {
          "token": {
            "type": "string"
          },
          "tokenType": {
            "type": "string",
            "const": "Bearer"
          },
          "expiresAtMillis": {
            "type": "integer",
            "format": "int64",
            "description": "Absolute session-family expiry. Legacy field; prefer sessionExpiresAtMillis."
          },
          "rotateAtMillis": {
            "type": "integer",
            "format": "int64"
          },
          "sessionExpiresAtMillis": {
            "type": "integer",
            "format": "int64"
          },
          "accountId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "additionalProperties": false
      },
      "NativeRefresh": {
        "type": "object",
        "description": "Native-client refresh result.",
        "required": [
          "accessToken",
          "tokenType",
          "expiresAtMillis",
          "rotateAtMillis",
          "sessionExpiresAtMillis"
        ],
        "properties": {
          "accessToken": {
            "type": "string"
          },
          "tokenType": {
            "type": "string",
            "const": "Bearer"
          },
          "expiresAtMillis": {
            "type": "integer",
            "format": "int64",
            "description": "Access-credential rotation deadline. Legacy field; prefer rotateAtMillis."
          },
          "rotateAtMillis": {
            "type": "integer",
            "format": "int64"
          },
          "sessionExpiresAtMillis": {
            "type": "integer",
            "format": "int64"
          },
          "accountId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "additionalProperties": false
      },
      "SessionResponse": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/BrowserSession"
          },
          {
            "$ref": "#/components/schemas/NativeSession"
          }
        ],
        "description": "Browser requests (Origin or Sec-Fetch-* present) receive BrowserSession plus Set-Cookie and no token. Native requests receive NativeSession and no cookies."
      },
      "MethodCapability": {
        "type": "object",
        "required": [
          "enabled"
        ],
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "PasskeyCapability": {
        "type": "object",
        "required": [
          "enabled",
          "protectedStorageWritable"
        ],
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "rpId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Relying-party id the browser must be served from."
          },
          "origin": {
            "type": [
              "string",
              "null"
            ],
            "description": "Expected browser origin."
          },
          "protectedStorageWritable": {
            "type": "boolean",
            "description": "False when no writable Storage Volume exists, in which case enrollment returns 503."
          }
        }
      },
      "GoogleCapability": {
        "type": "object",
        "required": [
          "enabled"
        ],
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "browserReturnUrl": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "AuthCapabilities": {
        "type": "object",
        "required": [
          "magicLink",
          "recovery",
          "passkey",
          "google",
          "browserSessions",
          "bootstrap"
        ],
        "properties": {
          "magicLink": {
            "$ref": "#/components/schemas/MethodCapability"
          },
          "recovery": {
            "$ref": "#/components/schemas/MethodCapability"
          },
          "passkey": {
            "$ref": "#/components/schemas/PasskeyCapability"
          },
          "google": {
            "$ref": "#/components/schemas/GoogleCapability"
          },
          "browserSessions": {
            "type": "boolean"
          },
          "bootstrap": {
            "type": "string",
            "enum": [
              "uninitialized",
              "pending",
              "complete",
              "unknown"
            ]
          }
        }
      },
      "BootstrapRequest": {
        "type": "object",
        "required": [
          "code"
        ],
        "properties": {
          "code": {
            "type": "string",
            "pattern": "^[0-9a-fA-F]{64}$",
            "description": "One-time challenge printed by the local bootstrap command."
          }
        }
      },
      "PasskeyRegistrationChallenge": {
        "type": "object",
        "required": [
          "challenge"
        ],
        "properties": {
          "challenge": {
            "type": "string",
            "description": "Base64url challenge."
          },
          "rp": {
            "type": "object"
          },
          "user": {
            "type": "object"
          },
          "pubKeyCredParams": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "timeout": {
            "type": "integer"
          },
          "attestation": {
            "type": [
              "string",
              "null"
            ]
          },
          "excludeCredentials": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "authenticatorSelection": {
            "type": [
              "object",
              "null"
            ]
          },
          "userVerification": {
            "type": "string"
          }
        }
      },
      "PasskeyAuthenticationChallenge": {
        "type": "object",
        "required": [
          "challenge"
        ],
        "properties": {
          "challenge": {
            "type": "string"
          },
          "timeout": {
            "type": "integer"
          },
          "rpId": {
            "type": "string"
          },
          "allowCredentials": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "userVerification": {
            "type": "string"
          }
        }
      },
      "PasskeyRegistrationResponse": {
        "type": "object",
        "required": [
          "id",
          "attestationObject",
          "clientDataJSON"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "rawId": {
            "type": "string"
          },
          "transports": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "attestationObject": {
            "type": "string"
          },
          "clientDataJSON": {
            "type": "string"
          },
          "authenticatorAttachment": {
            "type": [
              "string",
              "null"
            ]
          },
          "clientExtensionResults": {
            "type": [
              "object",
              "null"
            ]
          }
        }
      },
      "PasskeyAuthenticationResponse": {
        "type": "object",
        "required": [
          "id",
          "authenticatorData",
          "signature",
          "clientDataJSON"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "rawId": {
            "type": "string"
          },
          "authenticatorData": {
            "type": "string"
          },
          "signature": {
            "type": "string"
          },
          "clientDataJSON": {
            "type": "string"
          },
          "userHandle": {
            "type": [
              "string",
              "null"
            ]
          },
          "authenticatorAttachment": {
            "type": [
              "string",
              "null"
            ]
          },
          "clientExtensionResults": {
            "type": [
              "object",
              "null"
            ]
          }
        }
      },
      "PasskeyRegistrationResult": {
        "type": "object",
        "required": [
          "id",
          "credentialId",
          "signCount",
          "backedUp"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "credentialId": {
            "type": "string"
          },
          "signCount": {
            "type": "integer",
            "format": "int64"
          },
          "backedUp": {
            "type": "boolean"
          }
        }
      },
      "PasskeyAssertionResult": {
        "type": "object",
        "required": [
          "userVerified",
          "newCounter",
          "backedUp"
        ],
        "properties": {
          "userVerified": {
            "type": "boolean"
          },
          "newCounter": {
            "type": "integer"
          },
          "backedUp": {
            "type": "boolean"
          }
        }
      },
      "PasskeyStepUpResult": {
        "type": "object",
        "required": [
          "authenticatedAtMillis",
          "userVerified"
        ],
        "properties": {
          "authenticatedAtMillis": {
            "type": "integer",
            "format": "int64"
          },
          "userVerified": {
            "type": "boolean"
          }
        }
      },
      "PasskeyLabelUpdate": {
        "type": "object",
        "required": [
          "label"
        ],
        "properties": {
          "label": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          }
        }
      },
      "PasskeySummary": {
        "type": "object",
        "description": "Browser-safe passkey metadata. Protected-object and raw credential identifiers are never published.",
        "required": [
          "id",
          "signCount",
          "transports",
          "backedUp",
          "createdAtMillis"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "label": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "createdAtMillis": {
            "type": "integer",
            "format": "int64"
          },
          "lastUsedAtMillis": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "signCount": {
            "type": "integer",
            "format": "int64"
          },
          "transports": {
            "type": [
              "string",
              "null"
            ]
          },
          "backedUp": {
            "type": "boolean"
          }
        }
      },
      "AdminAccount": {
        "type": "object",
        "required": [
          "id",
          "displayName",
          "status",
          "createdAtMillis",
          "activeSessions",
          "verifiedContacts",
          "passkeys",
          "capabilities"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "displayName": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "disabled"
            ]
          },
          "createdAtMillis": {
            "type": "integer",
            "format": "int64"
          },
          "activeSessions": {
            "type": "integer",
            "format": "int64"
          },
          "verifiedContacts": {
            "type": "integer",
            "format": "int64"
          },
          "passkeys": {
            "type": "integer",
            "format": "int64"
          },
          "capabilities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccountCapability"
            }
          }
        }
      },
      "AdminAccountPage": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AdminAccount"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "AccountStatusUpdate": {
        "type": "object",
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "active",
              "disabled"
            ]
          }
        }
      },
      "RevokedSessions": {
        "type": "object",
        "required": [
          "revoked"
        ],
        "properties": {
          "revoked": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "AccountCapability": {
        "type": "string",
        "enum": [
          "admin_jobs",
          "admin_catalog",
          "admin_storage",
          "admin_providers",
          "admin_reports",
          "admin_accounts"
        ],
        "description": "Administrative capability granted by account. Runtime and contract registries must not drift."
      },
      "GoogleSignInNonce": {
        "type": "object",
        "required": [
          "nonce",
          "expiresAtMillis"
        ],
        "properties": {
          "nonce": {
            "type": "string"
          },
          "expiresAtMillis": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "GoogleSignInToken": {
        "type": "object",
        "required": [
          "idToken"
        ],
        "properties": {
          "idToken": {
            "type": "string",
            "description": "Google ID token whose nonce claim matches an outstanding sign-in nonce."
          }
        }
      },
      "TrackListenerState": {
        "type": "object",
        "required": [
          "favorite",
          "rating",
          "disliked"
        ],
        "properties": {
          "favorite": {
            "type": "boolean"
          },
          "rating": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 5
          },
          "disliked": {
            "type": "boolean"
          }
        },
        "description": "Favorite, rating and dislike are independent facts on the canonical Track."
      },
      "RatingUpdate": {
        "type": "object",
        "required": [
          "rating"
        ],
        "properties": {
          "rating": {
            "type": "integer",
            "minimum": 1,
            "maximum": 5
          }
        }
      },
      "Genre": {
        "type": "object",
        "required": [
          "id",
          "id3Index",
          "name",
          "extension"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "id3Index": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000
          },
          "name": {
            "type": "string",
            "maxLength": 100
          },
          "extension": {
            "type": "boolean"
          }
        }
      },
      "GenreRegistry": {
        "type": "object",
        "required": [
          "registryVersion",
          "items"
        ],
        "properties": {
          "registryVersion": {
            "type": "integer"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Genre"
            }
          }
        }
      },
      "ListenerPreference": {
        "type": "object",
        "required": [
          "autoplayEnabled",
          "preferLossless",
          "scrobbleEnabled",
          "excludedGenreIds"
        ],
        "properties": {
          "autoplayEnabled": {
            "type": "boolean"
          },
          "preferLossless": {
            "type": "boolean"
          },
          "scrobbleEnabled": {
            "type": "boolean"
          },
          "excludedGenreIds": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        }
      },
      "AutoplayPolicy": {
        "type": "object",
        "required": [
          "enabled",
          "excludedGenres",
          "excludesDisliked",
          "affectsExplicitPlayback"
        ],
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "excludedGenres": {
            "type": "integer"
          },
          "excludesDisliked": {
            "type": "boolean"
          },
          "affectsExplicitPlayback": {
            "type": "boolean"
          }
        }
      },
      "AutoplayPage": {
        "type": "object",
        "required": [
          "items",
          "policy"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Track"
            }
          },
          "policy": {
            "$ref": "#/components/schemas/AutoplayPolicy"
          }
        }
      },
      "TrackGenresUpdate": {
        "type": "object",
        "required": [
          "genres"
        ],
        "properties": {
          "genres": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "type": "string",
              "maxLength": 100
            }
          }
        }
      },
      "MqlField": {
        "type": "object",
        "required": [
          "name",
          "kind",
          "nullable",
          "description"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "string",
              "int",
              "bool"
            ]
          },
          "nullable": {
            "type": "boolean"
          },
          "description": {
            "type": "string"
          }
        }
      },
      "MqlRegistry": {
        "type": "object",
        "required": [
          "version",
          "fields"
        ],
        "properties": {
          "version": {
            "type": "string",
            "const": "mql/1"
          },
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MqlField"
            }
          }
        }
      },
      "MqlError": {
        "type": "object",
        "required": [
          "code",
          "message",
          "start",
          "end"
        ],
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "start": {
            "type": "integer",
            "description": "UTF-8 byte offset, inclusive."
          },
          "end": {
            "type": "integer",
            "description": "UTF-8 byte offset, exclusive."
          }
        }
      },
      "MqlValidateRequest": {
        "type": "object",
        "required": [
          "query"
        ],
        "properties": {
          "query": {
            "type": "string",
            "maxLength": 2000
          }
        }
      },
      "MqlValidation": {
        "type": "object",
        "required": [
          "valid",
          "version",
          "errors"
        ],
        "properties": {
          "valid": {
            "type": "boolean"
          },
          "version": {
            "type": "string",
            "const": "mql/1"
          },
          "nodeCount": {
            "type": [
              "integer",
              "null"
            ]
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MqlError"
            }
          }
        }
      },
      "MqlExecuteRequest": {
        "type": "object",
        "required": [
          "query"
        ],
        "properties": {
          "query": {
            "type": "string",
            "maxLength": 2000
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100,
            "default": 25
          },
          "cursor": {
            "type": "string",
            "maxLength": 512
          }
        }
      },
      "MqlExecution": {
        "type": "object",
        "required": [
          "version",
          "items"
        ],
        "properties": {
          "version": {
            "type": "string",
            "const": "mql/1"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Track"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "PlaylistConcert": {
        "type": "object",
        "properties": {
          "artistId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "date": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 10
          },
          "venue": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 300
          },
          "city": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200
          }
        }
      },
      "Playlist": {
        "type": "object",
        "required": [
          "id",
          "ownerId",
          "title",
          "kind",
          "visibility",
          "revision",
          "entryCount",
          "updatedAtMillis",
          "owned"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "ownerId": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string",
            "maxLength": 200
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "kind": {
            "type": "string",
            "enum": [
              "static",
              "dynamic",
              "concert"
            ]
          },
          "visibility": {
            "type": "string",
            "enum": [
              "private",
              "public"
            ]
          },
          "mqlQuery": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "concert": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/PlaylistConcert"
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "entryCount": {
            "type": "integer",
            "format": "int64"
          },
          "updatedAtMillis": {
            "type": "integer",
            "format": "int64"
          },
          "owned": {
            "type": "boolean"
          },
          "artworkUrl": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "PlaylistEntry": {
        "type": "object",
        "required": [
          "id",
          "trackId",
          "title",
          "position",
          "available"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Occurrence identity; the same Track may repeat."
          },
          "trackId": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "position": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10000
          },
          "section": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200
          },
          "available": {
            "type": "boolean"
          }
        }
      },
      "PlaylistEvaluation": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Track"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "PlaylistDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Playlist"
          },
          {
            "type": "object",
            "required": [
              "entries"
            ],
            "properties": {
              "entries": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/PlaylistEntry"
                }
              },
              "evaluated": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/PlaylistEvaluation"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            }
          }
        ]
      },
      "PlaylistPage": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Playlist"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "PlaylistCreate": {
        "type": "object",
        "required": [
          "title",
          "kind"
        ],
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 200
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "kind": {
            "type": "string",
            "enum": [
              "static",
              "dynamic",
              "concert"
            ]
          },
          "visibility": {
            "type": "string",
            "enum": [
              "private",
              "public"
            ]
          },
          "mqlQuery": {
            "type": "string",
            "maxLength": 2000
          },
          "concert": {
            "$ref": "#/components/schemas/PlaylistConcert"
          }
        }
      },
      "PlaylistUpdate": {
        "type": "object",
        "required": [
          "revision"
        ],
        "properties": {
          "revision": {
            "type": "integer",
            "format": "int64"
          },
          "title": {
            "type": "string",
            "maxLength": 200
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "visibility": {
            "type": "string",
            "enum": [
              "private",
              "public"
            ]
          },
          "mqlQuery": {
            "type": "string",
            "maxLength": 2000
          },
          "concert": {
            "$ref": "#/components/schemas/PlaylistConcert"
          }
        }
      },
      "PlaylistEntryCreate": {
        "type": "object",
        "required": [
          "revision",
          "trackId"
        ],
        "properties": {
          "revision": {
            "type": "integer",
            "format": "int64"
          },
          "trackId": {
            "type": "string",
            "format": "uuid"
          },
          "position": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10000
          },
          "section": {
            "type": "string",
            "maxLength": 100
          },
          "note": {
            "type": "string",
            "maxLength": 200
          }
        }
      },
      "PlaylistEntryMove": {
        "type": "object",
        "required": [
          "revision",
          "position"
        ],
        "properties": {
          "revision": {
            "type": "integer",
            "format": "int64"
          },
          "position": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10000
          },
          "section": {
            "type": [
              "string",
              "null"
            ]
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "PlaylistReorder": {
        "type": "object",
        "required": [
          "revision",
          "entryIds"
        ],
        "properties": {
          "revision": {
            "type": "integer",
            "format": "int64"
          },
          "entryIds": {
            "type": "array",
            "maxItems": 9999,
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        }
      },
      "PlaylistRevision": {
        "type": "object",
        "required": [
          "revision"
        ],
        "properties": {
          "revision": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "PlaylistAddedEntry": {
        "type": "object",
        "required": [
          "revision",
          "entryId"
        ],
        "properties": {
          "revision": {
            "type": "integer",
            "format": "int64"
          },
          "entryId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "PlaylistImportEntry": {
        "type": "object",
        "required": [
          "trackId"
        ],
        "properties": {
          "trackId": {
            "type": "string",
            "format": "uuid"
          },
          "section": {
            "type": "string",
            "maxLength": 100
          },
          "note": {
            "type": "string",
            "maxLength": 200
          }
        }
      },
      "PlaylistImport": {
        "type": "object",
        "required": [
          "mode",
          "idempotencyKey",
          "entries"
        ],
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "create",
              "append",
              "replace"
            ]
          },
          "idempotencyKey": {
            "type": "string",
            "maxLength": 200
          },
          "playlistId": {
            "type": "string",
            "format": "uuid"
          },
          "revision": {
            "type": "integer",
            "format": "int64"
          },
          "playlist": {
            "$ref": "#/components/schemas/PlaylistCreate"
          },
          "entries": {
            "type": "array",
            "maxItems": 9999,
            "items": {
              "$ref": "#/components/schemas/PlaylistImportEntry"
            }
          }
        }
      },
      "PlaylistImportResult": {
        "type": "object",
        "required": [
          "playlistId",
          "revision",
          "entriesWritten",
          "replayed"
        ],
        "properties": {
          "playlistId": {
            "type": "string",
            "format": "uuid"
          },
          "revision": {
            "type": "integer",
            "format": "int64"
          },
          "entriesWritten": {
            "type": "integer",
            "format": "int64"
          },
          "replayed": {
            "type": "boolean"
          }
        }
      },
      "PlaylistExport": {
        "type": "object",
        "required": [
          "schema",
          "playlistId",
          "revision",
          "title",
          "kind",
          "visibility",
          "exportedAtMillis",
          "entries"
        ],
        "properties": {
          "schema": {
            "type": "string",
            "const": "melodee-playlist/1"
          },
          "playlistId": {
            "type": "string",
            "format": "uuid"
          },
          "revision": {
            "type": "integer",
            "format": "int64"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "kind": {
            "type": "string",
            "enum": [
              "static",
              "dynamic",
              "concert"
            ]
          },
          "visibility": {
            "type": "string",
            "enum": [
              "private",
              "public"
            ]
          },
          "mqlQuery": {
            "type": [
              "string",
              "null"
            ]
          },
          "concert": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/PlaylistConcert"
              },
              {
                "type": "null"
              }
            ]
          },
          "exportedAtMillis": {
            "type": "integer",
            "format": "int64"
          },
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PlaylistEntry"
            }
          }
        }
      },
      "HistoryEvent": {
        "type": "object",
        "required": [
          "id",
          "trackId",
          "title",
          "occurredAtMillis",
          "playedMillis",
          "source"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "trackId": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "occurredAtMillis": {
            "type": "integer",
            "format": "int64"
          },
          "playedMillis": {
            "type": "integer",
            "format": "int64"
          },
          "source": {
            "type": "string"
          }
        }
      },
      "HistoryPage": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/HistoryEvent"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "RecentTrack": {
        "type": "object",
        "required": [
          "trackId",
          "title",
          "lastPlayedAtMillis",
          "playCount"
        ],
        "properties": {
          "trackId": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "lastPlayedAtMillis": {
            "type": "integer",
            "format": "int64"
          },
          "playCount": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "RecentPage": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RecentTrack"
            }
          }
        }
      },
      "ListeningTotals": {
        "type": "object",
        "required": [
          "plays",
          "playedMillis",
          "distinctTracks",
          "distinctArtists",
          "distinctReleases"
        ],
        "properties": {
          "plays": {
            "type": "integer",
            "format": "int64"
          },
          "playedMillis": {
            "type": "integer",
            "format": "int64"
          },
          "distinctTracks": {
            "type": "integer",
            "format": "int64"
          },
          "distinctArtists": {
            "type": "integer",
            "format": "int64"
          },
          "distinctReleases": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "ListeningDay": {
        "type": "object",
        "required": [
          "date",
          "plays",
          "playedMillis"
        ],
        "properties": {
          "date": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "plays": {
            "type": "integer",
            "format": "int64"
          },
          "playedMillis": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "TrackChartRow": {
        "type": "object",
        "required": [
          "trackId",
          "title",
          "plays",
          "playedMillis"
        ],
        "properties": {
          "trackId": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "plays": {
            "type": "integer",
            "format": "int64"
          },
          "playedMillis": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "ArtistChartRow": {
        "type": "object",
        "required": [
          "artistId",
          "name",
          "plays",
          "playedMillis"
        ],
        "properties": {
          "artistId": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "plays": {
            "type": "integer",
            "format": "int64"
          },
          "playedMillis": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "ReleaseChartRow": {
        "type": "object",
        "required": [
          "releaseId",
          "title",
          "plays",
          "playedMillis"
        ],
        "properties": {
          "releaseId": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "plays": {
            "type": "integer",
            "format": "int64"
          },
          "playedMillis": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "ListeningStats": {
        "type": "object",
        "required": [
          "fromMillis",
          "toMillis",
          "timezone",
          "totals",
          "days",
          "topTracks",
          "topArtists",
          "topReleases"
        ],
        "properties": {
          "fromMillis": {
            "type": "integer",
            "format": "int64"
          },
          "toMillis": {
            "type": "integer",
            "format": "int64"
          },
          "timezone": {
            "type": "string"
          },
          "totals": {
            "$ref": "#/components/schemas/ListeningTotals"
          },
          "days": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ListeningDay"
            }
          },
          "topTracks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TrackChartRow"
            }
          },
          "topArtists": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ArtistChartRow"
            }
          },
          "topReleases": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReleaseChartRow"
            }
          }
        }
      },
      "PortableTrackRef": {
        "type": "object",
        "properties": {
          "trackId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "legacyRef": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 300
          },
          "title": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 1000
          },
          "artist": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 1000
          },
          "durationMs": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          }
        }
      },
      "PortableFavorite": {
        "type": "object",
        "properties": {
          "track": {
            "$ref": "#/components/schemas/PortableTrackRef"
          },
          "favoritedAtMillis": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          }
        }
      },
      "PortableRating": {
        "type": "object",
        "properties": {
          "track": {
            "$ref": "#/components/schemas/PortableTrackRef"
          },
          "rating": {
            "type": "integer",
            "minimum": 1,
            "maximum": 5
          },
          "ratedAtMillis": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          }
        }
      },
      "PortableDislike": {
        "type": "object",
        "properties": {
          "track": {
            "$ref": "#/components/schemas/PortableTrackRef"
          },
          "dislikedAtMillis": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          }
        }
      },
      "PortableHistoryEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 200
          },
          "track": {
            "$ref": "#/components/schemas/PortableTrackRef"
          },
          "occurredAtMillis": {
            "type": "integer",
            "format": "int64"
          },
          "playedMs": {
            "type": "integer",
            "minimum": 0
          },
          "source": {
            "type": [
              "string",
              "null"
            ]
          },
          "qualification": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "PortableHistorySummary": {
        "type": "object",
        "properties": {
          "track": {
            "$ref": "#/components/schemas/PortableTrackRef"
          },
          "playCount": {
            "type": "integer",
            "minimum": 0
          },
          "playedMs": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "lastPlayedAtMillis": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          }
        }
      },
      "PortableHistory": {
        "type": "object",
        "properties": {
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PortableHistoryEvent"
            }
          },
          "summaries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PortableHistorySummary"
            }
          }
        }
      },
      "PortableConcert": {
        "type": "object",
        "properties": {
          "artistId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "date": {
            "type": [
              "string",
              "null"
            ]
          },
          "venue": {
            "type": [
              "string",
              "null"
            ]
          },
          "city": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "PortablePlaylistEntry": {
        "type": "object",
        "properties": {
          "track": {
            "$ref": "#/components/schemas/PortableTrackRef"
          },
          "section": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200
          }
        }
      },
      "PortablePlaylist": {
        "type": "object",
        "properties": {
          "id": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 300
          },
          "title": {
            "type": "string",
            "maxLength": 200
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "kind": {
            "type": "string",
            "enum": [
              "static",
              "dynamic",
              "concert"
            ]
          },
          "visibility": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "private",
              "public",
              null
            ]
          },
          "mqlQuery": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "concert": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/PortableConcert"
              },
              {
                "type": "null"
              }
            ]
          },
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PortablePlaylistEntry"
            }
          }
        }
      },
      "PortablePreferences": {
        "type": "object",
        "properties": {
          "autoplayEnabled": {
            "type": "boolean"
          },
          "preferLossless": {
            "type": "boolean"
          },
          "scrobbleEnabled": {
            "type": "boolean"
          },
          "excludedGenres": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "PortableSource": {
        "type": "object",
        "properties": {
          "namespace": {
            "type": "string",
            "maxLength": 200
          },
          "instance": {
            "type": "string",
            "maxLength": 200
          },
          "exportedAtMillis": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "UserStateDocument": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schema",
          "source"
        ],
        "properties": {
          "schema": {
            "type": "string",
            "const": "melodee-user-state/1"
          },
          "source": {
            "$ref": "#/components/schemas/PortableSource"
          },
          "favorites": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PortableFavorite"
            }
          },
          "ratings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PortableRating"
            }
          },
          "dislikes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PortableDislike"
            }
          },
          "history": {
            "$ref": "#/components/schemas/PortableHistory"
          },
          "playlists": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PortablePlaylist"
            }
          },
          "preferences": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/PortablePreferences"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "LegacyMapping": {
        "type": "object",
        "required": [
          "legacyRef",
          "trackId"
        ],
        "properties": {
          "legacyRef": {
            "type": "string",
            "maxLength": 300
          },
          "trackId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "ImportPlan": {
        "type": "object",
        "required": [
          "id",
          "targetAccountId",
          "createdBy",
          "sourceNamespace",
          "sourceInstance",
          "schemaVersion",
          "contentDigest",
          "status",
          "itemCount",
          "appliedCount",
          "conflictCount",
          "unresolvedCount",
          "cursorOrdinal",
          "planRevision",
          "createdAtMillis"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "targetAccountId": {
            "type": "string",
            "format": "uuid"
          },
          "createdBy": {
            "type": "string"
          },
          "sourceNamespace": {
            "type": "string"
          },
          "sourceInstance": {
            "type": "string"
          },
          "schemaVersion": {
            "type": "string"
          },
          "contentDigest": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "status": {
            "type": "string",
            "enum": [
              "preview",
              "applied",
              "failed"
            ]
          },
          "itemCount": {
            "type": "integer"
          },
          "appliedCount": {
            "type": "integer"
          },
          "conflictCount": {
            "type": "integer"
          },
          "unresolvedCount": {
            "type": "integer"
          },
          "cursorOrdinal": {
            "type": "integer"
          },
          "planRevision": {
            "type": "integer",
            "format": "int64"
          },
          "createdAtMillis": {
            "type": "integer",
            "format": "int64"
          },
          "appliedAtMillis": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          }
        }
      },
      "ImportPlanItem": {
        "type": "object",
        "required": [
          "ordinal",
          "kind",
          "decision"
        ],
        "properties": {
          "ordinal": {
            "type": "integer"
          },
          "kind": {
            "type": "string",
            "enum": [
              "favorite",
              "rating",
              "dislike",
              "history_event",
              "history_summary",
              "playlist",
              "preference"
            ]
          },
          "decision": {
            "type": "string",
            "enum": [
              "apply",
              "applied",
              "skip_newer",
              "conflict",
              "unresolved",
              "skipped"
            ]
          },
          "detail": {
            "type": [
              "string",
              "null"
            ]
          },
          "sourceRef": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ImportPreviewRequest": {
        "type": "object",
        "required": [
          "document"
        ],
        "properties": {
          "document": {
            "$ref": "#/components/schemas/UserStateDocument"
          },
          "mappings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LegacyMapping"
            }
          },
          "targetAccountId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "idempotencyKey": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200
          }
        }
      },
      "ImportPreviewResponse": {
        "type": "object",
        "required": [
          "plan",
          "replayed",
          "conflicts",
          "unresolved"
        ],
        "properties": {
          "plan": {
            "$ref": "#/components/schemas/ImportPlan"
          },
          "replayed": {
            "type": "boolean"
          },
          "conflicts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ImportPlanItem"
            }
          },
          "unresolved": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ImportPlanItem"
            }
          }
        }
      },
      "ImportPlanDetail": {
        "type": "object",
        "required": [
          "plan",
          "items"
        ],
        "properties": {
          "plan": {
            "$ref": "#/components/schemas/ImportPlan"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ImportPlanItem"
            }
          },
          "nextCursor": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      },
      "ImportPlanList": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ImportPlan"
            }
          }
        }
      },
      "ImportApplyRequest": {
        "type": "object",
        "required": [
          "planRevision"
        ],
        "properties": {
          "planRevision": {
            "type": "integer",
            "format": "int64"
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000
          }
        }
      },
      "ImportApplyResponse": {
        "type": "object",
        "required": [
          "status",
          "appliedNow",
          "remaining",
          "planRevision",
          "appliedTotal"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "preview",
              "applied",
              "failed"
            ]
          },
          "appliedNow": {
            "type": "integer"
          },
          "remaining": {
            "type": "integer"
          },
          "planRevision": {
            "type": "integer",
            "format": "int64"
          },
          "appliedTotal": {
            "type": "integer"
          }
        }
      },
      "UserStateExport": {
        "type": "object",
        "required": [
          "document",
          "digest"
        ],
        "properties": {
          "document": {
            "$ref": "#/components/schemas/UserStateDocument"
          },
          "digest": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          }
        }
      },
      "UnresolvedReference": {
        "type": "object",
        "required": [
          "id",
          "legacyRef",
          "firstSeenMillis"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "legacyRef": {
            "type": "string"
          },
          "hints": {
            "type": [
              "string",
              "null"
            ]
          },
          "firstSeenMillis": {
            "type": "integer",
            "format": "int64"
          },
          "resolvedTrackId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          }
        }
      },
      "UnresolvedList": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UnresolvedReference"
            }
          }
        }
      },
      "ResolveReferenceRequest": {
        "type": "object",
        "required": [
          "trackId"
        ],
        "properties": {
          "trackId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "QueuedImportJob": {
        "type": "object",
        "required": [
          "jobId"
        ],
        "properties": {
          "jobId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "ShareCreate": {
        "type": "object",
        "required": [
          "targetKind",
          "targetId"
        ],
        "properties": {
          "targetKind": {
            "type": "string",
            "enum": [
              "playlist",
              "release",
              "track"
            ]
          },
          "targetId": {
            "type": "string",
            "format": "uuid"
          },
          "expiresInDays": {
            "type": "integer",
            "minimum": 1,
            "maximum": 365,
            "default": 30
          },
          "maxUses": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100000
          }
        }
      },
      "ShareCreated": {
        "type": "object",
        "required": [
          "id",
          "token",
          "sharePath",
          "expiresAtMillis"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "token": {
            "type": "string",
            "description": "Recipient token, returned exactly once and stored only as a digest."
          },
          "sharePath": {
            "type": "string"
          },
          "expiresAtMillis": {
            "type": "integer",
            "format": "int64"
          },
          "maxUses": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      },
      "ShareSummary": {
        "type": "object",
        "required": [
          "id",
          "targetKind",
          "targetId",
          "expiresAtMillis",
          "useCount",
          "revoked",
          "createdAtMillis"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "targetKind": {
            "type": "string",
            "enum": [
              "playlist",
              "release",
              "track"
            ]
          },
          "targetId": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "expiresAtMillis": {
            "type": "integer",
            "format": "int64"
          },
          "maxUses": {
            "type": [
              "integer",
              "null"
            ]
          },
          "useCount": {
            "type": "integer"
          },
          "revoked": {
            "type": "boolean"
          },
          "createdAtMillis": {
            "type": "integer",
            "format": "int64"
          },
          "lastUsedMillis": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          }
        }
      },
      "ShareList": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ShareSummary"
            }
          }
        }
      },
      "ShareRecipientItem": {
        "type": "object",
        "required": [
          "trackId",
          "title",
          "playable"
        ],
        "properties": {
          "trackId": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "durationMillis": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "position": {
            "type": [
              "integer",
              "null"
            ]
          },
          "discNumber": {
            "type": [
              "integer",
              "null"
            ]
          },
          "section": {
            "type": [
              "string",
              "null"
            ]
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "playable": {
            "type": "boolean"
          },
          "streamPath": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ShareRecipientView": {
        "type": "object",
        "required": [
          "kind",
          "expiresAtMillis",
          "playbackExpiresAtMillis",
          "items"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "playlist",
              "release",
              "track"
            ]
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "expiresAtMillis": {
            "type": "integer",
            "format": "int64"
          },
          "playbackExpiresAtMillis": {
            "type": "integer",
            "format": "int64",
            "description": "End of the bounded playback authorization window started by this metadata open. Ranges within the window do not consume the metadata-use budget."
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ShareRecipientItem"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Opaque composite cursor: (position, entry id) for playlists and (disc, position, membership id) for Releases. Stable across duplicate entries, multi-disc Releases and exact page boundaries."
          }
        }
      },
      "InboxNotification": {
        "type": "object",
        "required": [
          "id",
          "eventKind",
          "severity",
          "summary",
          "occurrences",
          "createdAtMillis"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "eventKind": {
            "type": "string"
          },
          "severity": {
            "type": "string",
            "enum": [
              "info",
              "warning",
              "critical"
            ]
          },
          "summary": {
            "type": "string"
          },
          "occurrences": {
            "type": "integer",
            "minimum": 1
          },
          "createdAtMillis": {
            "type": "integer",
            "format": "int64"
          },
          "lastOccurredAtMillis": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "readAtMillis": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          }
        }
      },
      "NotificationInbox": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InboxNotification"
            }
          }
        }
      },
      "NotificationMarked": {
        "type": "object",
        "required": [
          "updated"
        ],
        "properties": {
          "updated": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "NotificationSubscription": {
        "type": "object",
        "required": [
          "channel",
          "minimumSeverity",
          "enabled"
        ],
        "properties": {
          "channel": {
            "type": "string",
            "enum": [
              "in_app",
              "email",
              "telegram"
            ]
          },
          "minimumSeverity": {
            "type": "string",
            "enum": [
              "info",
              "warning",
              "critical"
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "eventKinds": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "type": "string"
            }
          }
        }
      },
      "NotificationSubscriptionList": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NotificationSubscription"
            }
          }
        }
      },
      "NotificationSubscriptionBody": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 3,
            "items": {
              "$ref": "#/components/schemas/NotificationSubscription"
            }
          }
        }
      },
      "CompatibilityCredentialCreate": {
        "type": "object",
        "required": [
          "protocol",
          "label"
        ],
        "properties": {
          "protocol": {
            "type": "string",
            "enum": [
              "subsonic",
              "jellyfin"
            ]
          },
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          }
        }
      },
      "CompatibilityCredentialCreated": {
        "type": "object",
        "required": [
          "id",
          "protocol",
          "label",
          "username",
          "secret",
          "createdAtMillis"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "protocol": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "username": {
            "type": "string"
          },
          "secret": {
            "type": "string",
            "description": "One-time compatibility secret; stored only as a SHA-256 digest."
          },
          "createdAtMillis": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "CompatibilityCredential": {
        "type": "object",
        "required": [
          "id",
          "protocol",
          "label",
          "createdAtMillis",
          "revoked"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "protocol": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "createdAtMillis": {
            "type": "integer",
            "format": "int64"
          },
          "lastUsedMillis": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64"
          },
          "revoked": {
            "type": "boolean"
          }
        }
      },
      "CompatibilityCredentialList": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CompatibilityCredential"
            }
          }
        }
      }
    }
  },
  "paths": {
    "/healthz": {
      "get": {
        "operationId": "healthz",
        "summary": "Liveness",
        "tags": [
          "system"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Live",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Liveness"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/openapi.json": {
      "get": {
        "operationId": "getOpenApi",
        "summary": "Published OpenAPI contract",
        "tags": [
          "system"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "OpenAPI document",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/capabilities": {
      "get": {
        "operationId": "getCapabilities",
        "summary": "Native API capabilities",
        "tags": [
          "system"
        ],
        "responses": {
          "200": {
            "description": "Capabilities",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Capabilities"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ]
      }
    },
    "/api/v1/artists": {
      "get": {
        "operationId": "listArtists",
        "summary": "List Artists",
        "tags": [
          "catalog"
        ],
        "responses": {
          "200": {
            "description": "Page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PageArtist"
                }
              }
            }
          },
          "400": {
            "description": "Stable error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/api/v1/releases": {
      "get": {
        "operationId": "listReleases",
        "summary": "List Releases",
        "tags": [
          "catalog"
        ],
        "responses": {
          "200": {
            "description": "Page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PageRelease"
                }
              }
            }
          },
          "400": {
            "description": "Stable error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/api/v1/releases/{release_id}": {
      "get": {
        "operationId": "getRelease",
        "summary": "Release detail",
        "tags": [
          "catalog"
        ],
        "responses": {
          "200": {
            "description": "Release",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReleaseDetail"
                }
              }
            }
          },
          "404": {
            "description": "Stable error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "release_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/api/v1/tracks": {
      "get": {
        "operationId": "listTracks",
        "summary": "List Tracks",
        "tags": [
          "catalog"
        ],
        "responses": {
          "200": {
            "description": "Page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PageTrack"
                }
              }
            }
          },
          "400": {
            "description": "Stable error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/api/v1/tracks/{track_id}": {
      "get": {
        "operationId": "getTrack",
        "summary": "Track detail",
        "tags": [
          "catalog"
        ],
        "responses": {
          "200": {
            "description": "Track",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrackDetail"
                }
              }
            }
          },
          "404": {
            "description": "Stable error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "track_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/api/v1/tracks/{track_id}/favorite": {
      "get": {
        "operationId": "getFavorite",
        "summary": "Favorite state",
        "tags": [
          "favorites"
        ],
        "responses": {
          "200": {
            "description": "State",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Favorite"
                }
              }
            }
          },
          "404": {
            "description": "Stable error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "track_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "put": {
        "operationId": "setFavorite",
        "summary": "Set favorite",
        "tags": [
          "favorites"
        ],
        "responses": {
          "200": {
            "description": "State",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Favorite"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "track_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "delete": {
        "operationId": "removeFavorite",
        "summary": "Remove favorite",
        "tags": [
          "favorites"
        ],
        "responses": {
          "200": {
            "description": "State",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Favorite"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "track_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/api/v1/tracks/{track_id}/stream": {
      "get": {
        "operationId": "streamTrack",
        "summary": "Stream immutable preferred asset",
        "tags": [
          "playback"
        ],
        "responses": {
          "200": {
            "description": "Audio bytes",
            "content": {
              "audio/mpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "206": {
            "description": "Partial content",
            "content": {
              "audio/mpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "304": {
            "description": "Not modified"
          },
          "404": {
            "description": "Stable error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "416": {
            "description": "Stable error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "track_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Range",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-None-Match",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/v1/favorites": {
      "get": {
        "operationId": "listFavorites",
        "summary": "List favorites",
        "tags": [
          "favorites"
        ],
        "responses": {
          "200": {
            "description": "Tracks",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PageTrack"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/api/v1/search": {
      "get": {
        "operationId": "search",
        "summary": "Search Artists/Releases/Tracks",
        "tags": [
          "catalog"
        ],
        "responses": {
          "200": {
            "description": "Search",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Search"
                }
              }
            }
          },
          "400": {
            "description": "Stable error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/v1/plays": {
      "post": {
        "operationId": "recordPlay",
        "summary": "Record a qualified playback event",
        "tags": [
          "playback"
        ],
        "responses": {
          "201": {
            "description": "Recorded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlayResult"
                }
              }
            }
          },
          "400": {
            "description": "Stable error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Stable error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlayRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/automation-tokens": {
      "get": {
        "operationId": "listAutomationTokens",
        "summary": "List automation credentials",
        "tags": [
          "auth"
        ],
        "responses": {
          "200": {
            "description": "Tokens",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AutomationToken"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ]
      },
      "post": {
        "operationId": "issueAutomationToken",
        "summary": "Issue a scoped automation credential",
        "tags": [
          "auth"
        ],
        "responses": {
          "201": {
            "description": "Issued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationTokenIssued"
                }
              }
            }
          },
          "422": {
            "description": "Unknown or invalid scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutomationTokenRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/automation-tokens/{token_id}": {
      "delete": {
        "operationId": "revokeAutomationToken",
        "summary": "Revoke an automation credential",
        "tags": [
          "auth"
        ],
        "responses": {
          "204": {
            "description": "Revoked"
          },
          "404": {
            "description": "Stable error envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "token_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/api/v1/auth/passkeys/sign-in/start": {
      "get": {
        "operationId": "startPasskeySignIn",
        "summary": "Start discoverable passkey sign-in",
        "tags": [
          "auth"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Browser challenge and flow cookie",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/passkeys/sign-in/finish": {
      "post": {
        "operationId": "finishPasskeySignIn",
        "summary": "Finish discoverable passkey sign-in",
        "tags": [
          "auth"
        ],
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasskeyAuthenticationResponse"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Browser session cookie or native bearer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionResponse"
                }
              }
            },
            "headers": {
              "Set-Cookie": {
                "description": "HttpOnly session cookie and readable CSRF cookie (browser responses only)",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Ceremony missing or consumed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Assertion verification failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/device/code": {
      "post": {
        "operationId": "startDeviceAuthorization",
        "summary": "Start headless device authorization",
        "tags": [
          "auth"
        ],
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeviceCodeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Codes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeviceCodeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid client"
          }
        }
      }
    },
    "/api/v1/auth/device/approve": {
      "post": {
        "operationId": "approveDeviceAuthorization",
        "summary": "Approve a device code from a recent session",
        "tags": [
          "auth"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "userCode"
                ],
                "properties": {
                  "userCode": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Approved scopes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "scopes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Session required"
          },
          "429": {
            "description": "Attempt budget exhausted"
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ]
      }
    },
    "/api/v1/auth/device/token": {
      "post": {
        "operationId": "pollDeviceToken",
        "summary": "Poll for a device credential",
        "tags": [
          "auth"
        ],
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "clientId",
                  "deviceCode"
                ],
                "properties": {
                  "clientId": {
                    "type": "string"
                  },
                  "deviceCode": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Scoped credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeviceTokenResponse"
                }
              }
            }
          },
          "400": {
            "description": "Pending/slow/denied/expired"
          }
        }
      }
    },
    "/api/v1/auth/device/deny": {
      "post": {
        "operationId": "denyDeviceAuthorization",
        "summary": "Deny a pending device code from a recent session",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "userCode"
                ],
                "properties": {
                  "userCode": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Denied"
          },
          "400": {
            "description": "Invalid code"
          },
          "401": {
            "description": "Session required"
          },
          "429": {
            "description": "Attempt budget exhausted"
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/job-controls": {
      "get": {
        "operationId": "adminListJobControls",
        "summary": "adminListJobControls",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Controls",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/JobControl"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/job-controls/{kind}": {
      "put": {
        "operationId": "adminUpdateJobControl",
        "summary": "adminUpdateJobControl",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Revision",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Revision"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JobControlUpdate"
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/job-schedules": {
      "get": {
        "operationId": "adminListJobSchedules",
        "summary": "adminListJobSchedules",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Schedules",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/JobSchedule"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "adminCreateJobSchedule",
        "summary": "adminCreateJobSchedule",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "201": {
            "description": "Schedule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobSchedule"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScheduleCreate"
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/job-schedules/run-due": {
      "post": {
        "operationId": "adminRunDueJobSchedules",
        "summary": "adminRunDueJobSchedules",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/job-schedules/{schedule_id}": {
      "put": {
        "operationId": "adminUpdateJobSchedule",
        "summary": "adminUpdateJobSchedule",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Revision",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Revision"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "schedule_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScheduleUpdate"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "adminDeleteJobSchedule",
        "summary": "adminDeleteJobSchedule",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Unknown schedule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "schedule_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/api/v1/admin/jobs/{job_id}": {
      "get": {
        "operationId": "adminGetJob",
        "summary": "adminGetJob",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Job",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobSnapshot"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/api/v1/admin/jobs/{job_id}/cancel": {
      "post": {
        "operationId": "adminCancelJob",
        "summary": "adminCancelJob",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Job",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobSnapshot"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JobReason"
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/jobs/{job_id}/retry": {
      "post": {
        "operationId": "adminRetryJob",
        "summary": "adminRetryJob",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Job",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobSnapshot"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JobReason"
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/jobs/{job_id}/progress": {
      "put": {
        "operationId": "adminUpdateJobProgress",
        "summary": "adminUpdateJobProgress",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "204": {
            "description": "Updated"
          }
        },
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JobProgress"
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/jobs/{job_id}/events": {
      "get": {
        "operationId": "adminJobEvents",
        "summary": "adminJobEvents",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Server-sent job progress/state events",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                },
                "example": "event: snapshot\\ndata: {}\\n\\n"
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "once",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "Emit one event and close the stream"
          }
        ]
      }
    },
    "/api/v1/admin/reviews": {
      "get": {
        "operationId": "adminListReviews",
        "summary": "adminListReviews",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewPage"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/reviews/{review_id}/resolve": {
      "post": {
        "operationId": "adminResolveReview",
        "summary": "adminResolveReview",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "review_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReviewResolveRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/tracks/{track_id}/locks": {
      "get": {
        "operationId": "adminTrackLocks",
        "summary": "adminTrackLocks",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrackLocks"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "track_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/api/v1/admin/tracks/{track_id}/locks/{field}": {
      "put": {
        "operationId": "adminSetTrackLock",
        "summary": "adminSetTrackLock",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Lock"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "track_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "field",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LockRequest"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "adminReleaseTrackLock",
        "summary": "adminReleaseTrackLock",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "track_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "field",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/v1/admin/tracks/{track_id}/asset-lock": {
      "put": {
        "operationId": "adminLockTrackAsset",
        "summary": "adminLockTrackAsset",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "track_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssetLockRequest"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "adminReleaseTrackAsset",
        "summary": "adminReleaseTrackAsset",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "track_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/api/v1/admin/releases/{release_id}/locks": {
      "get": {
        "operationId": "adminReleaseLocks",
        "summary": "adminReleaseLocks",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Lock"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "release_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/api/v1/admin/releases/{release_id}/locks/{field}": {
      "put": {
        "operationId": "adminSetReleaseLock",
        "summary": "adminSetReleaseLock",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "release_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "field",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LockRequest"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "adminReleaseReleaseLock",
        "summary": "adminReleaseReleaseLock",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "release_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "field",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/v1/admin/artists/{artist_id}/locks": {
      "get": {
        "operationId": "adminArtistLocks",
        "summary": "adminArtistLocks",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Lock"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "artist_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/api/v1/admin/artists/{artist_id}/locks/{field}": {
      "put": {
        "operationId": "adminSetArtistLock",
        "summary": "adminSetArtistLock",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "artist_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "field",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LockRequest"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "adminReleaseArtistLock",
        "summary": "adminReleaseArtistLock",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "artist_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "field",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/v1/admin/artists/{artist_id}/aliases": {
      "post": {
        "operationId": "adminCreateArtistAlias",
        "summary": "adminCreateArtistAlias",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "artist_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AliasRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/match-decisions": {
      "post": {
        "operationId": "adminRecordMatchDecision",
        "summary": "adminRecordMatchDecision",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "201": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MatchDecision"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MatchDecisionRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/tracks/{track_id}/merge": {
      "post": {
        "operationId": "adminMergeTrack",
        "summary": "adminMergeTrack",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MergeResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "track_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MergeRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/merges/{merge_id}/split": {
      "post": {
        "operationId": "adminSplitMerge",
        "summary": "adminSplitMerge",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "merge_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SplitRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/releases/{release_id}/classification": {
      "put": {
        "operationId": "adminSetReleaseClassification",
        "summary": "adminSetReleaseClassification",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Revision"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "release_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClassificationRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/storage/volumes": {
      "get": {
        "operationId": "adminListStorageVolumes",
        "summary": "adminListStorageVolumes",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Volumes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/StorageVolume"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/storage/volumes/{volume_id}": {
      "put": {
        "operationId": "adminUpdateStorageVolume",
        "summary": "adminUpdateStorageVolume",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Volume",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StorageVolume"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "volume_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VolumeControl"
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/storage/assets/{asset_id}/move": {
      "post": {
        "operationId": "adminMoveAsset",
        "summary": "adminMoveAsset",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Moved",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MoveResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "asset_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StorageMove"
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/tracks/{track_id}/quality": {
      "get": {
        "operationId": "adminTrackQuality",
        "summary": "adminTrackQuality",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Assessment"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "track_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/api/v1/admin/quality/reassess": {
      "post": {
        "operationId": "adminReassessQuality",
        "summary": "adminReassessQuality",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReassessResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/quality/calibration": {
      "get": {
        "operationId": "adminQualityCalibration",
        "summary": "adminQualityCalibration",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/legacy/track-fields": {
      "get": {
        "operationId": "adminLegacyTrackFields",
        "summary": "adminLegacyTrackFields",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Inventory",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyInventory"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/legacy/preview": {
      "post": {
        "operationId": "adminLegacyPreview",
        "summary": "adminLegacyPreview",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Report",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegacyPreview"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LegacyExport"
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/legacy/reconcile": {
      "post": {
        "operationId": "adminLegacyReconcile",
        "summary": "adminLegacyReconcile",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Report",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReconcileReport"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LegacyExport"
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/reports/catalog": {
      "get": {
        "operationId": "adminReportCatalog",
        "summary": "adminReportCatalog",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "ReportCatalog",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportCatalog"
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                },
                "example": "metric,value\n"
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv"
              ],
              "default": "json"
            }
          }
        ]
      }
    },
    "/api/v1/admin/reports/storage": {
      "get": {
        "operationId": "adminReportStorage",
        "summary": "adminReportStorage",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "ReportStorage",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportStorage"
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                },
                "example": "metric,value\n"
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv"
              ],
              "default": "json"
            }
          }
        ]
      }
    },
    "/api/v1/admin/reports/providers": {
      "get": {
        "operationId": "adminReportProviders",
        "summary": "adminReportProviders",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "ReportProviders",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportProviders"
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                },
                "example": "metric,value\n"
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv"
              ],
              "default": "json"
            }
          }
        ]
      }
    },
    "/api/v1/admin/reports/jobs": {
      "get": {
        "operationId": "adminReportJobs",
        "summary": "adminReportJobs",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "ReportJobs",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportJobs"
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                },
                "example": "metric,value\n"
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv"
              ],
              "default": "json"
            }
          }
        ]
      }
    },
    "/api/v1/admin/reports/quality": {
      "get": {
        "operationId": "adminReportQuality",
        "summary": "adminReportQuality",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "ReportQuality",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportQuality"
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                },
                "example": "metric,value\n"
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv"
              ],
              "default": "json"
            }
          }
        ]
      }
    },
    "/api/v1/admin/reports/snapshots": {
      "get": {
        "operationId": "adminListReportSnapshots",
        "summary": "adminListReportSnapshots",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Snapshots",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ReportSnapshotMeta"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "adminCaptureReportSnapshot",
        "summary": "adminCaptureReportSnapshot",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SnapshotCreated"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SnapshotRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/reports/snapshots/{snapshot_id}": {
      "get": {
        "operationId": "adminGetReportSnapshot",
        "summary": "adminGetReportSnapshot",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Snapshot payload",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "snapshot_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/api/v1/admin/reports/ingestion": {
      "get": {
        "operationId": "adminReportIngestion",
        "summary": "adminReportIngestion",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "ReportIngestion",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportIngestion"
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                },
                "example": "metric,value\n"
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid timezone or report input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv"
              ],
              "default": "json"
            }
          },
          {
            "name": "fromMillis",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "description": "Defaults to toMillis minus 30 days; range maximum 366 days."
            },
            "description": "Inclusive range start epoch milliseconds; defaults to now minus 30 days."
          },
          {
            "name": "toMillis",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "description": "Defaults to the current server instant; fromMillis must not exceed it."
            },
            "description": "Inclusive range end epoch milliseconds; defaults to now."
          },
          {
            "name": "timezone",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "UTC",
              "description": "IANA timezone name, e.g. America/New_York"
            },
            "description": "IANA reporting timezone used to map instants to local calendar days; defaults to UTC."
          }
        ]
      }
    },
    "/api/v1/admin/artworks/prune": {
      "post": {
        "operationId": "adminPruneArtwork",
        "summary": "adminPruneArtwork",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/artworks/prune-cache": {
      "post": {
        "operationId": "adminPruneArtworkCache",
        "summary": "adminPruneArtworkCache",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/artworks/{owner_kind}/{owner_id}": {
      "post": {
        "operationId": "adminUploadArtwork",
        "summary": "adminUploadArtwork",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "201": {
            "description": "Artwork revision created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArtworkResponse"
                }
              }
            }
          },
          "413": {
            "description": "Body exceeds the 10 MiB limit"
          },
          "503": {
            "description": "No writable storage volume"
          }
        },
        "parameters": [
          {
            "name": "owner_kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "owner_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "Raw JPEG or PNG body, 1 byte..10 MiB. Decoded dimensions must be <=12000 and <=80,000,000 pixels.",
          "content": {
            "image/jpeg": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            },
            "image/png": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/artworks/{owner_kind}/{owner_id}/fetch": {
      "post": {
        "operationId": "adminFetchProviderArtwork",
        "summary": "adminFetchProviderArtwork",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "201": {
            "description": "Artwork revision created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArtworkResponse"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "owner_kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "owner_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ArtworkFetchRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/corrections/export": {
      "get": {
        "operationId": "adminExportCorrections",
        "summary": "adminExportCorrections",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Correction export",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CorrectionDocument"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/corrections/import": {
      "post": {
        "operationId": "adminImportCorrections",
        "summary": "adminImportCorrections",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Import report",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CorrectionImportReport"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CorrectionDocument"
              }
            }
          }
        }
      }
    },
    "/api/v1/artworks/{artwork_id}/{revision}/{size}": {
      "get": {
        "operationId": "getArtworkVariant",
        "summary": "getArtworkVariant",
        "tags": [
          "artwork"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Immutable JPEG variant",
            "content": {
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          }
        },
        "parameters": [
          {
            "name": "artwork_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "revision",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "size",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "enum": [
                100,
                250,
                500
              ]
            }
          }
        ]
      }
    },
    "/api/v1/auth/magic-links": {
      "post": {
        "operationId": "requestMagicLink",
        "summary": "requestMagicLink",
        "tags": [
          "auth"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/magic-links/confirm": {
      "post": {
        "operationId": "confirmMagicLink",
        "summary": "confirmMagicLink",
        "tags": [
          "auth"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Magic-link sign-in: browser cookie or native bearer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionResponse"
                }
              }
            },
            "headers": {
              "Set-Cookie": {
                "description": "HttpOnly session cookie and readable CSRF cookie (browser responses only)",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Token consumed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "token"
                ],
                "properties": {
                  "token": {
                    "type": "string"
                  },
                  "binding": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/contacts": {
      "get": {
        "operationId": "listContacts",
        "summary": "listContacts",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "enrollContact",
        "summary": "enrollContact",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/contacts/verify": {
      "post": {
        "operationId": "verifyContact",
        "summary": "verifyContact",
        "tags": [
          "auth"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/recovery": {
      "post": {
        "operationId": "requestRecovery",
        "summary": "requestRecovery",
        "tags": [
          "auth"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/recovery/confirm": {
      "post": {
        "operationId": "confirmRecovery",
        "summary": "confirmRecovery",
        "tags": [
          "auth"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Account recovery: browser cookie or native bearer",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionResponse"
                }
              }
            },
            "headers": {
              "Set-Cookie": {
                "description": "HttpOnly session cookie and readable CSRF cookie (browser responses only)",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Token consumed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "token"
                ],
                "properties": {
                  "token": {
                    "type": "string"
                  },
                  "binding": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/sessions": {
      "get": {
        "operationId": "listSessions",
        "summary": "listSessions",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "revokeOtherSessions",
        "summary": "revokeOtherSessions",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/sessions/{session_id}": {
      "delete": {
        "operationId": "revokeSession",
        "summary": "revokeSession",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/api/v1/auth/identities": {
      "get": {
        "operationId": "listIdentities",
        "summary": "listIdentities",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/identities/{identity_id}": {
      "delete": {
        "operationId": "unlinkIdentity",
        "summary": "unlinkIdentity",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "identity_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/api/v1/auth/passkeys": {
      "get": {
        "operationId": "listPasskeys",
        "summary": "List registered passkeys",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Registered passkeys",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PasskeySummary"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/passkeys/{passkey_id}": {
      "delete": {
        "operationId": "revokePasskey",
        "summary": "revokePasskey",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted"
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "passkey_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "put": {
        "operationId": "updatePasskey",
        "summary": "Set or clear a passkey label",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "passkey_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasskeyLabelUpdate"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Label updated"
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown passkey",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/passkeys/register/start": {
      "post": {
        "operationId": "startPasskeyRegistration",
        "summary": "startPasskeyRegistration",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Registration challenge",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PasskeyRegistrationChallenge"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/passkeys/register/finish": {
      "post": {
        "operationId": "finishPasskeyRegistration",
        "summary": "finishPasskeyRegistration",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Registered credential metadata",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PasskeyRegistrationResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Attestation verification failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasskeyRegistrationResponse"
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/passkeys/authenticate/start": {
      "post": {
        "operationId": "startPasskeyAssertion",
        "summary": "startPasskeyAssertion",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Authentication challenge",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PasskeyAuthenticationChallenge"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "No registered passkey",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/passkeys/authenticate/finish": {
      "post": {
        "operationId": "finishPasskeyAssertion",
        "summary": "finishPasskeyAssertion",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Verified assertion",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PasskeyAssertionResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Assertion verification failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasskeyAuthenticationResponse"
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/google/nonce": {
      "post": {
        "operationId": "createGoogleNonce",
        "summary": "createGoogleNonce",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "Created"
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/google/link": {
      "post": {
        "operationId": "linkGoogleIdentity",
        "summary": "linkGoogleIdentity",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/google/start": {
      "get": {
        "operationId": "startGoogleLink",
        "summary": "startGoogleLink",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/google/callback": {
      "get": {
        "operationId": "finishGoogleLink",
        "summary": "finishGoogleLink",
        "tags": [
          "auth"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/auth/google/sign-in/start": {
      "get": {
        "operationId": "startGoogleSignIn",
        "summary": "startGoogleSignIn",
        "tags": [
          "auth"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Success"
          },
          "400": {
            "description": "Invalid request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/auth/google/sign-in/callback": {
      "get": {
        "operationId": "finishGoogleSignIn",
        "summary": "finishGoogleSignIn",
        "tags": [
          "auth"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Browser session cookie or native bearer (no return URL configured)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionResponse"
                }
              }
            },
            "headers": {
              "Set-Cookie": {
                "description": "HttpOnly session cookie and readable CSRF cookie (browser responses only)",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "303": {
            "description": "Browser redirect to the configured Auth UI return URL with session cookies",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              },
              "Set-Cookie": {
                "description": "HttpOnly session cookie and readable CSRF cookie (browser responses only)",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid callback"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/tracks/{track_id}/preferred": {
      "post": {
        "operationId": "adminSetPreferredAsset",
        "summary": "Explicitly accept a preferred media asset",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "track_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PreferredAssetRequest"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Preferred asset set"
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Authentication error"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Asset unavailable"
          }
        }
      }
    },
    "/api/v1/admin/storage/assets/{asset_id}/move-jobs": {
      "post": {
        "operationId": "adminEnqueueStorageMove",
        "summary": "Queue a verified cross-volume asset move",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "asset_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StorageMoveJob"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Queued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MoveJobResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Authentication error"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Volume unavailable"
          }
        }
      }
    },
    "/api/v1/auth/automation-tokens/self": {
      "delete": {
        "operationId": "selfRevokeAutomationToken",
        "summary": "Revoke the presenting automation credential",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Revoked"
          },
          "401": {
            "description": "Authentication error"
          },
          "403": {
            "description": "Session credential cannot self-revoke"
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/admin/providers/circuits": {
      "get": {
        "operationId": "adminListProviderCircuits",
        "summary": "List provider circuit state",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Circuits",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ProviderCircuit"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authentication error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/providers/circuits/{host}": {
      "delete": {
        "operationId": "adminResetProviderCircuit",
        "summary": "Reset a provider circuit",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "host",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Reset"
          },
          "401": {
            "description": "Authentication error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Authentication error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/storage/assets/{asset_id}/quarantine": {
      "post": {
        "operationId": "adminQuarantineAsset",
        "summary": "Quarantine a media asset",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "asset_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Updated"
          },
          "400": {
            "description": "Invalid state"
          },
          "401": {
            "description": "Authentication error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Authentication error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/storage/assets/{asset_id}/release-quarantine": {
      "post": {
        "operationId": "adminReleaseAssetQuarantine",
        "summary": "Release a quarantined media asset",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "asset_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Updated"
          },
          "400": {
            "description": "Invalid state"
          },
          "401": {
            "description": "Authentication error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Authentication error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/device/approval": {
      "get": {
        "operationId": "describeDeviceAuthorization",
        "summary": "Describe a pending device grant before consent",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "userCode",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Approval details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeviceApproval"
                }
              }
            }
          },
          "401": {
            "description": "Session required"
          },
          "403": {
            "description": "Interactive session required"
          },
          "404": {
            "description": "Unknown/expired code"
          }
        }
      }
    },
    "/api/v1/auth/logout": {
      "post": {
        "operationId": "logoutSession",
        "summary": "Revoke the current interactive session and clear browser cookies",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "Session revoked"
          },
          "401": {
            "description": "Session required"
          },
          "403": {
            "description": "Interactive session required"
          }
        }
      }
    },
    "/api/v1/admin/jobs/ingest": {
      "post": {
        "operationId": "enqueueIngest",
        "summary": "Queue an inbound Release ingestion",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IngestJobRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Queued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueuedJob"
                }
              }
            }
          },
          "400": {
            "description": "Invalid argument"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Capability/scope required"
          }
        }
      }
    },
    "/api/v1/admin/jobs/normalize": {
      "post": {
        "operationId": "enqueueNormalize",
        "summary": "Queue staged audio normalization",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NormalizeJobRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Queued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueuedJob"
                }
              }
            }
          },
          "400": {
            "description": "Invalid argument"
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Capability/scope required"
          }
        }
      }
    },
    "/api/v1/admin/jobs": {
      "get": {
        "operationId": "adminListJobs",
        "summary": "adminListJobs",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fromMillis",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "toMillis",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "schedule",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "volume",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "active",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobInventoryPage"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/admin/storage/assets": {
      "get": {
        "operationId": "adminListStorageAssets",
        "summary": "adminListStorageAssets",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "volume",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "availability",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "integrity",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "preferred",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "quarantined",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "locked",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "track",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "fromMillis",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "toMillis",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StorageAssetInventoryPage"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/admin/reviews/{review_id}": {
      "get": {
        "operationId": "adminGetReview",
        "summary": "adminGetReview",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "review_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewDetail"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/api/v1/auth/refresh": {
      "post": {
        "operationId": "refreshSession",
        "summary": "refreshSession",
        "tags": [
          "auth"
        ],
        "security": [],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefreshRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Rotated cookie session or native access credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RefreshResponse"
                }
              }
            },
            "headers": {
              "Set-Cookie": {
                "description": "HttpOnly session cookie and readable CSRF cookie (browser responses only)",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Cookie refresh from an unexpected origin",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/notifications": {
      "get": {
        "operationId": "adminListNotifications",
        "summary": "adminListNotifications",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Notifications",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NotificationDelivery"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden"
          }
        }
      }
    },
    "/api/v1/admin/notifications/test": {
      "post": {
        "operationId": "adminTestNotification",
        "summary": "adminTestNotification",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "202": {
            "description": "Queued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationTest"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error"
          },
          "403": {
            "description": "Forbidden"
          }
        }
      }
    },
    "/api/v1/admin/storage/inbound": {
      "get": {
        "operationId": "adminBrowseInbound",
        "summary": "adminBrowseInbound",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "volume",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "path",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Directory entries",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/InboundEntry"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden"
          }
        }
      }
    },
    "/api/v1/auth/capabilities": {
      "get": {
        "operationId": "getAuthCapabilities",
        "summary": "Public authentication capability discovery",
        "description": "Reports which sign-in methods are configured, the WebAuthn relying-party configuration and whether protected credential storage is writable, so a separately deployed Auth UI can avoid offering unavailable methods.",
        "tags": [
          "auth"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Authentication capabilities",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthCapabilities"
                }
              }
            }
          },
          "503": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/bootstrap": {
      "post": {
        "operationId": "completeInstallationBootstrap",
        "summary": "Complete the one-time installation bootstrap",
        "description": "Consumes the console-issued bootstrap challenge exactly once and returns one ordinary session. Returns 409 after the installation is complete.",
        "tags": [
          "auth"
        ],
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BootstrapRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Browser or native session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionResponse"
                }
              }
            },
            "headers": {
              "Set-Cookie": {
                "description": "HttpOnly session cookie and readable CSRF cookie (browser responses only)",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Installation already complete",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/passkeys/step-up/start": {
      "post": {
        "operationId": "startPasskeyStepUp",
        "summary": "Start passkey recent-authentication step-up",
        "description": "Requires an interactive session but not a recent one; the authenticator assertion is the proof. Returns 409 no_passkeys when none is registered.",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Authentication challenge",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PasskeyAuthenticationChallenge"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "No registered passkey",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/passkeys/step-up/finish": {
      "post": {
        "operationId": "finishPasskeyStepUp",
        "summary": "Finish passkey recent-authentication step-up",
        "description": "Verifies the assertion and refreshes the current session's step-up window. The ceremony is one-time.",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasskeyAuthenticationResponse"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Refreshed step-up freshness",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PasskeyStepUpResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Ceremony missing or consumed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Assertion verification failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/accounts": {
      "get": {
        "operationId": "listAdminAccounts",
        "summary": "List accounts",
        "description": "Keyset-paginated account lifecycle metadata. Requires the admin_accounts capability.",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Account page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdminAccountPage"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/accounts/{account_id}": {
      "get": {
        "operationId": "getAdminAccount",
        "summary": "Account lifecycle detail",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdminAccount"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/accounts/{account_id}/status": {
      "put": {
        "operationId": "setAdminAccountStatus",
        "summary": "Enable or disable an account",
        "description": "Disabling an account revokes every session family and immediately rejects its automation credentials. Administrators cannot change their own status.",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountStatusUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdminAccount"
                }
              }
            }
          },
          "400": {
            "description": "Invalid status"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Self status change refused",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/accounts/{account_id}/capabilities/{capability}": {
      "put": {
        "operationId": "grantAdminAccountCapability",
        "summary": "Grant an administrative capability",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "capability",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/AccountCapability"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Granted (idempotent)"
          },
          "400": {
            "description": "Unknown capability"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "revokeAdminAccountCapability",
        "summary": "Revoke an administrative capability",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "capability",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/AccountCapability"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Revoked"
          },
          "400": {
            "description": "Unknown capability"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such grant",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Last account administrator",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/accounts/{account_id}/sessions": {
      "delete": {
        "operationId": "revokeAdminAccountSessions",
        "summary": "Revoke every session family of an account",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "account_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Revocation count",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RevokedSessions"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/google/sign-in/nonce": {
      "post": {
        "operationId": "createGoogleSignInNonce",
        "summary": "Create a one-time native Google sign-in nonce",
        "description": "Native Google sign-in requires an installation-level one-time nonce. The nonce budget is bounded so the public endpoint cannot grow storage without limit.",
        "tags": [
          "auth"
        ],
        "security": [],
        "responses": {
          "200": {
            "description": "Nonce",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GoogleSignInNonce"
                }
              }
            }
          },
          "503": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/google/sign-in/token": {
      "post": {
        "operationId": "exchangeGoogleSignInToken",
        "summary": "Exchange a verified Google ID token for a Melodee session",
        "description": "Verifies signature, issuer, audience, expiry and one-time nonce. The identity must already be linked; an unlinked identity never creates an account.",
        "tags": [
          "auth"
        ],
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GoogleSignInToken"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Browser cookie or native bearer session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionResponse"
                }
              }
            },
            "headers": {
              "Set-Cookie": {
                "description": "HttpOnly session cookie and readable CSRF cookie (browser responses only)",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/genres": {
      "get": {
        "operationId": "listGenres",
        "summary": "Canonical genre registry",
        "description": "Closed, versioned registry: 128-entry ID3 baseline plus the Melodee Christmas extension.",
        "tags": [
          "favorites"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Registry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenreRegistry"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tracks/{track_id}/listener-state": {
      "get": {
        "operationId": "getTrackListenerState",
        "summary": "Per-Track listener facts",
        "tags": [
          "favorites"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "track_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "State",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrackListenerState"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown track",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tracks/{track_id}/rating": {
      "put": {
        "operationId": "setTrackRating",
        "summary": "Set a canonical Track rating",
        "tags": [
          "favorites"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "track_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RatingUpdate"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Rating stored"
          },
          "400": {
            "description": "Rating outside 1-5",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown track",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "clearTrackRating",
        "summary": "Clear a canonical Track rating",
        "tags": [
          "favorites"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "track_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Rating cleared (idempotent)"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown track",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tracks/{track_id}/dislike": {
      "put": {
        "operationId": "setTrackDislike",
        "summary": "Mark a canonical Track as disliked",
        "description": "A dislike is independent of the rating and the favorite flag. It excludes the Track from automatic playback selection only.",
        "tags": [
          "favorites"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "track_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Dislike stored (idempotent)"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown track",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "clearTrackDislike",
        "summary": "Clear a Track dislike",
        "tags": [
          "favorites"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "track_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Dislike cleared (idempotent)"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown track",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/preferences": {
      "get": {
        "operationId": "getListenerPreferences",
        "summary": "Read listener preferences and genre exclusions",
        "tags": [
          "favorites"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Preferences",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListenerPreference"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "setListenerPreferences",
        "summary": "Replace listener preferences and genre exclusions",
        "tags": [
          "favorites"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ListenerPreference"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Stored preferences",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListenerPreference"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown genre",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/playback/autoplay": {
      "get": {
        "operationId": "autoplayCandidates",
        "summary": "Bounded automatic playback candidates",
        "description": "Deterministic seed-ordered selection excluding disliked Tracks, Tracks with an excluded genre and Tracks without a playable preferred asset. Never used by search, detail or explicit playback.",
        "tags": [
          "playback"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "seed",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Candidates",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutoplayPage"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/tracks/{track_id}/genres": {
      "put": {
        "operationId": "setTrackGenres",
        "summary": "Replace a Track's canonical genres",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "track_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrackGenresUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Assigned canonical genres",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Unknown canonical genre",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown track",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/mql/fields": {
      "get": {
        "operationId": "listMqlFields",
        "summary": "Published MQL field registry",
        "description": "Versioned typed field registry for CLI and Admin UI integration. There is no client-side MQL evaluator; clients submit MQL text to the server.",
        "tags": [
          "search"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Registry",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MqlRegistry"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/mql/validate": {
      "post": {
        "operationId": "validateMql",
        "summary": "Validate MQL without executing it",
        "description": "Returns stable machine codes with UTF-8 byte source ranges. Validation never touches the database.",
        "tags": [
          "search"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MqlValidateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Validation result (invalid queries are not an HTTP error)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MqlValidation"
                }
              }
            }
          },
          "400": {
            "description": "Malformed request body"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/mql/execute": {
      "post": {
        "operationId": "executeMql",
        "summary": "Execute MQL against canonical Tracks",
        "description": "Compiles the validated query to parameterized PostgreSQL. The account is injected by the server; preference and history fields only observe the caller's own state. Ordering is deterministic by title key and internal identity, with an opaque keyset cursor.",
        "tags": [
          "search"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MqlExecuteRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Matching Tracks",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MqlExecution"
                }
              }
            }
          },
          "400": {
            "description": "Invalid MQL, cursor or limit; error fields carry byte positions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/playlists": {
      "get": {
        "operationId": "listPlaylists",
        "summary": "List own and public playlists",
        "tags": [
          "favorites"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaylistPage"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createPlaylist",
        "summary": "Create a static, dynamic or concert playlist",
        "tags": [
          "favorites"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlaylistCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Playlist"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/playlists/import": {
      "post": {
        "operationId": "importPlaylist",
        "summary": "Create, append or replace playlist entries idempotently",
        "description": "Idempotency is keyed by account and idempotencyKey; an identical retry returns the original revision with replayed=true, and a different document under the same key is rejected. create/append/replace are explicit modes.",
        "tags": [
          "favorites"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlaylistImport"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Applied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaylistImportResult"
                }
              }
            }
          },
          "200": {
            "description": "Idempotent replay",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaylistImportResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown or inaccessible playlist",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Revision conflict or state conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/playlists/{playlist_id}": {
      "get": {
        "operationId": "getPlaylist",
        "summary": "Playlist detail with entries or dynamic evaluation",
        "tags": [
          "favorites"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "playlist_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Dynamic evaluation page size",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Dynamic evaluation cursor",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Detail",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaylistDetail"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown or inaccessible",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "updatePlaylist",
        "summary": "Update playlist metadata under a revision check",
        "tags": [
          "favorites"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "playlist_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlaylistUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Playlist"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown or inaccessible playlist",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Revision conflict or state conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "retirePlaylist",
        "summary": "Retire a playlist under a revision check",
        "tags": [
          "favorites"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "playlist_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "revision",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Retired"
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown or inaccessible playlist",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Revision conflict or state conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/playlists/{playlist_id}/entries": {
      "post": {
        "operationId": "addPlaylistEntry",
        "summary": "Append or insert one entry occurrence",
        "description": "The same canonical Track may occur multiple times; each occurrence receives its own entry id.",
        "tags": [
          "favorites"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "playlist_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlaylistEntryCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created occurrence",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaylistAddedEntry"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown or inaccessible playlist",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Revision conflict or state conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/playlists/{playlist_id}/entries/{entry_id}": {
      "put": {
        "operationId": "movePlaylistEntry",
        "summary": "Move and optionally relabel one occurrence",
        "tags": [
          "favorites"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "playlist_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "entry_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlaylistEntryMove"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "New revision",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaylistRevision"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown or inaccessible playlist",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Revision conflict or state conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "removePlaylistEntry",
        "summary": "Remove one occurrence and close the position gap",
        "tags": [
          "favorites"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "playlist_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "entry_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "revision",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "New revision",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaylistRevision"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown or inaccessible playlist",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Revision conflict or state conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/playlists/{playlist_id}/order": {
      "put": {
        "operationId": "reorderPlaylist",
        "summary": "Reorder every occurrence by entry id",
        "tags": [
          "favorites"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "playlist_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlaylistReorder"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "New revision",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaylistRevision"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown or inaccessible playlist",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Revision conflict or state conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/playlists/{playlist_id}/export": {
      "get": {
        "operationId": "exportPlaylist",
        "summary": "Export a revision-bound playlist snapshot",
        "description": "The document is a point-in-time snapshot suitable for import; snapshots are not persisted as separate rows.",
        "tags": [
          "favorites"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "playlist_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "revision",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Export",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaylistExport"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown or inaccessible playlist",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Revision conflict or state conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/history": {
      "get": {
        "operationId": "listListeningHistory",
        "summary": "Personal qualified listening history",
        "description": "Newest first with an opaque keyset cursor. Only qualified plays appear; duplicate delivery is one event and a prefetch is never a play. The window defaults to 30 days and is bounded to 366 days.",
        "tags": [
          "playback"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "fromMillis",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "toMillis",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "History page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HistoryPage"
                }
              }
            }
          },
          "400": {
            "description": "Invalid range, limit or cursor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/history/recent": {
      "get": {
        "operationId": "listRecentlyPlayed",
        "summary": "Distinct recently played Tracks",
        "tags": [
          "playback"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Recent Tracks",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecentPage"
                }
              }
            }
          },
          "400": {
            "description": "Invalid limit"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/stats/listening": {
      "get": {
        "operationId": "listeningStatistics",
        "summary": "Listening totals, local-day buckets and charts",
        "description": "Timezone-aware local-day buckets, bounded charts and range. A play counts once per Track, once per credited primary Artist and once per containing Release; multi-artist or multi-release Tracks can therefore contribute to more than one row.",
        "tags": [
          "playback"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "fromMillis",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "toMillis",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "timezone",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 64,
              "default": "UTC"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Statistics",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListeningStats"
                }
              }
            }
          },
          "400": {
            "description": "Invalid range, timezone or limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/user-state/export": {
      "get": {
        "operationId": "exportUserState",
        "summary": "Export portable listener state",
        "description": "Favorites, ratings, dislikes, dated events, historical summaries, playlists and preferences in the melodee-user-state/1 schema with a SHA-256 content digest. The instance identity is an opaque installation hash.",
        "tags": [
          "favorites"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Portable document",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserStateExport"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/user-state/import/preview": {
      "post": {
        "operationId": "previewUserStateImport",
        "summary": "Build a digest-bound user-state import plan",
        "description": "Validates schema/version/bounds and records a decision per item. Conflicts (newer local facts, existing summaries/playlists/preferences) and unresolved legacy references are reported without writing state. An idempotency key replays the same plan; a different document under the same key is rejected.",
        "tags": [
          "favorites"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImportPreviewRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "New plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportPreviewResponse"
                }
              }
            }
          },
          "200": {
            "description": "Idempotent replay",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportPreviewResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid document/schema/key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/user-state/imports": {
      "get": {
        "operationId": "listUserStateImports",
        "summary": "List user-state import plans",
        "tags": [
          "favorites"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Plans",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportPlanList"
                }
              }
            }
          },
          "400": {
            "description": "Invalid limit"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/user-state/imports/{plan_id}": {
      "get": {
        "operationId": "getUserStateImport",
        "summary": "Import plan detail with a bounded item page",
        "tags": [
          "favorites"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "plan_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Opaque cursor from the previous page's nextCursor. Rejected with 400 when malformed or from another shared scope; a rejected cursor does not consume a metadata use.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Plan detail",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportPlanDetail"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown or inaccessible plan"
          }
        }
      }
    },
    "/api/v1/user-state/imports/{plan_id}/apply": {
      "post": {
        "operationId": "applyUserStateImport",
        "summary": "Apply a bounded, resumable batch of an import plan",
        "description": "Requires the current plan revision. Repeating the call with the returned revision resumes; local newer facts are never overwritten silently.",
        "tags": [
          "favorites"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "plan_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImportApplyRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Batch result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportApplyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown plan"
          },
          "409": {
            "description": "Stale plan revision",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/user-state/imports/{plan_id}/apply-job": {
      "post": {
        "operationId": "enqueueUserStateImportJob",
        "summary": "Queue the durable ImportState job for a plan",
        "tags": [
          "favorites"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "plan_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Queued",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueuedImportJob"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown plan"
          },
          "409": {
            "description": "Plan already applied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/user-state/unresolved": {
      "get": {
        "operationId": "listUnresolvedReferences",
        "summary": "List unresolved legacy Track references",
        "tags": [
          "favorites"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "includeResolved",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "References",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnresolvedList"
                }
              }
            }
          },
          "400": {
            "description": "Invalid limit"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/user-state/unresolved/{unresolved_id}/resolve": {
      "post": {
        "operationId": "resolveUnresolvedReference",
        "summary": "Resolve a legacy reference to a canonical Track",
        "tags": [
          "favorites"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "unresolved_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResolveReferenceRequest"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Resolved"
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown reference or Track"
          }
        }
      }
    },
    "/api/v1/shares": {
      "get": {
        "operationId": "listShares",
        "summary": "List the caller's public shares",
        "description": "Inventory only; a recipient token is never returned or stored in cleartext.",
        "tags": [
          "favorites"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Shares",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShareList"
                }
              }
            }
          },
          "400": {
            "description": "Invalid limit"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createShare",
        "summary": "Create an explicit expiring share",
        "description": "Shares exactly one playlist (static/concert only), Release or Track. The token is 256-bit entropy returned once and stored only as a digest.",
        "tags": [
          "favorites"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ShareCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created share with one-time token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShareCreated"
                }
              }
            }
          },
          "400": {
            "description": "Invalid target/expiry/budget",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown target"
          }
        }
      }
    },
    "/api/v1/shares/{share_id}": {
      "delete": {
        "operationId": "revokeShare",
        "summary": "Revoke an owned share immediately",
        "tags": [
          "favorites"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "share_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Revoked"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown or unowned share"
          }
        }
      }
    },
    "/api/v1/public/shares/{token}": {
      "get": {
        "operationId": "getSharedView",
        "summary": "Recipient view of a shared scope",
        "description": "Public, token-authenticated. Exposes only the shared playlist/Release/Track entries; never the owner's Catalog, favorites, ratings, history or preferences. Expired, revoked, exhausted and unknown tokens are indistinguishable (404). Each metadata open consumes the optional use budget and starts or renews a bounded playback-authorization window; the response reports its end as playbackExpiresAtMillis.",
        "tags": [
          "playback"
        ],
        "security": [],
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 64,
              "maxLength": 64
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Shared scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShareRecipientView"
                }
              }
            }
          },
          "400": {
            "description": "Invalid limit"
          },
          "404": {
            "description": "Token is not usable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/public/shares/{token}/tracks/{track_id}/stream": {
      "get": {
        "operationId": "streamSharedTrack",
        "summary": "Range-stream a Track inside a shared scope",
        "description": "Public, token-authenticated. Only Tracks inside the explicitly shared scope are served while a metadata open's bounded playback window is valid; byte ranges, ETag, 206 and 416 behave exactly like authenticated streaming. Ranges do not consume metadata uses; revoking or expiring the share ends authorization immediately.",
        "tags": [
          "playback"
        ],
        "security": [],
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 64,
              "maxLength": 64
            }
          },
          {
            "name": "track_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Range",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Full object"
          },
          "206": {
            "description": "Byte range"
          },
          "409": {
            "description": "Track is not currently playable"
          },
          "416": {
            "description": "Range not satisfiable"
          },
          "404": {
            "description": "Token or Track is not usable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/metrics": {
      "get": {
        "operationId": "getMetrics",
        "summary": "Bounded Prometheus metrics",
        "description": "Process/build/readiness gauges only (melodee_up, melodee_build_info, melodee_db_ready, melodee_storage_writable). Requires an operations.read automation credential or the admin_jobs capability. No catalog, account or listener data is exposed.",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Prometheus text exposition",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/notifications": {
      "get": {
        "operationId": "listInboxNotifications",
        "summary": "List the caller's in-app notifications",
        "description": "Sanitized operational events only. Deduplicated events aggregate into one row with an occurrence count; reading a row and receiving it again clears the read state.",
        "tags": [
          "favorites"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "unreadOnly",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Inbox page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationInbox"
                }
              }
            }
          },
          "400": {
            "description": "Invalid limit"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/notifications/{notification_id}/read": {
      "put": {
        "operationId": "markNotificationRead",
        "summary": "Mark one in-app notification read",
        "tags": [
          "favorites"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "notification_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Marked read"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown or already-read notification"
          }
        }
      }
    },
    "/api/v1/notifications/read-all": {
      "put": {
        "operationId": "markAllNotificationsRead",
        "summary": "Mark every in-app notification read",
        "tags": [
          "favorites"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Updated count",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationMarked"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/notification-subscriptions": {
      "get": {
        "operationId": "getNotificationSubscriptions",
        "summary": "Read notification channel subscriptions",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Subscriptions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationSubscriptionList"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "setNotificationSubscriptions",
        "summary": "Replace notification channel subscriptions",
        "description": "In-app and email deliver per account; telegram uses the single configured operational chat. Email requires a verified contact and a configured SMTP relay, otherwise the delivery row records an explicit failure class.",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NotificationSubscriptionBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Stored subscriptions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationSubscriptionList"
                }
              }
            }
          },
          "400": {
            "description": "Invalid channel/severity/event kind",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/compatibility-credentials": {
      "get": {
        "operationId": "listCompatibilityCredentials",
        "summary": "List per-device compatibility credentials",
        "description": "Interactive sessions only. The secret is never returned after creation.",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "protocol",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "subsonic",
                "jellyfin"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompatibilityCredentialList"
                }
              }
            }
          },
          "400": {
            "description": "Invalid protocol"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createCompatibilityCredential",
        "summary": "Create a revocable compatibility credential",
        "description": "Creates a 256-bit secret for the OpenSubsonic or Jellyfin adapter, returned once and stored only as a SHA-256 digest. Revocation is immediate and account disablement blocks use.",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompatibilityCredentialCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created credential",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompatibilityCredentialCreated"
                }
              }
            }
          },
          "400": {
            "description": "Invalid protocol/label/budget",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/compatibility-credentials/{credential_id}": {
      "delete": {
        "operationId": "revokeCompatibilityCredential",
        "summary": "Revoke a compatibility credential immediately",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "bearerAuth": []
          },
          {
            "cookieAuth": []
          }
        ],
        "parameters": [
          {
            "name": "credential_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Revoked"
          },
          "401": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Authentication/authorization error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown or unowned credential"
          }
        }
      }
    }
  },
  "x-melodee-contract-provenance": {
    "source": "melodee-api",
    "sourceDevelopmentRevision": "f77dba9ea1b85bece26cb72b19088f3f41087371",
    "contractVersion": "1.0.1",
    "contractStatus": "remediation-candidate",
    "releaseBaseline": false,
    "previousArtifactVersion": "1.0.0",
    "previousArtifactSha256": "98abbf13982c2ee9bcfccc3a0848b0002308467edefa169c4c79e952cf462f34",
    "note": "Independent-review remediation of the 1.0.0 baseline. Public-share pagination now uses stable composite string cursors; metadata opens start a bounded playback-authorization window; the stream contract is otherwise unchanged. No other path, operation, authentication, authorization, error or storage contract changed."
  }
}
