{
  "openapi": "3.1.0",
  "info": {
    "title": "Drop public counter",
    "version": "1.0.0",
    "description": "Drop sends files straight between two devices, so there is no API for files. This one route returns how many file shares people have started, as one number. It carries no file names, devices, sessions or ids."
  },
  "servers": [
    {
      "url": "https://functions.openapps.xyz/apps/80ddb8c5df822e290afdd3c7"
    }
  ],
  "paths": {
    "/stats": {
      "get": {
        "operationId": "getStats",
        "summary": "How many file shares people have started",
        "description": "One total, cached for 5 minutes, readable from any website.",
        "responses": {
          "200": {
            "description": "The total. The label is 'file share started' when the value is 1.",
            "headers": {
              "cache-control": {
                "schema": {
                  "type": "string",
                  "example": "public, max-age=300"
                }
              },
              "access-control-allow-origin": {
                "schema": {
                  "type": "string",
                  "example": "*"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "stats"
                  ],
                  "properties": {
                    "stats": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "label",
                          "value"
                        ],
                        "properties": {
                          "label": {
                            "type": "string",
                            "example": "file shares started"
                          },
                          "value": {
                            "type": "integer",
                            "minimum": 0,
                            "example": 123
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "stats": [
                    {
                      "label": "file shares started",
                      "value": 123
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "The count could not be read right now. Try again later.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "stats_unavailable"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
