{
  "openapi": "3.1.0",
  "info": {
    "title": "bugd.one Public API",
    "version": "1.0.0",
    "summary": "Submit bug reports and crashes from your own apps, show reporters the status, reply, upload source maps.",
    "description": "Public API of bugd.one (EU-hosted crash reporting & bug tracking). The bug-report widget (`https://bugd.one/widget.js`), the crash reporter (`https://bugd.one/crash-reporter.js`) and the `/embed` form use exactly these endpoints.\n\n**Keys** (create them in the dashboard under Project → Settings; shown once):\n- Publishable key `bk_live_…` (header `X-API-Key`): may be public; submit reports/crashes, read widget config.\n- Reporter token (header `X-Reporter-Token`): returned once when a report is created; read/reply to exactly that report.\n- Server key `bk_server_…` (`Authorization: Bearer …`): backend/CI only; list/read all reports of the project, reply, upload source maps.\n\nKeys and tokens are accepted **only as headers** (except `?key=` on `GET /v1/config`). JSON endpoints require `Content-Type: application/json` (else 415).\nErrors are JSON `{ \"error\": string, \"code\": string }`. Rate limits (per IP, IPv6 per /64): reports 20/min, crashes 60/min, reporter replies 10/min, status batch 30/min.\n\nQuotas per project and rolling 30 days: Pro (and the free trial) unlimited reports / 10,000 crash events; Team unlimited / 100,000. Source maps and webhooks: Pro/Team only. There is no free plan: if the project owner has no active plan (trial ended, no subscription), new reports and crashes are rejected with `403 project_read_only`.\n\nLegacy aliases kept for older SDKs: `POST /bugs` (= `POST /v1/reports`), `POST /crash` (= `POST /v1/crashes`), `GET /widget-config` (= `GET /v1/config`), `POST /sourcemaps` (= `POST /v1/sourcemaps`).\nFull reference (German): https://bugd.one/api-reference.md · Docs: https://bugd.one/docs",
    "contact": {
      "name": "Mignuti Media",
      "email": "media@mignuti.com",
      "url": "https://bugd.one"
    },
    "termsOfService": "https://bugd.one/agb"
  },
  "externalDocs": {
    "description": "Documentation",
    "url": "https://bugd.one/docs"
  },
  "servers": [
    {
      "url": "https://bugd.one/api",
      "description": "Production (EU data storage)"
    }
  ],
  "tags": [
    {
      "name": "Reports",
      "description": "User bug reports"
    },
    {
      "name": "Crashes",
      "description": "Crash reporting"
    },
    {
      "name": "Config",
      "description": "Widget/app configuration"
    }
  ],
  "paths": {
    "/v1/reports": {
      "post": {
        "tags": [
          "Reports"
        ],
        "operationId": "createReport",
        "summary": "Submit a bug report",
        "description": "Creates a report. Store the returned `reporter_token` together with the `id` — it is only returned here and lets the reporter see the status later. Email/name are only stored with `consent: true` (else 422). Browser requests from foreign origins may need a `cf_turnstile_token` if Turnstile is enabled (see `GET /v1/config`). Body max. 25 MB (JSON) / 20 MB (multipart).",
        "security": [
          {
            "PublishableKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportCreate"
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/ReportCreateMultipart"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportCreated"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (`bad_request`, `title_required`, `invalid_email`)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing `X-API-Key`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`invalid_api_key`, `origin_not_allowed`, `captcha_failed`, `project_read_only` (owner has no active plan)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "`payload_too_large`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "`consent_required` (email/name without consent) or `field_required` (required custom field missing)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Reports"
        ],
        "operationId": "listReports",
        "summary": "List reports of the project (server key)",
        "description": "Newest first. Typical use: your backend shows \"My reports\" for a logged-in user via `external_user_id`.",
        "security": [
          {
            "ServerKey": []
          }
        ],
        "parameters": [
          {
            "name": "external_user_id",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "Your own user id as sent in `user.id`/`external_user_id`"
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/Status"
            }
          },
          {
            "name": "environment",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "production",
                "development"
              ]
            },
            "description": "`production` = only production, `development` = everything else"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "`next_cursor` of the previous page"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "reports",
                    "next_cursor"
                  ],
                  "properties": {
                    "reports": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ReportServerView"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`server_key_required`/`forbidden` or `invalid_api_key`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/reports/{id}": {
      "get": {
        "tags": [
          "Reports"
        ],
        "operationId": "getReport",
        "summary": "Get status and public replies of a report",
        "description": "With `X-Reporter-Token`: the reporter view (status, public team replies). With the server key: additionally description, labels, metadata, external_user_id, source, environment, screenshot_url and all comments (incl. internal ones, with `is_public`).",
        "security": [
          {
            "ReporterToken": []
          },
          {
            "ServerKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Report id (from the create response)"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "report",
                    "messages"
                  ],
                  "properties": {
                    "report": {
                      "oneOf": [
                        {
                          "$ref": "#/components/schemas/ReportReporterView"
                        },
                        {
                          "$ref": "#/components/schemas/ReportServerView"
                        }
                      ]
                    },
                    "messages": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Message"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing `X-Reporter-Token` or server key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`invalid_api_key`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Report not found (or token invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/reports/{id}/messages": {
      "post": {
        "tags": [
          "Reports"
        ],
        "operationId": "replyToReport",
        "summary": "Reply to a report",
        "description": "As reporter (`X-Reporter-Token`) or as your backend (server key; public reply, the reporter is e-mailed if they left an address — the report is then `awaiting_reply`). Optional images (`attachments`, max. 3) and one voice message (`audio`); text may be empty when something is attached. Also accepts multipart/form-data with the same fields. Body max. 32 MB (JSON). Reporter limits: 20 per report and 30 per token per day.",
        "security": [
          {
            "ReporterToken": []
          },
          {
            "ServerKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Report id (from the create response)"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "content": {
                    "type": "string",
                    "maxLength": 5000,
                    "description": "Required unless an image or voice message is attached"
                  },
                  "author": {
                    "type": "string",
                    "maxLength": 100,
                    "description": "Server key only: display name (default `API`)"
                  },
                  "attachments": {
                    "type": "array",
                    "maxItems": 3,
                    "items": {
                      "type": "string",
                      "description": "Image data URI (png/jpeg/gif/webp, max. 5 MB)"
                    }
                  },
                  "audio": {
                    "type": "string",
                    "description": "Voice message data URI `data:audio/(webm|ogg|mp4|aac|mpeg|wav)[;codecs=…];base64,…`, max. 5 MB / 3 min"
                  },
                  "audio_duration_ms": {
                    "type": "integer",
                    "minimum": 0
                  }
                }
              },
              "example": {
                "content": "Pixel 8 with Android 15"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "message"
                  ],
                  "properties": {
                    "message": {
                      "$ref": "#/components/schemas/Message"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`content` missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing token/key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Report not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "`unsupported_media_type`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/reports/status": {
      "post": {
        "tags": [
          "Reports"
        ],
        "operationId": "reportsStatusBatch",
        "summary": "Status of several own reports at once (badge)",
        "description": "No API key needed — the reporter tokens are enough. Max. 50 entries, answered in the same order. `reply_count` counts only public team replies. `gone: true` = report deleted or token invalid (remove locally).",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "reports"
                ],
                "properties": {
                  "reports": {
                    "type": "array",
                    "maxItems": 50,
                    "items": {
                      "type": "object",
                      "required": [
                        "id",
                        "token"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "token": {
                          "type": "string",
                          "minLength": 20,
                          "maxLength": 200
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "reports"
                  ],
                  "properties": {
                    "reports": {
                      "type": "array",
                      "items": {
                        "oneOf": [
                          {
                            "type": "object",
                            "required": [
                              "id",
                              "status",
                              "updated_at",
                              "reply_count",
                              "last_reply_at"
                            ],
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "status": {
                                "$ref": "#/components/schemas/Status"
                              },
                              "updated_at": {
                                "type": "string",
                                "format": "date-time"
                              },
                              "reply_count": {
                                "type": "integer"
                              },
                              "last_reply_at": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "format": "date-time"
                              }
                            }
                          },
                          {
                            "type": "object",
                            "required": [
                              "id",
                              "gone"
                            ],
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "gone": {
                                "const": true
                              }
                            }
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`reports` must be an array",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/config": {
      "get": {
        "tags": [
          "Config"
        ],
        "operationId": "getConfig",
        "summary": "Widget/app configuration (project name, custom fields, Turnstile, limits)",
        "description": "Alias: `GET /widget-config`. The key may also be passed as `?key=` on this endpoint only.",
        "security": [
          {
            "PublishableKey": []
          },
          {
            "PublishableKeyQuery": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetConfig"
                }
              }
            }
          },
          "401": {
            "description": "Missing key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`invalid_api_key` or `origin_not_allowed`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/crashes": {
      "post": {
        "tags": [
          "Crashes"
        ],
        "operationId": "createCrash",
        "summary": "Report a crash",
        "description": "Identical errors are grouped by a fingerprint (across environments). Body max. 200 KB JSON. The \"new crash\" e-mail/webhook (`crash.created`) fires only for the first production occurrence of a group. Alias: `POST /crash`. Server-to-server (PHP/WordPress, backends): authenticate with the server key `Authorization: Bearer bk_server_…` — no `Origin` header / `allowed_origins` check is applied then. Use `platform: \"php\"` with frames like `#0 /path/file.php(123): fn()`.",
        "security": [
          {
            "PublishableKey": []
          },
          {
            "ServerKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrashCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Recorded",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "crash_id",
                    "fingerprint"
                  ],
                  "properties": {
                    "success": {
                      "const": true
                    },
                    "crash_id": {
                      "type": "string"
                    },
                    "fingerprint": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (`message`/`stack`/`platform` missing or invalid)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing `X-API-Key` / server key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`invalid_api_key`, `origin_not_allowed` or `project_read_only` (owner has no active plan)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "`payload_too_large`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "`unsupported_media_type`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited` or monthly crash quota reached (`quota_exceeded`, with `quota` and `plan`)",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "quota": {
                          "type": "integer"
                        },
                        "plan": {
                          "type": "string"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/v1/sourcemaps": {
      "post": {
        "tags": [
          "Crashes"
        ],
        "operationId": "uploadSourcemap",
        "summary": "Upload a source map for a release (Pro/Team, server key)",
        "description": "Existing crashes of that release are re-symbolicated automatically. Limits: 20 MB per file, 500 MB per project (`413 storage_quota_exceeded`). The publishable key is rejected with `403 server_key_required`; without Pro/Team `403 plan_required`. Alias: `POST /sourcemaps`.",
        "security": [
          {
            "ServerKey": []
          }
        ],
        "parameters": [
          {
            "name": "release",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 100
            },
            "description": "Alternative to the `release` form field"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file"
                ],
                "properties": {
                  "release": {
                    "type": "string",
                    "maxLength": 100,
                    "description": "Must match `release` sent with crashes"
                  },
                  "filename": {
                    "type": "string",
                    "maxLength": 200,
                    "description": "Name of the .map file, e.g. `index-abc123.js.map` (default: uploaded file name)"
                  },
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "contentMediaType": "application/json"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Stored",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "storage_path": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing release, filename or file",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing server key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`server_key_required`, `invalid_api_key` or `plan_required`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "`payload_too_large` or `storage_quota_exceeded`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "PublishableKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "Publishable key `bk_live_…` (may be embedded in apps)"
      },
      "PublishableKeyQuery": {
        "type": "apiKey",
        "in": "query",
        "name": "key",
        "description": "Only for `GET /v1/config`"
      },
      "ReporterToken": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Reporter-Token",
        "description": "Per-report token from the create response"
      },
      "ServerKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "bk_server_…",
        "description": "Server key — backend/CI only, never in an app"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error",
          "code"
        ],
        "properties": {
          "error": {
            "type": "string"
          },
          "code": {
            "type": "string",
            "examples": [
              "title_required",
              "rate_limited",
              "quota_exceeded"
            ]
          }
        }
      },
      "Status": {
        "type": "string",
        "enum": [
          "new",
          "confirmed",
          "in_progress",
          "fixed",
          "wont_fix",
          "duplicate"
        ]
      },
      "Priority": {
        "type": "string",
        "enum": [
          "critical",
          "high",
          "medium",
          "low"
        ]
      },
      "Environment": {
        "type": "string",
        "maxLength": 32,
        "default": "production",
        "description": "Environment. Missing = `production`. `production`/`prod`/`live` → production; `dev`/`develop`/`local`/`debug` → `development`; anything else (e.g. `staging`) is kept and treated as non-production. Non-production events show in the dashboard but trigger no e-mails, webhooks or chat messages (they still count toward the quota).",
        "examples": [
          "production",
          "development",
          "staging"
        ]
      },
      "User": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "maxLength": 200,
            "description": "Your own user id (no e-mail here)"
          },
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 254,
            "description": "Reporter gets status e-mails (requires consent)"
          },
          "name": {
            "type": "string",
            "maxLength": 100
          }
        }
      },
      "Metadata": {
        "type": "object",
        "maxProperties": 30,
        "additionalProperties": {
          "type": [
            "string",
            "number",
            "boolean"
          ]
        },
        "description": "Flat object, values max. 500 chars. Also carries custom field values (`fields[].key`)."
      },
      "ReportCreate": {
        "type": "object",
        "required": [
          "title"
        ],
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "description": {
            "type": "string",
            "maxLength": 9500
          },
          "user": {
            "$ref": "#/components/schemas/User"
          },
          "external_user_id": {
            "type": "string",
            "maxLength": 200,
            "description": "Alternative to `user.id`"
          },
          "reporter_email": {
            "type": "string",
            "format": "email",
            "description": "Alternative to `user.email`"
          },
          "reporter_name": {
            "type": "string",
            "maxLength": 100,
            "description": "Alternative to `user.name`"
          },
          "consent": {
            "type": "boolean",
            "description": "Required (`true`) when e-mail or name is sent (GDPR)"
          },
          "app_version": {
            "type": "string",
            "maxLength": 50
          },
          "source": {
            "type": "string",
            "maxLength": 20,
            "description": "e.g. `web`, `android`, `ios` (default `widget`); alias `platform`"
          },
          "platform": {
            "type": "string",
            "maxLength": 20,
            "description": "Alias of `source`"
          },
          "environment": {
            "$ref": "#/components/schemas/Environment"
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "Reduced to origin + path (query/fragment dropped)"
          },
          "user_agent": {
            "type": "string",
            "description": "Default: request header; stored reduced to \"Browser Major / OS\""
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "labels": {
            "type": "array",
            "maxItems": 10,
            "items": {
              "type": "string",
              "maxLength": 50
            }
          },
          "screenshot_url": {
            "type": "string",
            "description": "Data URI `data:image/(png|jpeg|gif|webp);base64,…`, max. 5 MB"
          },
          "attachments": {
            "type": "array",
            "maxItems": 3,
            "items": {
              "type": "string",
              "description": "Image data URI"
            }
          },
          "kind": {
            "$ref": "#/components/schemas/Kind"
          },
          "audio": {
            "type": "string",
            "description": "Voice message data URI `data:audio/(webm|ogg|mp4|aac|mpeg|wav)[;codecs=…];base64,…`, max. 5 MB / 3 min (checked by file signature)"
          },
          "audio_duration_ms": {
            "type": "integer",
            "minimum": 0,
            "description": "Length of the voice message (display only)"
          },
          "console_logs": {
            "type": "string",
            "maxLength": 5000,
            "description": "Appended to the description"
          },
          "cf_turnstile_token": {
            "type": "string",
            "description": "Browser only, if Turnstile is enabled"
          }
        },
        "example": {
          "title": "Login button does nothing",
          "description": "Nothing happens after tapping.",
          "user": {
            "id": "usr_123",
            "email": "anna@example.com",
            "name": "Anna"
          },
          "consent": true,
          "app_version": "2.4.1",
          "source": "android",
          "metadata": {
            "device": "Pixel 8",
            "os": "Android 15"
          },
          "labels": [
            "login"
          ],
          "environment": "production"
        }
      },
      "ReportCreateMultipart": {
        "type": "object",
        "required": [
          "title"
        ],
        "description": "Recommended for native apps (no Base64 overhead). Total max. 20 MB.",
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 500
          },
          "description": {
            "type": "string",
            "maxLength": 9500
          },
          "consent": {
            "type": "string",
            "enum": [
              "true",
              "false",
              "1",
              "0"
            ]
          },
          "user": {
            "type": "string",
            "description": "JSON string, e.g. `{\"id\":\"usr_123\",\"email\":\"anna@example.com\"}`"
          },
          "metadata": {
            "type": "string",
            "description": "JSON string (flat object)"
          },
          "labels": {
            "type": "string",
            "description": "JSON array string"
          },
          "app_version": {
            "type": "string",
            "maxLength": 50
          },
          "source": {
            "type": "string",
            "maxLength": 20
          },
          "environment": {
            "type": "string",
            "maxLength": 32
          },
          "external_user_id": {
            "type": "string",
            "maxLength": 200
          },
          "reporter_email": {
            "type": "string"
          },
          "reporter_name": {
            "type": "string",
            "maxLength": 100
          },
          "url": {
            "type": "string"
          },
          "screenshot": {
            "type": "string",
            "format": "binary",
            "description": "image/png|jpeg|gif|webp, max. 5 MB"
          },
          "attachments": {
            "type": "array",
            "maxItems": 3,
            "items": {
              "type": "string",
              "format": "binary"
            },
            "description": "Images, mp4/webm/mov, PDF, txt, json — max. 10 MB each"
          }
        }
      },
      "ReportCreated": {
        "type": "object",
        "required": [
          "success",
          "id",
          "bug_number",
          "status",
          "reporter_token",
          "status_url"
        ],
        "properties": {
          "success": {
            "const": true
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "bug_number": {
            "type": "integer"
          },
          "kind": {
            "$ref": "#/components/schemas/Kind"
          },
          "status": {
            "const": "new"
          },
          "reporter_token": {
            "type": "string",
            "description": "Store it — only returned here"
          },
          "status_url": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "ReportReporterView": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "bug_number": {
            "type": "integer"
          },
          "kind": {
            "$ref": "#/components/schemas/Kind"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/Status"
          },
          "awaiting_reply": {
            "type": "boolean",
            "description": "true = the team replied and waits for the reporter"
          },
          "priority": {
            "$ref": "#/components/schemas/Priority"
          },
          "app_version": {
            "type": [
              "string",
              "null"
            ]
          },
          "fixed_in_version": {
            "type": [
              "string",
              "null"
            ]
          },
          "resolution_note": {
            "type": [
              "string",
              "null"
            ],
            "description": "Only for fixed/wont_fix/duplicate"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ReportServerView": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ReportReporterView"
          },
          {
            "type": "object",
            "properties": {
              "description": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "labels": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "external_user_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "source": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "environment": {
                "type": "string"
              },
              "metadata": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": {
                  "type": "string"
                }
              },
              "screenshot_url": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          }
        ]
      },
      "Message": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "from_reporter": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "author": {
            "type": "string",
            "description": "Server view only"
          },
          "is_public": {
            "type": "boolean",
            "description": "Server view only (false = internal team note)"
          },
          "is_system": {
            "type": "boolean",
            "description": "Server view only"
          },
          "attachments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MessageAttachment"
            }
          }
        }
      },
      "MessageAttachment": {
        "type": "object",
        "description": "Image (`image/*`) or voice message (`audio/*`); served with byte-range support",
        "properties": {
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "content_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "file_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "size_bytes": {
            "type": [
              "integer",
              "null"
            ]
          },
          "duration_ms": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Voice messages only"
          }
        }
      },
      "Kind": {
        "type": "string",
        "enum": [
          "bug",
          "support",
          "feedback"
        ],
        "default": "bug",
        "description": "bug = bug report, support = support request, feedback = feedback/suggestion"
      },
      "WidgetConfig": {
        "type": "object",
        "properties": {
          "project": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "color": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "kinds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Kind"
            },
            "description": "Kinds offered by the widget (project setting); first = default"
          },
          "fields": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "text",
                    "select",
                    "checkbox",
                    "date"
                  ]
                },
                "options": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "required": {
                  "type": "boolean"
                }
              }
            }
          },
          "turnstile": {
            "type": "object",
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "siteKey": {
                "type": "string"
              }
            }
          },
          "limits": {
            "type": "object",
            "properties": {
              "max_image_bytes": {
                "type": "integer",
                "examples": [
                  5242880
                ]
              },
              "max_attachments": {
                "type": "integer",
                "examples": [
                  3
                ]
              },
              "max_title": {
                "type": "integer",
                "examples": [
                  500
                ]
              },
              "max_description": {
                "type": "integer",
                "examples": [
                  9500
                ]
              },
              "max_audio_bytes": {
                "type": "integer",
                "examples": [
                  5242880
                ]
              },
              "max_audio_seconds": {
                "type": "integer",
                "examples": [
                  180
                ]
              }
            }
          }
        }
      },
      "CrashCreate": {
        "type": "object",
        "required": [
          "message",
          "stack",
          "platform"
        ],
        "properties": {
          "message": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          },
          "stack": {
            "type": "string",
            "minLength": 1,
            "maxLength": 50000
          },
          "platform": {
            "type": "string",
            "enum": [
              "browser",
              "ios",
              "android",
              "rn",
              "flutter",
              "capacitor",
              "php",
              "node",
              "python",
              "desktop",
              "unknown"
            ]
          },
          "type": {
            "type": "string",
            "maxLength": 100,
            "description": "e.g. `TypeError`, `NullPointerException`"
          },
          "release": {
            "type": "string",
            "maxLength": 100,
            "description": "Release/app version — matched with uploaded source maps"
          },
          "url": {
            "type": "string",
            "description": "Page URL (reduced to origin + path) or screen name"
          },
          "user_agent": {
            "type": "string"
          },
          "user_id": {
            "type": "string",
            "maxLength": 500,
            "description": "Pseudonymised server-side (HMAC); count of affected users"
          },
          "context": {
            "type": "object",
            "description": "Free-form object (sensitive keys like email/password/token are removed)"
          },
          "environment": {
            "$ref": "#/components/schemas/Environment"
          }
        },
        "example": {
          "message": "NullPointerException: user was null",
          "stack": "at com.example.CheckoutActivity.onCreate(CheckoutActivity.kt:42)",
          "platform": "android",
          "type": "NullPointerException",
          "release": "1.4.2",
          "url": "CheckoutScreen",
          "context": {
            "screen": "checkout"
          },
          "environment": "production"
        }
      }
    }
  }
}