{
  "openapi": "3.1.0",
  "info": {
    "title": "Diggr",
    "version": "1.0.0",
    "description": "Public endpoints of diggr.es: download the Diggr Mac app and subscribe to email news. No authentication."
  },
  "servers": [
    {
      "url": "https://diggr.es"
    }
  ],
  "paths": {
    "/download": {
      "get": {
        "operationId": "downloadDiggr",
        "summary": "Download the Diggr Mac app (DMG)",
        "description": "Redirects to the latest Diggr.dmg on GitHub Releases. macOS 11 or later, Apple Silicon and Intel. Free.",
        "responses": {
          "307": {
            "description": "Redirect to the DMG file",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string",
                  "format": "uri"
                }
              }
            }
          }
        }
      }
    },
    "/api/waitlist": {
      "post": {
        "operationId": "subscribeToUpdates",
        "summary": "Subscribe an email to Diggr news",
        "description": "Adds the email to the Diggr news list (new versions). Duplicate emails are ignored.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email",
                    "maxLength": 254,
                    "description": "Email address that receives the news"
                  },
                  "source": {
                    "type": "string",
                    "maxLength": 20,
                    "description": "Where the signup came from, e.g. agent"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Subscribed (or already subscribed)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid email"
          },
          "405": {
            "description": "Method not allowed"
          },
          "500": {
            "description": "Could not save the signup"
          }
        }
      }
    }
  }
}
