{
  "openapi": "3.1.0",
  "info": {
    "title": "IntuneBrew Public Catalog API",
    "version": "1.0.0",
    "description": "Read-only public catalog. No authentication or tenant access. Responses can be cached for five minutes; inspect sync status before automation."
  },
  "servers": [
    {
      "url": "https://www.intunebrew.com"
    }
  ],
  "paths": {
    "/api/v1/apps": {
      "get": {
        "operationId": "listApps",
        "summary": "List supported applications",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Use nextCursor from the preceding response with the same q."
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 120
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schemaVersion": {
                      "type": "string",
                      "const": "1"
                    },
                    "lastUpdated": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "sync": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "healthy",
                            "degraded",
                            "stale",
                            "unknown"
                          ]
                        },
                        "lastFullSyncAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "failedAppCount": {
                          "type": "integer"
                        }
                      }
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/App"
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer"
                        },
                        "limit": {
                          "type": "integer"
                        },
                        "nextCursor": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Retry after the Retry-After header delay."
          }
        }
      }
    },
    "/api/v1/apps/{id}": {
      "get": {
        "operationId": "getApp",
        "summary": "Get a supported application",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schemaVersion": {
                      "type": "string",
                      "const": "1"
                    },
                    "lastUpdated": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "sync": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "healthy",
                            "degraded",
                            "stale",
                            "unknown"
                          ]
                        },
                        "lastFullSyncAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "failedAppCount": {
                          "type": "integer"
                        }
                      }
                    },
                    "data": {
                      "$ref": "#/components/schemas/App"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Retry after the Retry-After header delay."
          }
        }
      }
    },
    "/api/v1/updates": {
      "get": {
        "operationId": "listLatestUpdates",
        "summary": "Get the most recently published version changes",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "schemaVersion": {
                      "type": "string",
                      "const": "1"
                    },
                    "lastChecked": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "appName": {
                            "type": "string"
                          },
                          "previousVersion": {
                            "type": "string"
                          },
                          "newVersion": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Error response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Retry after the Retry-After header delay."
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "App": {
        "type": "object",
        "required": [
          "id",
          "name",
          "version",
          "downloadUrl",
          "sha256"
        ],
        "properties": {
          "version": {
            "type": [
              "string",
              "null"
            ]
          },
          "bundleId": {
            "type": [
              "string",
              "null"
            ]
          },
          "fileName": {
            "type": [
              "string",
              "null"
            ]
          },
          "downloadUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "sha256": {
            "type": [
              "string",
              "null"
            ]
          },
          "homepage": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "publisher": {
            "type": [
              "string",
              "null"
            ]
          },
          "category": {
            "type": [
              "string",
              "null"
            ]
          },
          "iconUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      }
    }
  }
}
