{
  "openapi": "3.1.0",
  "info": {
    "title": "BugOtter API",
    "version": "1",
    "description": "Read-only API for your apps' uptime, errors, traffic, revenue and deploys. Create a key at https://bugotter.com/app/api (Settings → API & webhooks), or connect over OAuth (Sign in with BugOtter) from your own app. Keep keys on a server. Leave out app on apps, stats, uptime, deploys, errors and revenue for every app at once. Up to 120 requests a minute per key. Money is minor units per currency; shares are 0–1; times are ISO 8601 UTC. Field names in v1 only grow. Docs: https://bugotter.com/docs/api (Markdown: https://bugotter.com/docs/api.md).",
    "contact": {
      "name": "BugOtter",
      "url": "https://bugotter.com",
      "email": "hello@bugotter.com"
    }
  },
  "externalDocs": {
    "description": "API docs",
    "url": "https://bugotter.com/docs/api"
  },
  "servers": [
    {
      "url": "https://bugotter.com/api/v1"
    }
  ],
  "security": [
    {
      "bearer": []
    },
    {
      "oauth": [
        "bugotter:read"
      ]
    }
  ],
  "paths": {
    "/apps": {
      "get": {
        "operationId": "apps",
        "summary": "Every app with its health",
        "description": "Every app the key can see: status now, 30-day uptime, response time, open issues, SSL and domain expiry, and MRR when revenue is connected. Docs: https://bugotter.com/docs/api#apps",
        "parameters": [
          {
            "in": "query",
            "name": "group",
            "required": false,
            "description": "Only the apps in this group: its slug or name, from /groups. Used when app is left out. Unknown groups answer 404 with the groups the key can use.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "format",
            "required": false,
            "description": "json (default) or csv: a table with a header row, ready for a spreadsheet.",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK. With format=csv: One row per app; money columns per currency (mrr_usd…).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "results": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/App"
                      }
                    },
                    "revenue_connected": {
                      "type": "boolean"
                    },
                    "amounts": {
                      "type": "string"
                    }
                  }
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "A parameter is missing or unknown.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No key, a mistyped key or a revoked one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No app the key can see matches app.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Over 120 requests a minute for this key. Retry-After says how many seconds to wait.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/groups": {
      "get": {
        "operationId": "groups",
        "summary": "Groups of apps",
        "description": "The account's groups (optional; for example Making money, Side bets, or one per client), in the owner's order. Pass a group's slug as group to /apps, /errors, /uptime, /deploys and /stats. A key limited to some apps or groups sees only groups with an app it may see. An account without groups gets an empty list. Docs: https://bugotter.com/docs/api#groups",
        "parameters": [
          {
            "in": "query",
            "name": "format",
            "required": false,
            "description": "json (default) or csv: a table with a header row, ready for a spreadsheet.",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK. With format=csv: One row per group: group, name, color, alerts, apps (slugs, space separated).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "group": {
                            "type": "string",
                            "description": "The slug."
                          },
                          "name": {
                            "type": "string"
                          },
                          "color": {
                            "type": "string"
                          },
                          "alerts": {
                            "type": "string",
                            "enum": [
                              "all",
                              "problems",
                              "outages"
                            ]
                          },
                          "alerts_label": {
                            "type": "string"
                          },
                          "apps": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "ungrouped": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "description": "Slugs of apps in no group."
                      }
                    }
                  }
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "A parameter is missing or unknown.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No key, a mistyped key or a revoked one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No app the key can see matches app.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Over 120 requests a minute for this key. Retry-After says how many seconds to wait.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/uptime": {
      "get": {
        "operationId": "uptime",
        "summary": "Uptime, incidents and response times",
        "description": "Uptime and downtime over the last 1–90 days, uptime per day, incidents (down and slow), response times by region, extra checks and cron heartbeats. Docs: https://bugotter.com/docs/api#uptime",
        "parameters": [
          {
            "in": "query",
            "name": "app",
            "required": false,
            "description": "One app (slug, domain, URL or id), several as a,b,c, or leave out for every app the key can see (up to 50; use offset for more). With more than one, the answer lists one row per app.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "group",
            "required": false,
            "description": "Only the apps in this group: its slug or name, from /groups. Used when app is left out. Unknown groups answer 404 with the groups the key can use.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "description": "Skip this many apps (every-app answers list 50 at most).",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          },
          {
            "in": "query",
            "name": "days",
            "required": false,
            "description": "Window in days, 1–90.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 90,
              "default": 30
            }
          },
          {
            "in": "query",
            "name": "format",
            "required": false,
            "description": "json (default) or csv: a table with a header row, ready for a spreadsheet.",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK. With format=csv: Uptime per day: day, uptime, checks, failed_checks. Several apps: one row per app.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "app": {
                      "type": "string"
                    },
                    "period": {
                      "type": "object",
                      "properties": {
                        "from": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "to": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "days": {
                          "type": "integer"
                        }
                      }
                    },
                    "status": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status_label": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "sleeping": {
                      "type": "boolean"
                    },
                    "last_checked_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "uptime": {
                      "type": [
                        "number",
                        "null"
                      ],
                      "description": "Main URL uptime in the window. Between 0 and 1."
                    },
                    "checks": {
                      "type": "integer"
                    },
                    "failed_checks": {
                      "type": "integer"
                    },
                    "downtime_minutes": {
                      "type": "integer",
                      "description": "Merged outage time of every check."
                    },
                    "incidents": {
                      "type": "integer"
                    },
                    "slow_periods": {
                      "type": "integer"
                    },
                    "response": {
                      "type": "object",
                      "properties": {
                        "window_days": {
                          "type": "integer"
                        },
                        "median_ms": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "p95_ms": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "slowest_region": {
                          "type": [
                            "object",
                            "null"
                          ]
                        },
                        "fastest_region": {
                          "type": [
                            "object",
                            "null"
                          ]
                        }
                      }
                    },
                    "ssl_expires_in_days": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "domain_expires_in_days": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "daily": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "day": {
                            "type": "string",
                            "format": "date"
                          },
                          "uptime": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "That day's uptime. Between 0 and 1."
                          },
                          "checks": {
                            "type": "integer"
                          },
                          "failed_checks": {
                            "type": "integer"
                          }
                        }
                      }
                    },
                    "incident_list": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "down",
                              "slow"
                            ]
                          },
                          "check_id": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "title": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "ongoing": {
                            "type": "boolean"
                          },
                          "started_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "resolved_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time"
                          },
                          "minutes": {
                            "type": "integer"
                          },
                          "minutes_in_window": {
                            "type": "integer"
                          }
                        }
                      }
                    },
                    "extra_checks": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          },
                          "name": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          },
                          "method": {
                            "type": "string"
                          },
                          "enabled": {
                            "type": "boolean"
                          },
                          "last": {
                            "type": [
                              "object",
                              "null"
                            ]
                          }
                        }
                      }
                    },
                    "heartbeats": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          },
                          "name": {
                            "type": "string"
                          },
                          "state": {
                            "type": "string",
                            "enum": [
                              "on_time",
                              "late",
                              "failed",
                              "stuck",
                              "waiting_for_first_ping"
                            ]
                          },
                          "last_ping_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time"
                          },
                          "last_run": {
                            "type": [
                              "object",
                              "null"
                            ]
                          }
                        }
                      }
                    }
                  }
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "A parameter is missing or unknown.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No key, a mistyped key or a revoked one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No app the key can see matches app.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Over 120 requests a minute for this key. Retry-After says how many seconds to wait.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/revenue": {
      "get": {
        "operationId": "revenue",
        "summary": "MRR, revenue and movements",
        "description": "The Revenue page's numbers: MRR now and at the start, revenue, refunds, failed payments, subscribers, MRR movements and a series. A key limited to some apps must pass app. Docs: https://bugotter.com/docs/api#revenue",
        "parameters": [
          {
            "in": "query",
            "name": "range",
            "required": false,
            "description": "7d, 30d (default), 90d or 12m. The series is per day, week (90d) or month (12m).",
            "schema": {
              "type": "string",
              "enum": [
                "7d",
                "30d",
                "90d",
                "12m"
              ],
              "default": "30d"
            }
          },
          {
            "in": "query",
            "name": "app",
            "required": false,
            "description": "The app: its slug, domain, URL or id. Leave out for every app the key can see.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "format",
            "required": false,
            "description": "json (default) or csv: a table with a header row, ready for a spreadsheet.",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK. With format=csv: The series: period, end, currency, revenue, mrr, mrr_estimated.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "app": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "period": {
                      "type": "object",
                      "properties": {
                        "from": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "to": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "range": {
                          "type": "string"
                        },
                        "label": {
                          "type": "string"
                        },
                        "bucket": {
                          "type": "string",
                          "enum": [
                            "hour",
                            "day",
                            "week",
                            "month"
                          ]
                        }
                      }
                    },
                    "connected": {
                      "type": "boolean",
                      "description": "False until a payment provider is connected; the other fields are then missing."
                    },
                    "currencies": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "mrr": {
                      "$ref": "#/components/schemas/Money"
                    },
                    "mrr_start": {
                      "$ref": "#/components/schemas/Money"
                    },
                    "arr": {
                      "$ref": "#/components/schemas/Money"
                    },
                    "subscribers": {
                      "type": "integer"
                    },
                    "subscribers_start": {
                      "type": "integer"
                    },
                    "revenue": {
                      "$ref": "#/components/schemas/Money"
                    },
                    "refunds": {
                      "$ref": "#/components/schemas/Money"
                    },
                    "payments": {
                      "type": "integer"
                    },
                    "failed_payments": {
                      "type": "integer"
                    },
                    "past_due": {
                      "type": "object",
                      "properties": {
                        "mrr": {
                          "$ref": "#/components/schemas/Money"
                        },
                        "subscribers": {
                          "type": "integer"
                        }
                      }
                    },
                    "mrr_movements": {
                      "type": "object",
                      "description": "Gains positive, losses (contraction, churn) negative; added and lost are both positive.",
                      "properties": {
                        "new": {
                          "$ref": "#/components/schemas/Money"
                        },
                        "reactivation": {
                          "$ref": "#/components/schemas/Money"
                        },
                        "expansion": {
                          "$ref": "#/components/schemas/Money"
                        },
                        "contraction": {
                          "$ref": "#/components/schemas/Money"
                        },
                        "churn": {
                          "$ref": "#/components/schemas/Money"
                        },
                        "added": {
                          "$ref": "#/components/schemas/Money"
                        },
                        "lost": {
                          "$ref": "#/components/schemas/Money"
                        },
                        "new_subscribers": {
                          "type": "integer"
                        },
                        "lost_subscribers": {
                          "type": "integer"
                        }
                      }
                    },
                    "previous": {
                      "type": "object",
                      "description": "The same totals for the period before."
                    },
                    "tracked_since": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date"
                    },
                    "ratios": {
                      "type": "object",
                      "properties": {
                        "currency": {
                          "type": "string"
                        },
                        "mrr_churn": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "subscriber_churn": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "net_revenue_retention": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "arpu": {
                          "type": "integer"
                        },
                        "lifetime_value": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "note": {
                          "type": "string"
                        }
                      }
                    },
                    "failed_payment_recovery": {
                      "type": "object",
                      "properties": {
                        "failed": {
                          "type": "integer"
                        },
                        "failed_amount": {
                          "$ref": "#/components/schemas/Money"
                        },
                        "paid_later": {
                          "type": "integer"
                        },
                        "paid_later_amount": {
                          "$ref": "#/components/schemas/Money"
                        }
                      }
                    },
                    "forecast_30d": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "currency": {
                          "type": "string"
                        },
                        "mrr": {
                          "type": "integer"
                        },
                        "by": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "scheduled_cancellations": {
                          "type": "integer"
                        },
                        "basis_days": {
                          "type": "integer"
                        }
                      }
                    },
                    "timeseries": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "period": {
                            "type": "string",
                            "format": "date"
                          },
                          "end": {
                            "type": "string",
                            "format": "date"
                          },
                          "revenue": {
                            "$ref": "#/components/schemas/Money"
                          },
                          "mrr": {
                            "anyOf": [
                              {
                                "$ref": "#/components/schemas/Money"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "mrr_estimated": {
                            "type": "boolean",
                            "description": "Before BugOtter first saw the subscriptions: rebuilt from payments."
                          }
                        }
                      }
                    }
                  }
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "A parameter is missing or unknown.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No key, a mistyped key or a revoked one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No app the key can see matches app.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Over 120 requests a minute for this key. Retry-After says how many seconds to wait.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/revenue/customers": {
      "get": {
        "operationId": "revenueCustomers",
        "summary": "Customers, one by one",
        "description": "The Customers tab's list, anonymous (never a name or email): status and why, MRR, lifetime paid, months, first-visit source, scheduled cancellation or trial end, and the provider's customer id. A key limited to some apps must pass app. Docs: https://bugotter.com/docs/api#customers",
        "parameters": [
          {
            "in": "query",
            "name": "app",
            "required": false,
            "description": "The app: its slug, domain, URL or id. Leave out for every app the key can see.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "description": "Which customers. paying includes one-time buyers; cancelled includes those cancelling at period end.",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "paying",
                "trial",
                "at_risk",
                "cancelled"
              ],
              "default": "all"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "description": "1–200.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "description": "For the next page: next_offset from the last answer.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          },
          {
            "in": "query",
            "name": "format",
            "required": false,
            "description": "json (default) or csv: a table with a header row, ready for a spreadsheet.",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK. With format=csv: One row per customer and currency.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "app": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "connected": {
                      "type": "boolean"
                    },
                    "status": {
                      "type": "string"
                    },
                    "counts": {
                      "type": "object",
                      "properties": {
                        "paying": {
                          "type": "integer"
                        },
                        "trial": {
                          "type": "integer"
                        },
                        "at_risk": {
                          "type": "integer"
                        },
                        "cancelled": {
                          "type": "integer"
                        }
                      }
                    },
                    "total": {
                      "type": "integer"
                    },
                    "offset": {
                      "type": "integer"
                    },
                    "next_offset": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "paying",
                              "one_time",
                              "trial",
                              "at_risk",
                              "cancelling",
                              "cancelled"
                            ]
                          },
                          "risk": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "app": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "products": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "mrr": {
                            "$ref": "#/components/schemas/Money"
                          },
                          "lifetime": {
                            "$ref": "#/components/schemas/Money"
                          },
                          "months": {
                            "type": "integer"
                          },
                          "came_from": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "first_paid_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time"
                          },
                          "last_paid_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time"
                          },
                          "cancel_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time"
                          },
                          "trial_ends_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time"
                          },
                          "provider": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "provider_customer_id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        }
                      }
                    }
                  }
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "A parameter is missing or unknown.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No key, a mistyped key or a revoked one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No app the key can see matches app.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Over 120 requests a minute for this key. Retry-After says how many seconds to wait.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/errors": {
      "get": {
        "operationId": "errors",
        "summary": "Code errors",
        "description": "Errors grouped by cause, most recently seen first. Open covers 30 days, resolved and ignored 90, up to 150 groups. Docs: https://bugotter.com/docs/api#errors-list",
        "parameters": [
          {
            "in": "query",
            "name": "app",
            "required": false,
            "description": "The app: its slug, domain, URL or id. Leave out for every app the key can see.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "group",
            "required": false,
            "description": "Only the apps in this group: its slug or name, from /groups. Used when app is left out. Unknown groups answer 404 with the groups the key can use.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "description": "Which errors.",
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "snoozed",
                "resolved",
                "ignored"
              ],
              "default": "open"
            }
          },
          {
            "in": "query",
            "name": "environment",
            "required": false,
            "description": "Only this environment.",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "production",
                "preview",
                "development"
              ],
              "default": "all"
            }
          },
          {
            "in": "query",
            "name": "release",
            "required": false,
            "description": "Only errors seen in this release (git sha or version).",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "q",
            "required": false,
            "description": "Text in the type, message or culprit.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "description": "1–150.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 150,
              "default": 50
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "description": "For the next page: next_offset from the last answer.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          },
          {
            "in": "query",
            "name": "format",
            "required": false,
            "description": "json (default) or csv: a table with a header row, ready for a spreadsheet.",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK. With format=csv: One row per error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "app": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "type": "string"
                    },
                    "environment": {
                      "type": "string"
                    },
                    "window_days": {
                      "type": "integer"
                    },
                    "counts": {
                      "type": "object",
                      "properties": {
                        "open": {
                          "type": "integer"
                        },
                        "snoozed": {
                          "type": "integer"
                        },
                        "resolved": {
                          "type": "integer"
                        },
                        "ignored": {
                          "type": "integer"
                        }
                      }
                    },
                    "total": {
                      "type": "integer"
                    },
                    "offset": {
                      "type": "integer"
                    },
                    "next_offset": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ErrorGroup"
                      }
                    }
                  }
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "A parameter is missing or unknown.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No key, a mistyped key or a revoked one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No app the key can see matches app.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Over 120 requests a minute for this key. Retry-After says how many seconds to wait.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deploys": {
      "get": {
        "operationId": "deploys",
        "summary": "Production deploys",
        "description": "Production deploys, newest first, from Vercel, Netlify, GitHub or the deploy hook. Docs: https://bugotter.com/docs/api#deploys",
        "parameters": [
          {
            "in": "query",
            "name": "app",
            "required": false,
            "description": "One app (slug, domain, URL or id), several as a,b,c, or leave out for every app the key can see (up to 50; use offset for more). With more than one, the answer lists one row per app.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "group",
            "required": false,
            "description": "Only the apps in this group: its slug or name, from /groups. Used when app is left out. Unknown groups answer 404 with the groups the key can use.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "description": "Skip this many apps (every-app answers list 50 at most).",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "description": "1–100.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "in": "query",
            "name": "since",
            "required": false,
            "description": "Only deploys after this time (ISO 8601), for polling.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "in": "query",
            "name": "format",
            "required": false,
            "description": "json (default) or csv: a table with a header row, ready for a spreadsheet.",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK. With format=csv: One row per deploy (with an app column when several apps).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "app": {
                      "type": "string",
                      "description": "With one app."
                    },
                    "apps": {
                      "type": "integer",
                      "description": "With several: how many apps."
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "app": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "version": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "message": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "source": {
                            "type": "string"
                          },
                          "url": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        }
                      }
                    }
                  }
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "A parameter is missing or unknown.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No key, a mistyped key or a revoked one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No app the key can see matches app.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Over 120 requests a minute for this key. Retry-After says how many seconds to wait.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/stats": {
      "get": {
        "operationId": "stats",
        "summary": "Traffic totals",
        "description": "Visitors, visits, pageviews, bounce rate and visit time for the range, next to the previous period of the same length, plus revenue. Docs: https://bugotter.com/docs/api#stats",
        "parameters": [
          {
            "in": "query",
            "name": "app",
            "required": false,
            "description": "One app (slug, domain, URL or id), several as a,b,c, or leave out for every app the key can see (up to 50; use offset for more). With more than one, the answer lists one row per app.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "group",
            "required": false,
            "description": "Only the apps in this group: its slug or name, from /groups. Used when app is left out. Unknown groups answer 404 with the groups the key can use.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "description": "Skip this many apps (every-app answers list 50 at most).",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          },
          {
            "in": "query",
            "name": "range",
            "required": false,
            "description": "today, 24h, 7d (default), 30d, 90d, 6m, 12m, 2y, or custom with from and to.",
            "schema": {
              "type": "string",
              "enum": [
                "today",
                "24h",
                "7d",
                "30d",
                "90d",
                "6m",
                "12m",
                "2y",
                "custom"
              ],
              "default": "7d"
            }
          },
          {
            "in": "query",
            "name": "from",
            "required": false,
            "description": "First day for range=custom (YYYY-MM-DD).",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "to",
            "required": false,
            "description": "Last day for range=custom (YYYY-MM-DD).",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "tz",
            "required": false,
            "description": "IANA timezone, like America/New_York. Defaults to the account's.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "channel",
            "required": false,
            "description": "Only visits where channel matches, as a breakdown shows it. Filters cover the last 90 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "source",
            "required": false,
            "description": "Only visits where source matches, as a breakdown shows it. Filters cover the last 90 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "campaign",
            "required": false,
            "description": "Only visits where campaign matches, as a breakdown shows it. Filters cover the last 90 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "description": "Only visits where page matches, as a breakdown shows it. Filters cover the last 90 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "entry",
            "required": false,
            "description": "Only visits where entry matches, as a breakdown shows it. Filters cover the last 90 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "exit",
            "required": false,
            "description": "Only visits where exit matches, as a breakdown shows it. Filters cover the last 90 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "country",
            "required": false,
            "description": "Only visits where country matches, as a breakdown shows it. Filters cover the last 90 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "region",
            "required": false,
            "description": "Only visits where region matches, as a breakdown shows it. Filters cover the last 90 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "city",
            "required": false,
            "description": "Only visits where city matches, as a breakdown shows it. Filters cover the last 90 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "device",
            "required": false,
            "description": "Only visits where device matches, as a breakdown shows it. Filters cover the last 90 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "browser",
            "required": false,
            "description": "Only visits where browser matches, as a breakdown shows it. Filters cover the last 90 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "os",
            "required": false,
            "description": "Only visits where os matches, as a breakdown shows it. Filters cover the last 90 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lang",
            "required": false,
            "description": "Only visits where lang matches, as a breakdown shows it. Filters cover the last 90 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "goal",
            "required": false,
            "description": "Only visits where goal matches, as a breakdown shows it. Filters cover the last 90 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "format",
            "required": false,
            "description": "json (default) or csv: a table with a header row, ready for a spreadsheet.",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK. With format=csv: Two rows: this period and the one before. Several apps: one row per app.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "app": {
                      "type": "string"
                    },
                    "period": {
                      "type": "object",
                      "properties": {
                        "from": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "to": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "range": {
                          "type": "string"
                        },
                        "label": {
                          "type": "string"
                        },
                        "bucket": {
                          "type": "string",
                          "enum": [
                            "hour",
                            "day",
                            "week",
                            "month"
                          ]
                        }
                      }
                    },
                    "filters": {
                      "type": "object"
                    },
                    "results": {
                      "type": "object",
                      "properties": {
                        "visitors": {
                          "type": "integer"
                        },
                        "visits": {
                          "type": "integer"
                        },
                        "pageviews": {
                          "type": "integer"
                        },
                        "bounce_rate": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Share of one-page visits. Between 0 and 1."
                        },
                        "visit_duration_seconds": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "views_per_visit": {
                          "type": [
                            "number",
                            "null"
                          ]
                        }
                      }
                    },
                    "previous": {
                      "type": "object",
                      "properties": {
                        "period": {
                          "type": "object",
                          "properties": {
                            "from": {
                              "type": "string",
                              "format": "date-time"
                            },
                            "to": {
                              "type": "string",
                              "format": "date-time"
                            },
                            "range": {
                              "type": "string"
                            },
                            "label": {
                              "type": "string"
                            },
                            "bucket": {
                              "type": "string",
                              "enum": [
                                "hour",
                                "day",
                                "week",
                                "month"
                              ]
                            }
                          }
                        },
                        "results": {
                          "type": "object"
                        }
                      }
                    },
                    "revenue": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "amounts": {
                          "$ref": "#/components/schemas/Money"
                        },
                        "refunded": {
                          "$ref": "#/components/schemas/Money"
                        },
                        "customers": {
                          "type": "integer"
                        },
                        "payments": {
                          "type": "integer"
                        },
                        "attributed_only": {
                          "type": "boolean"
                        }
                      }
                    },
                    "totals": {
                      "type": "object",
                      "description": "Several apps only.",
                      "properties": {
                        "visitors_summed": {
                          "type": "integer",
                          "description": "Several apps: visitor counts added up (one person on two apps counts twice)."
                        },
                        "visits": {
                          "type": "integer"
                        },
                        "pageviews": {
                          "type": "integer"
                        },
                        "revenue": {
                          "$ref": "#/components/schemas/Money",
                          "type": [
                            null,
                            "null"
                          ]
                        }
                      }
                    }
                  }
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "A parameter is missing or unknown.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No key, a mistyped key or a revoked one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No app the key can see matches app.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Over 120 requests a minute for this key. Retry-After says how many seconds to wait.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/stats/timeseries": {
      "get": {
        "operationId": "statsTimeseries",
        "summary": "Traffic over time",
        "description": "Visitors and pageviews per hour (24 hours and shorter), day, or month (over 6 months), in the account's timezone. Quiet periods are zero. Docs: https://bugotter.com/docs/api#timeseries",
        "parameters": [
          {
            "in": "query",
            "name": "app",
            "required": true,
            "description": "The app: its slug, domain, URL or id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "range",
            "required": false,
            "description": "today, 24h, 7d (default), 30d, 90d, 6m, 12m, 2y, or custom with from and to.",
            "schema": {
              "type": "string",
              "enum": [
                "today",
                "24h",
                "7d",
                "30d",
                "90d",
                "6m",
                "12m",
                "2y",
                "custom"
              ],
              "default": "7d"
            }
          },
          {
            "in": "query",
            "name": "from",
            "required": false,
            "description": "First day for range=custom (YYYY-MM-DD).",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "to",
            "required": false,
            "description": "Last day for range=custom (YYYY-MM-DD).",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "tz",
            "required": false,
            "description": "IANA timezone, like America/New_York. Defaults to the account's.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "channel",
            "required": false,
            "description": "Only visits where channel matches, as a breakdown shows it. Filters cover the last 90 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "source",
            "required": false,
            "description": "Only visits where source matches, as a breakdown shows it. Filters cover the last 90 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "campaign",
            "required": false,
            "description": "Only visits where campaign matches, as a breakdown shows it. Filters cover the last 90 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "description": "Only visits where page matches, as a breakdown shows it. Filters cover the last 90 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "entry",
            "required": false,
            "description": "Only visits where entry matches, as a breakdown shows it. Filters cover the last 90 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "exit",
            "required": false,
            "description": "Only visits where exit matches, as a breakdown shows it. Filters cover the last 90 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "country",
            "required": false,
            "description": "Only visits where country matches, as a breakdown shows it. Filters cover the last 90 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "region",
            "required": false,
            "description": "Only visits where region matches, as a breakdown shows it. Filters cover the last 90 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "city",
            "required": false,
            "description": "Only visits where city matches, as a breakdown shows it. Filters cover the last 90 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "device",
            "required": false,
            "description": "Only visits where device matches, as a breakdown shows it. Filters cover the last 90 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "browser",
            "required": false,
            "description": "Only visits where browser matches, as a breakdown shows it. Filters cover the last 90 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "os",
            "required": false,
            "description": "Only visits where os matches, as a breakdown shows it. Filters cover the last 90 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lang",
            "required": false,
            "description": "Only visits where lang matches, as a breakdown shows it. Filters cover the last 90 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "goal",
            "required": false,
            "description": "Only visits where goal matches, as a breakdown shows it. Filters cover the last 90 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "format",
            "required": false,
            "description": "json (default) or csv: a table with a header row, ready for a spreadsheet.",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK. With format=csv: One row per period.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "app": {
                      "type": "string"
                    },
                    "period": {
                      "type": "object",
                      "properties": {
                        "from": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "to": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "range": {
                          "type": "string"
                        },
                        "label": {
                          "type": "string"
                        },
                        "bucket": {
                          "type": "string",
                          "enum": [
                            "hour",
                            "day",
                            "week",
                            "month"
                          ]
                        }
                      }
                    },
                    "timezone": {
                      "type": "string"
                    },
                    "filters": {
                      "type": "object"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "period": {
                            "type": "string"
                          },
                          "visitors": {
                            "type": "integer"
                          },
                          "pageviews": {
                            "type": "integer"
                          }
                        }
                      }
                    }
                  }
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "A parameter is missing or unknown.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No key, a mistyped key or a revoked one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No app the key can see matches app.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Over 120 requests a minute for this key. Retry-After says how many seconds to wait.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/stats/breakdown": {
      "get": {
        "operationId": "statsBreakdown",
        "summary": "Top lists",
        "description": "The top rows of one report with visitors and their share. The key of each row is named after by (page, source…), and the count is pageviews (page), events (goal, outbound) or visits. Docs: https://bugotter.com/docs/api#breakdown",
        "parameters": [
          {
            "in": "query",
            "name": "app",
            "required": true,
            "description": "The app: its slug, domain, URL or id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "by",
            "required": false,
            "description": "Which report.",
            "schema": {
              "type": "string",
              "enum": [
                "page",
                "entry",
                "exit",
                "source",
                "channel",
                "campaign",
                "country",
                "region",
                "city",
                "device",
                "browser",
                "os",
                "language",
                "goal",
                "outbound"
              ],
              "default": "page"
            }
          },
          {
            "in": "query",
            "name": "measures",
            "required": false,
            "description": "Add per-row measures: goals (visitors who reached a goal, and conversion_rate), revenue (first-touch revenue and customers; not for page, exit, goal or outbound: use entry for pages). Comma-separated.",
            "schema": {
              "type": "string",
              "examples": [
                "goals,revenue"
              ]
            }
          },
          {
            "in": "query",
            "name": "conversion_goal",
            "required": false,
            "description": "With measures=goals: count one goal by name (Signup). Default: any goal. (goal= is the filter: only visits that reached it.)",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "description": "1–1000.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 20
            }
          },
          {
            "in": "query",
            "name": "range",
            "required": false,
            "description": "today, 24h, 7d (default), 30d, 90d, 6m, 12m, 2y, or custom with from and to.",
            "schema": {
              "type": "string",
              "enum": [
                "today",
                "24h",
                "7d",
                "30d",
                "90d",
                "6m",
                "12m",
                "2y",
                "custom"
              ],
              "default": "7d"
            }
          },
          {
            "in": "query",
            "name": "from",
            "required": false,
            "description": "First day for range=custom (YYYY-MM-DD).",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "to",
            "required": false,
            "description": "Last day for range=custom (YYYY-MM-DD).",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "tz",
            "required": false,
            "description": "IANA timezone, like America/New_York. Defaults to the account's.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "channel",
            "required": false,
            "description": "Only visits where channel matches, as a breakdown shows it. Filters cover the last 90 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "source",
            "required": false,
            "description": "Only visits where source matches, as a breakdown shows it. Filters cover the last 90 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "campaign",
            "required": false,
            "description": "Only visits where campaign matches, as a breakdown shows it. Filters cover the last 90 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "description": "Only visits where page matches, as a breakdown shows it. Filters cover the last 90 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "entry",
            "required": false,
            "description": "Only visits where entry matches, as a breakdown shows it. Filters cover the last 90 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "exit",
            "required": false,
            "description": "Only visits where exit matches, as a breakdown shows it. Filters cover the last 90 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "country",
            "required": false,
            "description": "Only visits where country matches, as a breakdown shows it. Filters cover the last 90 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "region",
            "required": false,
            "description": "Only visits where region matches, as a breakdown shows it. Filters cover the last 90 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "city",
            "required": false,
            "description": "Only visits where city matches, as a breakdown shows it. Filters cover the last 90 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "device",
            "required": false,
            "description": "Only visits where device matches, as a breakdown shows it. Filters cover the last 90 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "browser",
            "required": false,
            "description": "Only visits where browser matches, as a breakdown shows it. Filters cover the last 90 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "os",
            "required": false,
            "description": "Only visits where os matches, as a breakdown shows it. Filters cover the last 90 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lang",
            "required": false,
            "description": "Only visits where lang matches, as a breakdown shows it. Filters cover the last 90 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "goal",
            "required": false,
            "description": "Only visits where goal matches, as a breakdown shows it. Filters cover the last 90 days.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "format",
            "required": false,
            "description": "json (default) or csv: a table with a header row, ready for a spreadsheet.",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK. With format=csv: One row per item.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "app": {
                      "type": "string"
                    },
                    "by": {
                      "type": "string"
                    },
                    "period": {
                      "type": "object",
                      "properties": {
                        "from": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "to": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "range": {
                          "type": "string"
                        },
                        "label": {
                          "type": "string"
                        },
                        "bucket": {
                          "type": "string",
                          "enum": [
                            "hour",
                            "day",
                            "week",
                            "month"
                          ]
                        }
                      }
                    },
                    "filters": {
                      "type": "object"
                    },
                    "measures": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "goal": {
                      "type": "string"
                    },
                    "revenue_connected": {
                      "type": "boolean"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true,
                        "properties": {
                          "visitors": {
                            "type": "integer"
                          },
                          "share": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Share of all visitors. Between 0 and 1."
                          },
                          "goals": {
                            "type": "integer"
                          },
                          "conversion_rate": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "goals / visitors. Between 0 and 1."
                          },
                          "revenue": {
                            "$ref": "#/components/schemas/Money",
                            "type": [
                              null,
                              "null"
                            ]
                          },
                          "customers": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          }
                        }
                      }
                    }
                  }
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "A parameter is missing or unknown.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No key, a mistyped key or a revoked one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No app the key can see matches app.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Over 120 requests a minute for this key. Retry-After says how many seconds to wait.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/pages": {
      "get": {
        "operationId": "pages",
        "summary": "Everything about each page",
        "description": "One row per page (the top pages by visitors, or the ones in path): visitors and views, visits that started there, visitors who reached a goal and the conversion rate, first-touch revenue and customers, real-visitor speed at the 75th percentile with sample counts and Google's ratings, 404 hits, visitors sent by AI assistants and which crawlers read it. Raw events: the last 90 days. Docs: https://bugotter.com/docs/api#pages",
        "parameters": [
          {
            "in": "query",
            "name": "app",
            "required": true,
            "description": "The app: its slug, domain, URL or id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "path",
            "required": false,
            "description": "One page or several (comma-separated): /pricing, or a full URL. Leave out for the top pages.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "conversion_goal",
            "required": false,
            "description": "Count one goal by name (Signup). Default: any goal.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "description": "1–200.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "in": "query",
            "name": "range",
            "required": false,
            "description": "today, 24h, 7d, 30d (default), 90d, or custom with from and to. Page details go back 90 days.",
            "schema": {
              "type": "string",
              "default": "30d"
            }
          },
          {
            "in": "query",
            "name": "from",
            "required": false,
            "description": "First day for range=custom (YYYY-MM-DD).",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "to",
            "required": false,
            "description": "Last day for range=custom (YYYY-MM-DD).",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "tz",
            "required": false,
            "description": "IANA timezone. Defaults to the account's.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "format",
            "required": false,
            "description": "json (default) or csv: a table with a header row, ready for a spreadsheet.",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK. With format=csv: One row per page.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "app": {
                      "type": "string"
                    },
                    "period": {
                      "type": "object",
                      "properties": {
                        "from": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "to": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "range": {
                          "type": "string"
                        },
                        "label": {
                          "type": "string"
                        },
                        "bucket": {
                          "type": "string",
                          "enum": [
                            "hour",
                            "day",
                            "week",
                            "month"
                          ]
                        }
                      }
                    },
                    "goal": {
                      "type": "string"
                    },
                    "revenue_connected": {
                      "type": "boolean"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Page"
                      }
                    }
                  }
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "A parameter is missing or unknown.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No key, a mistyped key or a revoked one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No app the key can see matches app.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Over 120 requests a minute for this key. Retry-After says how many seconds to wait.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/ai": {
      "get": {
        "operationId": "ai",
        "summary": "AI assistants and their crawlers",
        "description": "Per AI assistant (ChatGPT, Claude, Perplexity, Gemini…): how much its crawlers read, how many visitors it sent, how many reached a goal, and where they landed. Every AI crawler with its pages, crawlers mostly turned away (401, 403, 429), and /llms.txt requests. Crawler reads need the crawler report (Analytics → Bots). Docs: https://bugotter.com/docs/api#ai",
        "parameters": [
          {
            "in": "query",
            "name": "app",
            "required": true,
            "description": "The app: its slug, domain, URL or id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "range",
            "required": false,
            "description": "today, 24h, 7d, 30d (default), 90d, or custom with from and to. Page details go back 90 days.",
            "schema": {
              "type": "string",
              "default": "30d"
            }
          },
          {
            "in": "query",
            "name": "from",
            "required": false,
            "description": "First day for range=custom (YYYY-MM-DD).",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "to",
            "required": false,
            "description": "Last day for range=custom (YYYY-MM-DD).",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "tz",
            "required": false,
            "description": "IANA timezone. Defaults to the account's.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "format",
            "required": false,
            "description": "json (default) or csv: a table with a header row, ready for a spreadsheet.",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK. With format=csv: One row per assistant.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "app": {
                      "type": "string"
                    },
                    "period": {
                      "type": "object",
                      "properties": {
                        "from": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "to": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "range": {
                          "type": "string"
                        },
                        "label": {
                          "type": "string"
                        },
                        "bucket": {
                          "type": "string",
                          "enum": [
                            "hour",
                            "day",
                            "week",
                            "month"
                          ]
                        }
                      }
                    },
                    "crawler_report_set_up": {
                      "type": "boolean"
                    },
                    "status_codes_known": {
                      "type": "boolean"
                    },
                    "totals": {
                      "type": "object",
                      "properties": {
                        "visitors": {
                          "type": "integer"
                        },
                        "goals": {
                          "type": "integer"
                        },
                        "crawler_reads": {
                          "type": "integer"
                        }
                      }
                    },
                    "assistants": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "assistant": {
                            "type": "string"
                          },
                          "owner": {
                            "type": "string"
                          },
                          "crawler_reads": {
                            "type": "integer"
                          },
                          "visitors": {
                            "type": "integer"
                          },
                          "goals": {
                            "type": "integer"
                          },
                          "conversion_rate": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "goals / visitors. Between 0 and 1."
                          },
                          "landing_pages": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "path": {
                                  "type": "string"
                                },
                                "visitors": {
                                  "type": "integer"
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "crawlers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "crawler": {
                            "type": "string"
                          },
                          "owner": {
                            "type": "string"
                          },
                          "what": {
                            "type": "string"
                          },
                          "reads": {
                            "type": "integer"
                          },
                          "pages": {
                            "type": "integer"
                          },
                          "last_read": {
                            "type": "string",
                            "format": "date"
                          },
                          "top_pages": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "path": {
                                  "type": "string"
                                },
                                "reads": {
                                  "type": "integer"
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "blocked": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "crawler": {
                            "type": "string"
                          },
                          "status": {
                            "type": "integer"
                          },
                          "refused": {
                            "type": "integer"
                          },
                          "of": {
                            "type": "integer"
                          }
                        }
                      }
                    },
                    "llms_txt": {
                      "type": "object",
                      "properties": {
                        "requests": {
                          "type": "integer"
                        },
                        "not_found": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "A parameter is missing or unknown.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No key, a mistyped key or a revoked one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No app the key can see matches app.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Over 120 requests a minute for this key. Retry-After says how many seconds to wait.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/crawls": {
      "get": {
        "operationId": "crawls",
        "summary": "Crawler reads by page and status",
        "description": "Reads per crawler, page and HTTP status, most first, with the first and last day read. status is null when the site's server can't report it. Docs: https://bugotter.com/docs/api#crawls",
        "parameters": [
          {
            "in": "query",
            "name": "app",
            "required": true,
            "description": "The app: its slug, domain, URL or id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "crawler",
            "required": false,
            "description": "One crawler by name: GPTBot, ClaudeBot, Googlebot…",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "group",
            "required": false,
            "description": "ai, search, seo or social.",
            "schema": {
              "type": "string",
              "enum": [
                "ai",
                "search",
                "seo",
                "social"
              ]
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "description": "A code (403), a class (4xx, 5xx), error (400 and up) or unknown.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "path",
            "required": false,
            "description": "One page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "description": "1–1000.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 100
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "description": "For the next page.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          },
          {
            "in": "query",
            "name": "range",
            "required": false,
            "description": "today, 24h, 7d, 30d (default), 90d, or custom with from and to. Page details go back 90 days.",
            "schema": {
              "type": "string",
              "default": "30d"
            }
          },
          {
            "in": "query",
            "name": "from",
            "required": false,
            "description": "First day for range=custom (YYYY-MM-DD).",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "to",
            "required": false,
            "description": "Last day for range=custom (YYYY-MM-DD).",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "tz",
            "required": false,
            "description": "IANA timezone. Defaults to the account's.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "format",
            "required": false,
            "description": "json (default) or csv: a table with a header row, ready for a spreadsheet.",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK. With format=csv: One row per crawler, page and status.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "app": {
                      "type": "string"
                    },
                    "period": {
                      "type": "object",
                      "properties": {
                        "from": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "to": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "range": {
                          "type": "string"
                        },
                        "label": {
                          "type": "string"
                        },
                        "bucket": {
                          "type": "string",
                          "enum": [
                            "hour",
                            "day",
                            "week",
                            "month"
                          ]
                        }
                      }
                    },
                    "total": {
                      "type": "integer"
                    },
                    "next_offset": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "crawler": {
                            "type": "string"
                          },
                          "owner": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "group": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "path": {
                            "type": "string"
                          },
                          "status": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "reads": {
                            "type": "integer"
                          },
                          "first_read": {
                            "type": "string",
                            "format": "date"
                          },
                          "last_read": {
                            "type": "string",
                            "format": "date"
                          }
                        }
                      }
                    }
                  }
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "A parameter is missing or unknown.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No key, a mistyped key or a revoked one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No app the key can see matches app.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Over 120 requests a minute for this key. Retry-After says how many seconds to wait.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/not-found": {
      "get": {
        "operationId": "notFound",
        "summary": "Pages that 404 for real visitors",
        "description": "Pages that answered \"not found\" to real visitors, most visitors first: hits, first and last seen, the most common referrer, and crawler 404s on the same page. Docs: https://bugotter.com/docs/api#not-found",
        "parameters": [
          {
            "in": "query",
            "name": "app",
            "required": true,
            "description": "The app: its slug, domain, URL or id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "description": "1–500.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 50
            }
          },
          {
            "in": "query",
            "name": "range",
            "required": false,
            "description": "today, 24h, 7d, 30d (default), 90d, or custom with from and to. Page details go back 90 days.",
            "schema": {
              "type": "string",
              "default": "30d"
            }
          },
          {
            "in": "query",
            "name": "from",
            "required": false,
            "description": "First day for range=custom (YYYY-MM-DD).",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "to",
            "required": false,
            "description": "Last day for range=custom (YYYY-MM-DD).",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "tz",
            "required": false,
            "description": "IANA timezone. Defaults to the account's.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "format",
            "required": false,
            "description": "json (default) or csv: a table with a header row, ready for a spreadsheet.",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK. With format=csv: One row per page.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "app": {
                      "type": "string"
                    },
                    "period": {
                      "type": "object",
                      "properties": {
                        "from": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "to": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "range": {
                          "type": "string"
                        },
                        "label": {
                          "type": "string"
                        },
                        "bucket": {
                          "type": "string",
                          "enum": [
                            "hour",
                            "day",
                            "week",
                            "month"
                          ]
                        }
                      }
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "path": {
                            "type": "string"
                          },
                          "visitors": {
                            "type": "integer"
                          },
                          "hits": {
                            "type": "integer"
                          },
                          "first_seen": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time"
                          },
                          "last_seen": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time"
                          },
                          "top_referrer": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "crawler_hits": {
                            "type": "integer"
                          }
                        }
                      }
                    }
                  }
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "A parameter is missing or unknown.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No key, a mistyped key or a revoked one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No app the key can see matches app.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Over 120 requests a minute for this key. Retry-After says how many seconds to wait.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "An API key (bo_…) from Settings → API & webhooks, or an OAuth access token with bugotter:read."
      },
      "oauth": {
        "type": "oauth2",
        "description": "For apps that connect for their users (Sign in with BugOtter). Authorization code with PKCE; the client id may be the https URL of a client metadata document, so no registration is needed. Add offline_access for a refresh token.",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://bugotter.com/api/auth/oauth2/authorize",
            "tokenUrl": "https://bugotter.com/api/auth/oauth2/token",
            "refreshUrl": "https://bugotter.com/api/auth/oauth2/token",
            "scopes": {
              "bugotter:read": "Read apps, uptime, errors, traffic, revenue and deploys",
              "offline_access": "A refresh token, to keep reading without signing in again"
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "What went wrong, in plain words."
          },
          "hint": {
            "type": "string",
            "description": "What to do about it, when there's something to do."
          }
        }
      },
      "Money": {
        "type": "object",
        "description": "Minor units (cents) per lowercase currency code, like { \"usd\": 124000 } for $1,240.00. Currencies are never added together.",
        "additionalProperties": {
          "type": "integer"
        }
      },
      "App": {
        "type": "object",
        "properties": {
          "app": {
            "type": "string",
            "description": "Slug, to pass as app to other endpoints."
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "extra_domains": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "Another domain whose visits count for this app, like a checkout or cart hosted elsewhere. Empty for most apps."
            }
          },
          "group": {
            "type": [
              "string",
              "null"
            ],
            "description": "The slug of the group the app is in; null without one."
          },
          "status": {
            "type": "string",
            "description": "Health now.",
            "enum": [
              "ok",
              "attention",
              "down",
              "nodata",
              "sleeping"
            ]
          },
          "status_label": {
            "type": "string"
          },
          "sleeping": {
            "type": "boolean"
          },
          "uptime_30d": {
            "type": [
              "number",
              "null"
            ],
            "description": "Uptime of the main URL over 30 days, maintenance left out. Between 0 and 1."
          },
          "response_ms": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Latest successful response time."
          },
          "last_checked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "open_issues": {
            "type": "integer"
          },
          "open_errors": {
            "type": "integer"
          },
          "open_issues_by_kind": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "ssl_expires_in_days": {
            "type": [
              "integer",
              "null"
            ]
          },
          "domain_expires_in_days": {
            "type": [
              "integer",
              "null"
            ]
          },
          "mrr": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Money"
              },
              {
                "type": "null"
              }
            ],
            "description": "Null until a payment provider is connected."
          },
          "revenue_30d": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Money"
              },
              {
                "type": "null"
              }
            ]
          },
          "subscribers": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      },
      "Page": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string"
          },
          "visitors": {
            "type": "integer"
          },
          "pageviews": {
            "type": "integer"
          },
          "entries": {
            "type": "object",
            "description": "Visits that started on this page.",
            "properties": {
              "visits": {
                "type": "integer"
              },
              "visitors": {
                "type": "integer"
              }
            }
          },
          "goals": {
            "type": "integer",
            "description": "Visitors on this page whose visit reached the goal."
          },
          "conversion_rate": {
            "type": [
              "number",
              "null"
            ],
            "description": "goals / visitors. Between 0 and 1."
          },
          "revenue": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Money"
              },
              {
                "type": "null"
              }
            ],
            "description": "First touch: from buyers whose first visit started on this page. Null until revenue is connected."
          },
          "customers": {
            "type": [
              "integer",
              "null"
            ]
          },
          "speed": {
            "type": [
              "object",
              "null"
            ],
            "description": "Real-visitor Core Web Vitals at the 75th percentile; ratings are good, needs_improvement or poor.",
            "properties": {
              "samples": {
                "type": "integer",
                "description": "Page views that reported speed."
              },
              "enough_data": {
                "type": "boolean",
                "description": "20 samples or more."
              },
              "lcp_p75_ms": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "lcp_rating": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "inp_p75_ms": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "inp_rating": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "cls_p75": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "cls_rating": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "not_found": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "visitors": {
                "type": "integer"
              },
              "hits": {
                "type": "integer"
              },
              "last_seen": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              }
            }
          },
          "ai_visitors": {
            "type": "integer"
          },
          "ai_assistants": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "assistant": {
                  "type": "string"
                },
                "visitors": {
                  "type": "integer"
                }
              }
            }
          },
          "crawlers": {
            "type": "object",
            "properties": {
              "last_search_read": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date"
              },
              "last_ai_read": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date"
              },
              "reads": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "crawler": {
                      "type": "string"
                    },
                    "owner": {
                      "type": "string"
                    },
                    "group": {
                      "type": "string"
                    },
                    "reads": {
                      "type": "integer"
                    },
                    "last_read": {
                      "type": "string"
                    },
                    "last_status": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      },
      "ErrorGroup": {
        "type": "object",
        "properties": {
          "id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Issue id; open it at url."
          },
          "app": {
            "type": [
              "string",
              "null"
            ]
          },
          "type": {
            "type": [
              "string",
              "null"
            ]
          },
          "message": {
            "type": [
              "string",
              "null"
            ],
            "description": "Emails, keys and tokens already replaced by [redacted]."
          },
          "culprit": {
            "type": [
              "string",
              "null"
            ]
          },
          "level": {
            "type": [
              "string",
              "null"
            ]
          },
          "severity": {
            "type": "string"
          },
          "platform": {
            "type": [
              "string",
              "null"
            ]
          },
          "events": {
            "type": "integer"
          },
          "users": {
            "type": "integer"
          },
          "first_seen_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_seen_at": {
            "type": "string",
            "format": "date-time"
          },
          "first_release": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_release": {
            "type": [
              "string",
              "null"
            ]
          },
          "regressed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "rising_since": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "snoozed_until": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "url": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      }
    }
  }
}