{
  "openapi": "3.1.0",
  "info": {
    "title": "Trashures API v1",
    "description": "Photo or item + postal code -> the correct bin, for licensed territories. Authorization: `Bearer` with an API key or a token. Keys are given on request with a contract; limits, territory and the notices a client has to show are set out in the rules for customers (https://developers.trashures.app/regeln).",
    "termsOfService": "https://developers.trashures.app/regeln",
    "contact": {
      "name": "Trashures",
      "url": "https://developers.trashures.app/",
      "email": "contact@trashures.app"
    },
    "version": "0.14.0-dev+3942413"
  },
  "servers": [
    {
      "url": "https://api.trashures.app",
      "description": "Production"
    }
  ],
  "paths": {
    "/v1/token": {
      "post": {
        "tags": [
          "v1"
        ],
        "summary": "Token for an app",
        "description": "Trade the API key for a short-lived token for the customer's app. Only the key itself may do this, never\na token. The token has the territory, limits and expiry of the key and at most its scopes.",
        "operationId": "v1_token",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/TokenRequest"
                  },
                  {
                    "type": "null"
                  }
                ],
                "title": "Request"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenResponse"
                }
              }
            }
          },
          "401": {
            "description": "api_key_required, api_key_invalid, api_key_expired, api_key_revoked, token_invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "scope_missing, region_not_licensed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited, key_quota_exhausted; with Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "api_key": []
          }
        ]
      }
    },
    "/v1/region": {
      "get": {
        "tags": [
          "v1"
        ],
        "summary": "Region of a postal code",
        "description": "Region for a postal code, within the territory of the key.",
        "operationId": "v1_region",
        "security": [
          {
            "api_key": []
          }
        ],
        "parameters": [
          {
            "name": "postal_code",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{5}$",
              "title": "Postal Code"
            }
          },
          {
            "name": "language",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "de",
                "en"
              ],
              "type": "string",
              "default": "de",
              "title": "Language"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1RegionOut"
                }
              }
            }
          },
          "401": {
            "description": "api_key_required, api_key_invalid, api_key_expired, api_key_revoked, token_invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "scope_missing, region_not_licensed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited, key_quota_exhausted; with Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/items": {
      "get": {
        "tags": [
          "v1"
        ],
        "summary": "Search items",
        "description": "Ranked search over names and synonyms of the items in both languages, tolerant of typos. The items are\nthe same everywhere; the bin of an item for a place comes from /v1/resolve.",
        "operationId": "v1_items",
        "security": [
          {
            "api_key": []
          }
        ],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 2,
              "title": "Q"
            }
          },
          {
            "name": "language",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "de",
                "en"
              ],
              "type": "string",
              "default": "de",
              "title": "Language"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 50,
              "minimum": 1,
              "default": 10,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ItemHitOut"
                  },
                  "title": "Response V1 Items"
                }
              }
            }
          },
          "401": {
            "description": "api_key_required, api_key_invalid, api_key_expired, api_key_revoked, token_invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "scope_missing, region_not_licensed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited, key_quota_exhausted; with Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/resolve": {
      "get": {
        "tags": [
          "v1"
        ],
        "summary": "Bin of an item",
        "description": "Item + postal code -> bin, also the answer to the question of a scan (same parameters as /api/resolve).",
        "operationId": "v1_resolve",
        "security": [
          {
            "api_key": []
          }
        ],
        "parameters": [
          {
            "name": "item_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Item Id"
            }
          },
          {
            "name": "postal_code",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{5}$",
              "title": "Postal Code"
            }
          },
          {
            "name": "language",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "de",
                "en"
              ],
              "type": "string",
              "default": "de",
              "title": "Language"
            }
          },
          {
            "name": "has_bins",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                {
                  "type": "null"
                }
              ],
              "title": "Has Bins"
            }
          },
          {
            "name": "compost",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "enum": [
                      "garten",
                      "thermo",
                      "wurmkiste",
                      "bokashi"
                    ],
                    "type": "string"
                  }
                },
                {
                  "type": "null"
                }
              ],
              "description": "Compost forms of the household, like `profile.compost` of a scan: with them `result.compost` says whether the item belongs on the compost. Leave it out for no compost or not answered (an empty list cannot be sent as a query)",
              "title": "Compost"
            },
            "description": "Compost forms of the household, like `profile.compost` of a scan: with them `result.compost` says whether the item belongs on the compost. Leave it out for no compost or not answered (an empty list cannot be sent as a query)"
          },
          {
            "name": "bin_colors",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 4
                },
                {
                  "type": "null"
                }
              ],
              "description": "Own colour of household bins, like `profile.bin_colors` of a scan, one `<code>:<colour>` per value, e.g. `papier:blau`. Codes restmuell, bio, papier, verpackung; colours grau, schwarz, braun, blau, gelb, grün, weiß, rot, orange, lila. The result and `answer` then show the bin in that colour and without the colour word in its name; 422 invalid_bin_colors otherwise",
              "title": "Bin Colors"
            },
            "description": "Own colour of household bins, like `profile.bin_colors` of a scan, one `<code>:<colour>` per value, e.g. `papier:blau`. Codes restmuell, bio, papier, verpackung; colours grau, schwarz, braun, blau, gelb, grün, weiß, rot, orange, lila. The result and `answer` then show the bin in that colour and without the colour word in its name; 422 invalid_bin_colors otherwise"
          },
          {
            "name": "answer_family",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 100
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only when this call answers the yes/no question of a scan",
              "title": "Answer Family"
            },
            "description": "Only when this call answers the yes/no question of a scan"
          },
          {
            "name": "answer",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "yes",
                    "no"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Answer"
            }
          },
          {
            "name": "answer_first",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false,
              "title": "Answer First"
            }
          },
          {
            "name": "part_item_ids",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 10
                },
                {
                  "type": "null"
                }
              ],
              "description": "Separable parts of the scan this call belongs to (`answer.question.options[].resolve`): `answer` then keeps their rows",
              "title": "Part Item Ids"
            },
            "description": "Separable parts of the scan this call belongs to (`answer.question.options[].resolve`): `answer` then keeps their rows"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ResolveResponse"
                }
              }
            }
          },
          "401": {
            "description": "api_key_required, api_key_invalid, api_key_expired, api_key_revoked, token_invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "scope_missing, region_not_licensed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited, key_quota_exhausted; with Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/items/popular": {
      "get": {
        "tags": [
          "v1"
        ],
        "summary": "Popular items",
        "description": "Start tiles: the most searched items of the region, then the curated start list. Only the order.",
        "operationId": "v1_popular",
        "security": [
          {
            "api_key": []
          }
        ],
        "parameters": [
          {
            "name": "postal_code",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{5}$",
              "title": "Postal Code"
            }
          },
          {
            "name": "language",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "de",
                "en"
              ],
              "type": "string",
              "default": "de",
              "title": "Language"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 24,
              "minimum": 1,
              "default": 12,
              "title": "Limit"
            }
          },
          {
            "name": "has_bins",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                {
                  "type": "null"
                }
              ],
              "title": "Has Bins"
            }
          },
          {
            "name": "bin_colors",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 4
                },
                {
                  "type": "null"
                }
              ],
              "description": "Own colour of household bins, like `profile.bin_colors` of a scan, one `<code>:<colour>` per value, e.g. `papier:blau`. Codes restmuell, bio, papier, verpackung; colours grau, schwarz, braun, blau, gelb, grün, weiß, rot, orange, lila. The result and `answer` then show the bin in that colour and without the colour word in its name; 422 invalid_bin_colors otherwise",
              "title": "Bin Colors"
            },
            "description": "Own colour of household bins, like `profile.bin_colors` of a scan, one `<code>:<colour>` per value, e.g. `papier:blau`. Codes restmuell, bio, papier, verpackung; colours grau, schwarz, braun, blau, gelb, grün, weiß, rot, orange, lila. The result and `answer` then show the bin in that colour and without the colour word in its name; 422 invalid_bin_colors otherwise"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1PopularResponse"
                }
              }
            }
          },
          "401": {
            "description": "api_key_required, api_key_invalid, api_key_expired, api_key_revoked, token_invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "scope_missing, region_not_licensed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited, key_quota_exhausted; with Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/news": {
      "get": {
        "tags": [
          "v1"
        ],
        "summary": "Local news",
        "description": "Approved news of one district (\"Vor Ort\"). Outside the territory of the key: 403, or an empty list for a\nkey with `outside: baseline` (news belong to the örE, there is no baseline).",
        "operationId": "v1_news",
        "security": [
          {
            "api_key": []
          }
        ],
        "parameters": [
          {
            "name": "district_key",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{5}$",
              "description": "Kreis, five digits",
              "title": "District Key"
            },
            "description": "Kreis, five digits"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/NewsOut"
                  },
                  "title": "Response V1 News"
                }
              }
            }
          },
          "401": {
            "description": "api_key_required, api_key_invalid, api_key_expired, api_key_revoked, token_invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "scope_missing, region_not_licensed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited, key_quota_exhausted; with Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/scan": {
      "post": {
        "tags": [
          "v1"
        ],
        "summary": "Scan a photo",
        "description": "Photo + postal code -> item + bin, same recognition and rules as the Trashures app.\n\nThe photo is never stored. The scan counts against the monthly quota of the key; a scan without a result for\nthe user (provider down, timeout) is given back. `quota` and `achievement_unlocked` are always null here.",
        "operationId": "v1_scan",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/V1ScanRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/V1ScanResponse"
                }
              }
            }
          },
          "401": {
            "description": "api_key_required, api_key_invalid, api_key_expired, api_key_revoked, token_invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "scope_missing, region_not_licensed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited, key_quota_exhausted; with Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Content Too Large",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "Gateway Timeout",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "api_key": []
          }
        ]
      }
    },
    "/v1/scan/{scan_id}/feedback": {
      "post": {
        "tags": [
          "v1"
        ],
        "summary": "Report a wrong result",
        "description": "Report a wrong result of a scan (\"Stimmt nicht?\"); part of the licence. No account is linked.",
        "operationId": "v1_feedback",
        "security": [
          {
            "api_key": []
          }
        ],
        "parameters": [
          {
            "name": "scan_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Scan Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FeedbackRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeedbackResponse"
                }
              }
            }
          },
          "401": {
            "description": "api_key_required, api_key_invalid, api_key_expired, api_key_revoked, token_invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "scope_missing, region_not_licensed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "rate_limited, key_quota_exhausted; with Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "422": {
            "description": "Invalid report, see /api"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AnswerAlternativesOut": {
        "properties": {
          "text": {
            "type": "string",
            "title": "Text"
          },
          "options": {
            "items": {
              "$ref": "#/components/schemas/AnswerOptionOut"
            },
            "type": "array",
            "title": "Options",
            "description": "Each with the parameters of GET /api/resolve; none is preselected"
          }
        },
        "type": "object",
        "required": [
          "text",
          "options"
        ],
        "title": "AnswerAlternativesOut",
        "description": "Other plausible items of a scan that asks no question (\"Meintest du ...?\"): a sure scan or an unknown one."
      },
      "AnswerAttributionOut": {
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "trashures",
              "openstreetmap",
              "openplz",
              "destatis"
            ],
            "title": "Code"
          },
          "text": {
            "type": "string",
            "title": "Text"
          },
          "url": {
            "type": "string",
            "title": "Url"
          }
        },
        "type": "object",
        "required": [
          "code",
          "text",
          "url"
        ],
        "title": "AnswerAttributionOut"
      },
      "AnswerCompostOptionOut": {
        "properties": {
          "id": {
            "type": "string",
            "enum": [
              "compost",
              "bin"
            ],
            "title": "Id"
          },
          "label": {
            "type": "string",
            "title": "Label",
            "description": "Kompost, or the name of the bin of `rows[0]`"
          },
          "selected": {
            "type": "boolean",
            "title": "Selected",
            "description": "Preselected: the suggested way (a client may replace it by the person's own choice for this item)"
          }
        },
        "type": "object",
        "required": [
          "id",
          "label",
          "selected"
        ],
        "title": "AnswerCompostOptionOut"
      },
      "AnswerCompostOut": {
        "properties": {
          "suitability": {
            "type": "string",
            "enum": [
              "geeignet",
              "in_massen"
            ],
            "title": "Suitability",
            "description": "Like `result.compost.suitability`"
          },
          "label": {
            "type": "string",
            "title": "Label",
            "description": "Line above the toggle, e.g. Wohin damit?"
          },
          "options": {
            "items": {
              "$ref": "#/components/schemas/AnswerCompostOptionOut"
            },
            "type": "array",
            "title": "Options",
            "description": "Two options: compost, then the bin"
          },
          "headline": {
            "type": "string",
            "title": "Headline",
            "description": "e.g. 'Kaffeesatz gehört auf den Kompost'"
          },
          "headline_code": {
            "type": "string",
            "enum": [
              "compost_goes_on",
              "compost_goes_on_limited"
            ],
            "title": "Headline Code",
            "description": "compost_goes_on_limited: small amounts only, see `warning`",
            "default": "compost_goes_on"
          },
          "bins_text": {
            "type": "string",
            "title": "Bins Text",
            "description": "Eigener Kompost"
          },
          "row": {
            "$ref": "#/components/schemas/AnswerRowOut",
            "description": "The main item on the compost (bin_code and bin_kind `kompost`)"
          },
          "source": {
            "$ref": "#/components/schemas/AnswerSourceOut",
            "description": "Source of the suitability (e.g. UBA)"
          },
          "reliability_label": {
            "type": "string",
            "title": "Reliability Label",
            "description": "With compost selected: in place of `reliability.label` (the trust level belongs to the bin's rule)"
          },
          "reliability_text": {
            "type": "string",
            "title": "Reliability Text",
            "description": "With compost selected: in place of `reliability.text`"
          },
          "warning": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AnswerCompostWarningOut"
              },
              {
                "type": "null"
              }
            ],
            "description": "Only for in_massen: a warning box on the compost side (the reason is not in `row.hints` then)"
          }
        },
        "type": "object",
        "required": [
          "suitability",
          "label",
          "options",
          "headline",
          "bins_text",
          "row",
          "source",
          "reliability_label",
          "reliability_text"
        ],
        "title": "AnswerCompostOut",
        "description": "The own compost as a second way next to the bin: a toggle like the question.\nWith `compost` selected show `headline`, `bins_text` and `row` in place of the main line of the answer; with\n`bin` the answer as it is. No request is needed for the switch."
      },
      "AnswerCompostWarningOut": {
        "properties": {
          "title": {
            "type": "string",
            "title": "Title",
            "description": "e.g. Nur wenig"
          },
          "text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Text",
            "description": "Why, from the rules (e.g. fungicides on peels); null without"
          },
          "fallback": {
            "type": "string",
            "title": "Fallback",
            "description": "e.g. 'Im Zweifel: Biotonne', the bin of the answer"
          }
        },
        "type": "object",
        "required": [
          "title",
          "fallback"
        ],
        "title": "AnswerCompostWarningOut",
        "description": "Small amounts only (suitability in_massen): show it as a warning box on the compost side."
      },
      "AnswerConfirmOut": {
        "properties": {
          "item_question": {
            "type": "string",
            "title": "Item Question",
            "description": "Kept for older clients (two steps); not shown any more"
          },
          "item_yes": {
            "type": "string",
            "title": "Item Yes"
          },
          "item_no": {
            "type": "string",
            "title": "Item No"
          },
          "item_thanks": {
            "type": "string",
            "title": "Item Thanks"
          },
          "bin_question": {
            "type": "string",
            "title": "Bin Question"
          },
          "bin_yes": {
            "type": "string",
            "title": "Bin Yes"
          },
          "bin_no": {
            "type": "string",
            "title": "Bin No"
          },
          "bin_thanks": {
            "type": "string",
            "title": "Bin Thanks"
          },
          "thanks": {
            "type": "string",
            "title": "Thanks",
            "description": "Kept for older clients; now item_thanks and bin_thanks"
          },
          "undo": {
            "type": "string",
            "title": "Undo"
          }
        },
        "type": "object",
        "required": [
          "item_question",
          "item_yes",
          "item_no",
          "item_thanks",
          "bin_question",
          "bin_yes",
          "bin_no",
          "bin_thanks",
          "thanks",
          "undo"
        ],
        "title": "AnswerConfirmOut",
        "description": "Confirming a scan result: `bin_*` under the bin,\n`item_*` at \"Das habe ich erkannt\", independently. Show them only for a scan with a `scan_id`, once no question\nis open; \"yes\" goes to POST /api/scan/{scan_id}/confirmation, \"no\" and `undo` open the report\n(POST /api/scan/{scan_id}/feedback)."
      },
      "AnswerConfirmedOut": {
        "properties": {
          "headline": {
            "type": "string",
            "title": "Headline"
          },
          "headline_code": {
            "type": "string",
            "enum": [
              "goes_in",
              "probably_goes_in",
              "dispose_separately",
              "probably_dispose_separately",
              "not_accepted_by",
              "not_accepted_here",
              "not_recognized"
            ],
            "title": "Headline Code"
          },
          "item_text": {
            "type": "string",
            "title": "Item Text"
          }
        },
        "type": "object",
        "required": [
          "headline",
          "headline_code",
          "item_text"
        ],
        "title": "AnswerConfirmedOut",
        "description": "The lines of the answer once the open question is answered with the item already shown."
      },
      "AnswerLevelOut": {
        "properties": {
          "level": {
            "type": "string",
            "enum": [
              "basis",
              "vorlaeufig",
              "geprueft"
            ],
            "title": "Level"
          },
          "label": {
            "type": "string",
            "title": "Label"
          },
          "text": {
            "type": "string",
            "title": "Text"
          }
        },
        "type": "object",
        "required": [
          "level",
          "label",
          "text"
        ],
        "title": "AnswerLevelOut"
      },
      "AnswerNoticeOut": {
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "substituted",
              "profile_conflict",
              "compost"
            ],
            "title": "Code",
            "description": "compost: the item does not belong on the household's compost (the text says why)"
          },
          "text": {
            "type": "string",
            "title": "Text"
          }
        },
        "type": "object",
        "required": [
          "code",
          "text"
        ],
        "title": "AnswerNoticeOut"
      },
      "AnswerOptionOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "yes | no for a yes/no question, else the item id"
          },
          "label": {
            "type": "string",
            "title": "Label"
          },
          "selected": {
            "type": "boolean",
            "title": "Selected",
            "description": "Preselected: the recognized item of a choice; never an answer of a yes/no question"
          },
          "confirms": {
            "type": "boolean",
            "title": "Confirms",
            "description": "The option is the item already shown: no request is needed, show `answer.confirmed` instead (nothing is counted then)"
          },
          "resolve": {
            "$ref": "#/components/schemas/AnswerResolveOut"
          }
        },
        "type": "object",
        "required": [
          "id",
          "label",
          "selected",
          "confirms",
          "resolve"
        ],
        "title": "AnswerOptionOut"
      },
      "AnswerOut": {
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "bins",
              "not_accepted",
              "unknown"
            ],
            "title": "Kind",
            "description": "bins: the item goes into the bins of `rows`; not_accepted: the local waste authority does not accept it (bin kind extern), `bins_text` says where it goes instead; unknown: no item"
          },
          "certainty": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "sure",
                  "probable",
                  "suggestion"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Certainty",
            "description": "probable: the scan is uncertain, `question` is open; suggestion: a catch-all by material was recognized, show it as a suggestion; null for kind unknown"
          },
          "split": {
            "type": "boolean",
            "title": "Split",
            "description": "True: parts go into other bins than the main item, the headline says so"
          },
          "headline": {
            "type": "string",
            "title": "Headline",
            "description": "e.g. 'Eierkarton gehört in', 'Getrennt entsorgen', '<Region> nimmt das nicht an'"
          },
          "headline_code": {
            "type": "string",
            "enum": [
              "goes_in",
              "probably_goes_in",
              "dispose_separately",
              "probably_dispose_separately",
              "not_accepted_by",
              "not_accepted_here",
              "not_recognized"
            ],
            "title": "Headline Code"
          },
          "bins_text": {
            "type": "string",
            "title": "Bins Text",
            "description": "The bins as one line, main bin first, each once ('Papiertonne / Altpapier und Biotonne'); 'Stattdessen: <bin>' for not_accepted; empty for unknown"
          },
          "item_text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Item Text",
            "description": "The main item as a line of its own, with ', wahrscheinlich' while the answer is not sure; for layouts whose headline does not name the item (not_accepted). Null for unknown"
          },
          "help": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Help",
            "description": "What to try next; only for kind unknown"
          },
          "confirmed": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AnswerConfirmedOut"
              },
              {
                "type": "null"
              }
            ],
            "description": "Set while certainty is not sure: the lines after the person confirmed the shown item"
          },
          "rows": {
            "items": {
              "$ref": "#/components/schemas/AnswerRowOut"
            },
            "type": "array",
            "title": "Rows",
            "description": "Main item first, then parts in another bin, then the other parts"
          },
          "reliability": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AnswerReliabilityOut"
              },
              {
                "type": "null"
              }
            ],
            "description": "Null for kind unknown"
          },
          "place_status": {
            "$ref": "#/components/schemas/AnswerPlaceStatusOut"
          },
          "question": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AnswerQuestionOut"
              },
              {
                "type": "null"
              }
            ]
          },
          "alternatives": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AnswerAlternativesOut"
              },
              {
                "type": "null"
              }
            ],
            "description": "'Meintest du ...?' of a scan without an open question (sure or unknown); null while `question` is set, for a lookup and without alternatives"
          },
          "compost": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AnswerCompostOut"
              },
              {
                "type": "null"
              }
            ],
            "description": "Own compost next to the bin: only for a sure answer whose `result.compost.offered` is true"
          },
          "confirm": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AnswerConfirmOut"
              },
              {
                "type": "null"
              }
            ],
            "description": "Texts to confirm item and bins; set whenever there is an item, the client shows them only for a scan (with `scan_id`), not for a text search. Only the app's /api has the endpoint to send a confirmation; /v1 clients ignore it"
          },
          "seasonal": {
            "items": {
              "$ref": "#/components/schemas/AnswerSeasonalOut"
            },
            "type": "array",
            "title": "Seasonal",
            "description": "Seasonal hints of the main item that hold today, with the link to the calendar of the local waste authority; empty outside their windows"
          },
          "synonyms": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AnswerSynonymsOut"
              },
              {
                "type": "null"
              }
            ],
            "description": "Other names of the main item; null without synonyms and for unknown"
          },
          "notices": {
            "items": {
              "$ref": "#/components/schemas/AnswerNoticeOut"
            },
            "type": "array",
            "title": "Notices"
          },
          "sources": {
            "items": {
              "$ref": "#/components/schemas/AnswerSourceOut"
            },
            "type": "array",
            "title": "Sources",
            "description": "Sources of the main rule (`result.sources`) with a readable title"
          },
          "attribution": {
            "items": {
              "$ref": "#/components/schemas/AnswerAttributionOut"
            },
            "type": "array",
            "title": "Attribution",
            "description": "Notices a client has to show next to the answer"
          }
        },
        "type": "object",
        "required": [
          "kind",
          "certainty",
          "split",
          "headline",
          "headline_code",
          "bins_text",
          "item_text",
          "rows",
          "reliability",
          "place_status",
          "sources",
          "attribution"
        ],
        "title": "AnswerOut",
        "description": "The finished answer: show it as it is, or build your own texts from the codes."
      },
      "AnswerPlaceStatusOut": {
        "properties": {
          "pending": {
            "type": "boolean",
            "title": "Pending",
            "description": "True: the place is not researched yet, the baseline rule for Germany applies"
          },
          "place": {
            "type": "string",
            "title": "Place",
            "description": "Name of the place as the person knows it (locality, else district, else region)"
          },
          "text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Text",
            "description": "One status line; null for a researched place"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Detail"
          }
        },
        "type": "object",
        "required": [
          "pending",
          "place"
        ],
        "title": "AnswerPlaceStatusOut"
      },
      "AnswerQuestionOut": {
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "yes_no",
              "choice"
            ],
            "title": "Kind"
          },
          "label": {
            "type": "string",
            "title": "Label",
            "description": "Small line above the question, e.g. Kurze Frage"
          },
          "text": {
            "type": "string",
            "title": "Text"
          },
          "text_code": {
            "type": "string",
            "enum": [
              "condition",
              "confusion",
              "generic_suggestion",
              "which_one"
            ],
            "title": "Text Code",
            "description": "condition: yes/no question of a condition family; confusion: look-alike items; generic_suggestion: a catch-all was recognized; which_one: no question in the data"
          },
          "family": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Family",
            "description": "Condition family of a yes/no question"
          },
          "options": {
            "items": {
              "$ref": "#/components/schemas/AnswerOptionOut"
            },
            "type": "array",
            "title": "Options",
            "description": "Empty: only the question, no control"
          },
          "report": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AnswerReportOut"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "kind",
          "label",
          "text",
          "text_code",
          "options"
        ],
        "title": "AnswerQuestionOut"
      },
      "AnswerReliabilityOut": {
        "properties": {
          "level": {
            "type": "string",
            "enum": [
              "basis",
              "vorlaeufig",
              "geprueft"
            ],
            "title": "Level",
            "description": "Trust level of the rule (`result.trust`); an unknown value counts as basis"
          },
          "label": {
            "type": "string",
            "title": "Label",
            "description": "The level in a word, e.g. Allgemein, Vorläufig, Offizielle Quelle"
          },
          "text": {
            "type": "string",
            "title": "Text",
            "description": "What the level means for this answer"
          },
          "text_code": {
            "type": "string",
            "enum": [
              "basis",
              "basis_known",
              "vorlaeufig",
              "geprueft"
            ],
            "title": "Text Code",
            "description": "basis_known: baseline rule in a researched place, the local authority says nothing on the item"
          },
          "covered_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Covered By",
            "description": "Sentence for `result.covered_by`: the item is not named by the authority, it falls under a wording of its page"
          },
          "levels": {
            "items": {
              "$ref": "#/components/schemas/AnswerLevelOut"
            },
            "type": "array",
            "title": "Levels",
            "description": "All levels with their general explanation, for a legend"
          }
        },
        "type": "object",
        "required": [
          "level",
          "label",
          "text",
          "text_code",
          "levels"
        ],
        "title": "AnswerReliabilityOut"
      },
      "AnswerReportOut": {
        "properties": {
          "text": {
            "type": "string",
            "title": "Text"
          },
          "placeholder": {
            "type": "string",
            "title": "Placeholder"
          },
          "send_label": {
            "type": "string",
            "title": "Send Label"
          },
          "confirm_label": {
            "type": "string",
            "title": "Confirm Label",
            "description": "Label of the button that confirms the suggestion without a request"
          },
          "thanks": {
            "type": "string",
            "title": "Thanks"
          },
          "feedback_kind": {
            "type": "string",
            "const": "missing_item",
            "title": "Feedback Kind",
            "description": "POST /api/scan/{scan_id}/feedback with this kind and the text as `note`"
          }
        },
        "type": "object",
        "required": [
          "text",
          "placeholder",
          "send_label",
          "confirm_label",
          "thanks",
          "feedback_kind"
        ],
        "title": "AnswerReportOut",
        "description": "A generic hit: ask what the object is and send it as feedback on the scan."
      },
      "AnswerResolveOut": {
        "properties": {
          "item_id": {
            "type": "string",
            "title": "Item Id"
          },
          "part_item_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Part Item Ids",
            "description": "The parts of the scan: with them the answer of resolve keeps the rows of the parts"
          },
          "answer_family": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Answer Family",
            "description": "Only for a yes/no question: counts the answer. Like `answer` and `answer_first`: leave a parameter out when it is null here"
          },
          "answer": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "yes",
                  "no"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Answer"
          },
          "answer_first": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Answer First",
            "description": "Send true for the first answer to this question, false when the person changes the answer"
          }
        },
        "type": "object",
        "required": [
          "item_id"
        ],
        "title": "AnswerResolveOut",
        "description": "Query parameters of GET /api/resolve for one option, next to the ones the client knows itself\n(postal_code, language, has_bins, location_source)."
      },
      "AnswerRowOut": {
        "properties": {
          "item_id": {
            "type": "string",
            "title": "Item Id"
          },
          "item": {
            "type": "string",
            "title": "Item"
          },
          "role": {
            "type": "string",
            "enum": [
              "main",
              "part"
            ],
            "title": "Role"
          },
          "separate": {
            "type": "boolean",
            "title": "Separate",
            "description": "True for a part that goes into another bin than the main item: show it next to the main item at the top. False for the main item and for parts in the same bin"
          },
          "bin_code": {
            "type": "string",
            "title": "Bin Code"
          },
          "bin": {
            "type": "string",
            "title": "Bin"
          },
          "bin_kind": {
            "type": "string",
            "title": "Bin Kind"
          },
          "color_hex": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Color Hex",
            "description": "Colour of the bin as a hex value, of the slot the item goes into if the bin has slots; null if the bin has no colour (e.g. a recycling centre) and for a bin of the kind extern"
          },
          "colors_hex": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Colors Hex",
            "description": "All colours as stripes, e.g. the three openings of a glass container when the rule names no slot; one entry otherwise, empty without a colour"
          },
          "slot": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AnswerSlotOut"
              },
              {
                "type": "null"
              }
            ],
            "description": "Opening of the container the item goes into"
          },
          "hints": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Hints"
          }
        },
        "type": "object",
        "required": [
          "item_id",
          "item",
          "role",
          "separate",
          "bin_code",
          "bin",
          "bin_kind",
          "color_hex",
          "colors_hex",
          "hints"
        ],
        "title": "AnswerRowOut",
        "description": "One line of the answer: the main item or one of its separable parts with its bin."
      },
      "AnswerSeasonalOut": {
        "properties": {
          "text": {
            "type": "string",
            "title": "Text"
          },
          "until": {
            "type": "string",
            "format": "date",
            "title": "Until",
            "description": "Last day the hint holds (Europe/Berlin)"
          },
          "until_text": {
            "type": "string",
            "title": "Until Text",
            "description": "'Gilt bis 9. Januar 2027'"
          },
          "source": {
            "$ref": "#/components/schemas/AnswerSourceOut"
          },
          "calendar_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Calendar Url",
            "description": "Official calendar or app of the local waste authority with the dates; null if the region has none"
          },
          "calendar_label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Calendar Label",
            "description": "'Termine im Abfallkalender'; null without calendar_url"
          }
        },
        "type": "object",
        "required": [
          "text",
          "until",
          "until_text",
          "source",
          "calendar_url",
          "calendar_label"
        ],
        "title": "AnswerSeasonalOut",
        "description": "A seasonal hint of the main item whose window holds today, e.g. the Christmas tree collection."
      },
      "AnswerSlotOut": {
        "properties": {
          "code": {
            "type": "string",
            "title": "Code"
          },
          "name": {
            "type": "string",
            "title": "Name"
          }
        },
        "type": "object",
        "required": [
          "code",
          "name"
        ],
        "title": "AnswerSlotOut"
      },
      "AnswerSourceOut": {
        "properties": {
          "url": {
            "type": "string",
            "title": "Url"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "host": {
            "type": "string",
            "title": "Host"
          }
        },
        "type": "object",
        "required": [
          "url",
          "title",
          "host"
        ],
        "title": "AnswerSourceOut"
      },
      "AnswerSynonymsOut": {
        "properties": {
          "title": {
            "type": "string",
            "title": "Title",
            "description": "Title of the sheet, e.g. Auch so genannt"
          },
          "line": {
            "type": "string",
            "title": "Line",
            "description": "e.g. 'auch: Küchenschwamm, Mikrofasertuch': up to 3 synonyms in order while the line has at most 45 characters, at least one"
          },
          "more": {
            "type": "integer",
            "title": "More",
            "description": "How many synonyms are not in `line` (show '+n'); 0: none left"
          },
          "all": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "All",
            "description": "Every synonym in the language asked (the item's own list first, then reviewed ones), none equal to the name"
          },
          "explanation": {
            "type": "string",
            "title": "Explanation",
            "description": "Why they are disposed of alike, with the first synonym; names the bin of the main item only when the region is known and the kind is not not_accepted"
          },
          "explanation_code": {
            "type": "string",
            "enum": [
              "same_item",
              "same_item_here"
            ],
            "title": "Explanation Code",
            "description": "same_item_here: the sentence names the bin of the place"
          },
          "explanation_template": {
            "type": "string",
            "title": "Explanation Template",
            "description": "`explanation` with the placeholder {term} in place of the first synonym: a client that knows the word the person searched for puts it there"
          }
        },
        "type": "object",
        "required": [
          "title",
          "line",
          "more",
          "all",
          "explanation",
          "explanation_code",
          "explanation_template"
        ],
        "title": "AnswerSynonymsOut",
        "description": "Other names of the main item: a small line under the headline, \"+n\" for the rest, and the\nsheet \"Auch so genannt\" with all names and why they are disposed of alike. Never for the parts."
      },
      "BBoxOut": {
        "properties": {
          "x": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "X",
            "description": "Left edge"
          },
          "y": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Y",
            "description": "Top edge"
          },
          "w": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "W",
            "description": "Width"
          },
          "h": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "H",
            "description": "Height"
          }
        },
        "type": "object",
        "required": [
          "x",
          "y",
          "w",
          "h"
        ],
        "title": "BBoxOut",
        "description": "Where the recognized item is in the photo, as fractions of its width and height (origin top left)."
      },
      "BeforeBinOut": {
        "properties": {
          "tip": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TipOut"
              },
              {
                "type": "null"
              }
            ]
          },
          "offer": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/OfferOut"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "title": "BeforeBinOut",
        "description": "What can be done before the bin: at most one tip that holds everywhere and one offer of the örE."
      },
      "BinOut": {
        "properties": {
          "code": {
            "type": "string",
            "title": "Code"
          },
          "name": {
            "type": "string",
            "title": "Name",
            "description": "Short name without facts in parentheses"
          },
          "color": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Color"
          },
          "kind": {
            "type": "string",
            "title": "Kind"
          },
          "detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Detail",
            "description": "One short line about the bin, e.g. the collection rhythm"
          },
          "places": {
            "items": {
              "$ref": "#/components/schemas/PlaceOut"
            },
            "type": "array",
            "title": "Places",
            "description": "Sites of the bin, empty if not listed"
          },
          "slots": {
            "items": {
              "$ref": "#/components/schemas/SlotOut"
            },
            "type": "array",
            "title": "Slots",
            "description": "Openings of a container (glass colours), empty if it has only one"
          }
        },
        "type": "object",
        "required": [
          "code",
          "name",
          "color",
          "kind"
        ],
        "title": "BinOut"
      },
      "ClarificationOut": {
        "properties": {
          "kind": {
            "type": "string",
            "const": "yes_no",
            "title": "Kind",
            "description": "Answer form; only yes_no so far"
          },
          "text": {
            "type": "string",
            "title": "Text",
            "description": "The question in the requested language, same text as `question`"
          },
          "family": {
            "type": "string",
            "title": "Family",
            "description": "Condition family of the taxonomy the question belongs to, e.g. pizzakarton"
          },
          "yes_item_id": {
            "type": "string",
            "title": "Yes Item Id",
            "description": "Item for the answer yes: call GET /api/resolve with it"
          },
          "no_item_id": {
            "type": "string",
            "title": "No Item Id",
            "description": "Item for the answer no: call GET /api/resolve with it"
          }
        },
        "type": "object",
        "required": [
          "kind",
          "text",
          "family",
          "yes_item_id",
          "no_item_id"
        ],
        "title": "ClarificationOut",
        "description": "The one clarifying question of a scan in a form the app can answer without a model call."
      },
      "CompostOut": {
        "properties": {
          "suitability": {
            "type": "string",
            "enum": [
              "geeignet",
              "in_massen",
              "ungeeignet"
            ],
            "title": "Suitability",
            "description": "geeignet: good on the compost; in_massen: small amounts only; ungeeignet: not on the compost"
          },
          "offered": {
            "type": "boolean",
            "title": "Offered",
            "description": "True: the compost is a way for this item, show it next to the bin (answer.compost has the toggle). False: only the note, e.g. for meat; or the household has only a worm bin or bokashi"
          },
          "preferred": {
            "type": "boolean",
            "title": "Preferred",
            "description": "True: the compost is the suggestion and preselected; false: the bin is"
          },
          "hint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Hint",
            "description": "How ('In kleinen Mengen') or why not, in the language asked"
          },
          "source": {
            "type": "string",
            "title": "Source",
            "description": "URL backing the suitability (e.g. UBA); not part of sources, no effect on trust"
          }
        },
        "type": "object",
        "required": [
          "suitability",
          "offered",
          "preferred",
          "source"
        ],
        "title": "CompostOut",
        "description": "The household's own compost next to the bin: only with compost forms in the profile and an\nitem whose suitability is in the rules. `bin` stays the bin of the rules either way."
      },
      "ErrorOut": {
        "properties": {
          "code": {
            "type": "string",
            "title": "Code",
            "description": "Stable error code for the client, e.g. recognition_rate_limited"
          },
          "message": {
            "type": "string",
            "title": "Message"
          }
        },
        "type": "object",
        "required": [
          "code",
          "message"
        ],
        "title": "ErrorOut"
      },
      "ErrorResponse": {
        "properties": {
          "detail": {
            "$ref": "#/components/schemas/ErrorOut"
          }
        },
        "type": "object",
        "required": [
          "detail"
        ],
        "title": "ErrorResponse"
      },
      "FactOut": {
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "fakt",
              "mythos",
              "wusstest_du"
            ],
            "title": "Kind",
            "description": "fakt: sourced fact; mythos: a common myth with its correction; wusstest_du: a plain note"
          },
          "text": {
            "type": "string",
            "title": "Text"
          },
          "source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source",
            "description": "URL backing the note; always set for fakt and mythos, optional for wusstest_du"
          }
        },
        "type": "object",
        "required": [
          "kind",
          "text"
        ],
        "title": "FactOut"
      },
      "FeedbackRequest": {
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "wrong_item",
              "missing_item",
              "wrong_bin",
              "rule_outdated",
              "other"
            ],
            "title": "Kind",
            "description": "wrong_item: the photo shows another item (exactly one of correct_item_id or item_term); missing_item: 'Nicht in der Liste', the item is not in the taxonomy (no correct_item_id, optional item_term); wrong_bin: the item belongs in another bin here (bin_shown and correct_bin required); rule_outdated: the rule for this place is outdated or differs (reason required); other: something else, the note says what (note required, optional bin_shown)",
            "default": "wrong_item"
          },
          "correct_item_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Correct Item Id",
            "description": "Item id from GET /api/items that the photo really shows"
          },
          "item_term": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Item Term",
            "description": "\"Was ist es?\": what the photo really shows in the person's words, when the search found nothing. Only wrong_item (instead of correct_item_id) and missing_item (besides the note). At most 60 characters after trimming (422 feedback_term_too_long); stored with e-mail addresses, links and phone numbers masked, shown to admins and in the GitHub issue; never logged. Empty or only spaces counts as not sent."
          },
          "note": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ],
            "title": "Note",
            "description": "Short text, required for other. Stored with the scan and, with e-mail addresses, links and phone numbers masked, in the report that goes to the team (GitHub issue); never logged."
          },
          "bin_shown": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 32,
                "pattern": "^[a-z0-9_]+$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bin Shown",
            "description": "Bin code the app showed (wrong_bin, rule_outdated, other)"
          },
          "correct_bin": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 32,
                "pattern": "^[a-z0-9_]+$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Correct Bin",
            "description": "wrong_bin: bin code of this region the item really belongs in"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "bin_missing",
                  "new_bin",
                  "district_differs",
                  "other"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason",
            "description": "rule_outdated: bin_missing 'Ich habe diese Tonne nicht', new_bin 'Seit kurzem gibt es hier eine neue Tonne', district_differs 'Mein Ortsteil hat eine andere Abfuhr', other"
          },
          "source_url": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500,
                "pattern": "^https://[^\\s]+$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Url",
            "description": "wrong_bin, rule_outdated: official page that shows the rule (https)"
          },
          "shown_item_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Shown Item Id",
            "description": "wrong_bin, rule_outdated, other: item whose bin was shown, if the person switched to another item ('Meintest du ...?'); default: the recognized item"
          },
          "app_version": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 32,
                "pattern": "^[0-9A-Za-z.+_-]+$"
              },
              {
                "type": "null"
              }
            ],
            "title": "App Version"
          }
        },
        "type": "object",
        "title": "FeedbackRequest"
      },
      "FeedbackResponse": {
        "properties": {
          "scan_id": {
            "type": "string",
            "title": "Scan Id"
          },
          "kind": {
            "type": "string",
            "enum": [
              "wrong_item",
              "missing_item",
              "wrong_bin",
              "rule_outdated",
              "other"
            ],
            "title": "Kind"
          },
          "correct_item": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ItemOut"
              },
              {
                "type": "null"
              }
            ],
            "description": "Only for wrong_item"
          },
          "photo_stored": {
            "type": "boolean",
            "title": "Photo Stored",
            "description": "True if the photo of this scan is kept for review"
          },
          "achievement_unlocked": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "first_feedback",
                  "scan_report"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Achievement Unlocked",
            "description": "first_feedback the first time a registered account sends a report or feedback, else scan_report (Mitdenker:in mit Blick) for its first report on a photo result, stored photo or not; GET /api/me lists all"
          }
        },
        "type": "object",
        "required": [
          "scan_id",
          "kind",
          "correct_item",
          "photo_stored"
        ],
        "title": "FeedbackResponse"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "HouseholdBinOut": {
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "restmuell",
              "bio",
              "papier",
              "verpackung"
            ],
            "title": "Code"
          },
          "name": {
            "type": "string",
            "title": "Name",
            "description": "Name of the bin at this place, e.g. Grüne Papiertonne"
          },
          "color": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Color",
            "description": "Colour word from the rules, e.g. grün; several words with / are stripes"
          },
          "colors_hex": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Colors Hex",
            "description": "Swatch colours of the bin, same mapping as answer.rows[].colors_hex (the client computes no colour); empty without a colour"
          },
          "plain_name": {
            "type": "string",
            "title": "Plain Name",
            "description": "Name without a colour word, shown when the household gives the bin its own colour, the same name the answer then uses"
          },
          "kind": {
            "type": "string",
            "title": "Kind",
            "description": "tonne or sack"
          }
        },
        "type": "object",
        "required": [
          "code",
          "name",
          "color",
          "colors_hex",
          "plain_name",
          "kind"
        ],
        "title": "HouseholdBinOut"
      },
      "ItemHitOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "icon": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Icon",
            "description": "Lucide icon name for tiles, None if not set"
          },
          "generic": {
            "type": "boolean",
            "title": "Generic",
            "description": "Catch-all by material and kind: a scan on it is always uncertain, show it as a suggestion and ask what the object is",
            "default": false
          },
          "synonyms": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Synonyms",
            "description": "Up to 3 synonyms in the language asked, without those equal to the name; a synonym that is part of the name stays (\"Kaffeesatz\" at \"Kaffeesatz mit Filter\"). Show them as \"auch: ...\""
          },
          "matched_synonym": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Matched Synonym",
            "description": "The synonym of the item (original spelling) through which the query found the item, null when a name matches as well; may be one beyond `synonyms`. Show it as \"gefunden über „…“\""
          }
        },
        "type": "object",
        "required": [
          "id",
          "name"
        ],
        "title": "ItemHitOut",
        "description": "A hit of the text search (GET /api/items, /v1/items): an item plus the synonym the query came through."
      },
      "ItemOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "icon": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Icon",
            "description": "Lucide icon name for tiles, None if not set"
          },
          "generic": {
            "type": "boolean",
            "title": "Generic",
            "description": "Catch-all by material and kind: a scan on it is always uncertain, show it as a suggestion and ask what the object is",
            "default": false
          },
          "synonyms": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Synonyms",
            "description": "Up to 3 synonyms in the language asked, without those equal to the name; a synonym that is part of the name stays (\"Kaffeesatz\" at \"Kaffeesatz mit Filter\"). Show them as \"auch: ...\""
          }
        },
        "type": "object",
        "required": [
          "id",
          "name"
        ],
        "title": "ItemOut"
      },
      "NewsOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "kind": {
            "type": "string",
            "enum": [
              "mitteilung",
              "ort_neu",
              "regeln_aktualisiert"
            ],
            "title": "Kind",
            "description": "mitteilung: Meldung des örE, ort_neu: für den Kreis liegen erstmals Regeln vor, regeln_aktualisiert: die Regeln wurden geprüft und aktualisiert"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "summary": {
            "type": "string",
            "title": "Summary"
          },
          "source_url": {
            "type": "string",
            "title": "Source Url",
            "description": "Official page the entry is based on"
          },
          "municipality": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Municipality",
            "description": "Gemeinde as text, no filter"
          },
          "published_at": {
            "type": "string",
            "format": "date-time",
            "title": "Published At"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "title": "Expires At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "kind",
          "title",
          "summary",
          "source_url",
          "published_at",
          "expires_at"
        ],
        "title": "NewsOut"
      },
      "OfferOut": {
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "weitergeben",
              "reparieren",
              "zurueckgeben"
            ],
            "title": "Kind"
          },
          "name": {
            "type": "string",
            "title": "Name",
            "description": "Name of the place, e.g. the second-hand store of the örE"
          },
          "url": {
            "type": "string",
            "title": "Url",
            "description": "Page of the offer; no dates or opening hours in the answer, they go stale"
          },
          "hint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Hint",
            "description": "What it takes and how, in the language asked"
          },
          "source": {
            "type": "string",
            "title": "Source",
            "description": "Official page that says what it takes"
          }
        },
        "type": "object",
        "required": [
          "kind",
          "name",
          "url",
          "source"
        ],
        "title": "OfferOut"
      },
      "PlaceOut": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name",
            "description": "Name of the site, e.g. a recycling centre; the app builds a map search from it"
          }
        },
        "type": "object",
        "required": [
          "name"
        ],
        "title": "PlaceOut"
      },
      "Profile": {
        "properties": {
          "has_bins": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Has Bins",
            "description": "Household bins the user has, e.g. ['restmuell', 'papier', 'verpackung']"
          },
          "housing": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "haus",
                  "wohnung"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Housing"
          },
          "shared_bins": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Shared Bins"
          },
          "compost": {
            "anyOf": [
              {
                "items": {
                  "type": "string",
                  "enum": [
                    "garten",
                    "thermo",
                    "wurmkiste",
                    "bokashi"
                  ]
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Compost",
            "description": "Compost forms of the household: null = not answered, [] = no compost, else any of garten, thermo, wurmkiste, bokashi"
          },
          "bin_colors": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string",
                  "enum": [
                    "grau",
                    "schwarz",
                    "braun",
                    "blau",
                    "gelb",
                    "grün",
                    "weiß",
                    "rot",
                    "orange",
                    "lila"
                  ]
                },
                "propertyNames": {
                  "enum": [
                    "restmuell",
                    "bio",
                    "papier",
                    "verpackung"
                  ]
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bin Colors",
            "description": "Own colour of household bins where the household's bin differs from the rules of the place, e.g. {\"papier\": \"blau\"}. The result and `answer` show the bin in that colour and without the colour word in its name. null or {} = the colours of the rules"
          }
        },
        "type": "object",
        "title": "Profile"
      },
      "QuotaOut": {
        "properties": {
          "tier": {
            "type": "string",
            "enum": [
              "guest",
              "registered"
            ],
            "title": "Tier"
          },
          "remaining": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Remaining",
            "description": "Scans left in the current window; None = no limit"
          },
          "limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Limit",
            "description": "Scans per window of this tier ('noch 2 von 3'); None = no limit"
          },
          "resets_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resets At",
            "description": "ISO 8601 (UTC) when the window resets: guests 24 h after their first scan, registered accounts at local midnight; None if no limit or the guest window has not started"
          }
        },
        "type": "object",
        "required": [
          "tier",
          "remaining",
          "resets_at"
        ],
        "title": "QuotaOut"
      },
      "RegionOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "known": {
            "type": "boolean",
            "title": "Known",
            "description": "False: region not researched yet, baseline rules are used"
          },
          "status": {
            "type": "string",
            "enum": [
              "requested",
              "research",
              "live",
              "verified",
              "official"
            ],
            "title": "Status",
            "description": "Place status in five steps: requested and research for an unknown district (research once its new-region issue exists; only GET /api/region checks that, scan, resolve and popular report requested), live for rules at vorlaeufig, verified at geprueft, official while a signed agreement with the örE is active"
          },
          "locality": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Locality"
          },
          "district": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "District"
          },
          "district_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "District Key"
          },
          "achievement_unlocked": {
            "anyOf": [
              {
                "type": "string",
                "const": "first_region"
              },
              {
                "type": "null"
              }
            ],
            "title": "Achievement Unlocked",
            "description": "Always null: first_region comes with the second place of the account (GET /api/resolve and POST /api/scan). Kept so older apps keep parsing"
          },
          "household_bins": {
            "items": {
              "$ref": "#/components/schemas/HouseholdBinOut"
            },
            "type": "array",
            "title": "Household Bins",
            "description": "Only GET /api/region (and /v1/region): the household bins the place has, with name and colour from the rules, in the order restmuell, bio, papier, verpackung; a bin the örE does not have is missing. An unknown place gets the baseline bins for Germany. Empty in scan, resolve and popular responses"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "known",
          "status"
        ],
        "title": "RegionOut"
      },
      "ResolutionOut": {
        "properties": {
          "item": {
            "$ref": "#/components/schemas/ItemOut"
          },
          "bin": {
            "$ref": "#/components/schemas/BinOut"
          },
          "trust": {
            "type": "string",
            "title": "Trust",
            "description": "basis | vorlaeufig | geprueft"
          },
          "hints": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Hints"
          },
          "sources": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Sources"
          },
          "substituted_from": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Substituted From",
            "description": "Bins that were not available and replaced"
          },
          "profile_conflict": {
            "type": "boolean",
            "title": "Profile Conflict",
            "description": "True if the bin is not available here or the household lacks it and nothing replaces it",
            "default": false
          },
          "slot": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Slot",
            "description": "Code of the slot in bin.slots the item goes into"
          },
          "why": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WhyOut"
              },
              {
                "type": "null"
              }
            ],
            "description": "Why the rule is as it is, with its source"
          },
          "seasonal": {
            "items": {
              "$ref": "#/components/schemas/SeasonalOut"
            },
            "type": "array",
            "title": "Seasonal",
            "description": "Hints that hold only between two fixed dates and hold today, e.g. the Christmas tree collection; empty outside their windows"
          },
          "covered_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Covered By",
            "description": "Wording on the örE page (first source) the item falls under when the örE does not name it explicitly; null if named explicitly or the rule is a baseline rule"
          },
          "compost": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CompostOut"
              },
              {
                "type": "null"
              }
            ],
            "description": "Own compost next to the bin; null without compost forms in the profile (`compost` of the scan profile or of /api/resolve) or without a suitability for the item"
          },
          "before_bin": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BeforeBinOut"
              },
              {
                "type": "null"
              }
            ],
            "description": "What can be done before the bin: a sourced tip and an offer of the örE (offers in its rule file); null if there is neither, and in an uncertain scan"
          },
          "fact": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FactOut"
              },
              {
                "type": "null"
              }
            ],
            "description": "One fact or myth about the item or its group, picked at random on every call; small note below the bin, never in place of the answer. Null if there is none. Only set on the main result of a `recognized` `/api/scan` and on `/api/resolve`, not on `parts` or tiles."
          }
        },
        "type": "object",
        "required": [
          "item",
          "bin",
          "trust",
          "hints",
          "sources",
          "substituted_from"
        ],
        "title": "ResolutionOut"
      },
      "SeasonalOut": {
        "properties": {
          "text": {
            "type": "string",
            "title": "Text"
          },
          "until": {
            "type": "string",
            "format": "date",
            "title": "Until",
            "description": "Last day the hint holds (Europe/Berlin)"
          },
          "source": {
            "type": "string",
            "title": "Source"
          },
          "calendar_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Calendar Url",
            "description": "Official calendar of the local waste authority, if known"
          }
        },
        "type": "object",
        "required": [
          "text",
          "until",
          "source",
          "calendar_url"
        ],
        "title": "SeasonalOut"
      },
      "SlotOut": {
        "properties": {
          "code": {
            "type": "string",
            "title": "Code"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "color": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Color"
          }
        },
        "type": "object",
        "required": [
          "code",
          "name"
        ],
        "title": "SlotOut"
      },
      "TileOut": {
        "properties": {
          "item": {
            "$ref": "#/components/schemas/ItemOut"
          },
          "bin": {
            "$ref": "#/components/schemas/BinOut",
            "description": "Bin of the item in this region for the given household (colour strip on the tile)"
          }
        },
        "type": "object",
        "required": [
          "item",
          "bin"
        ],
        "title": "TileOut"
      },
      "TipOut": {
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "regrow",
              "weiterverwerten",
              "weitergeben",
              "reparieren",
              "zurueckgeben",
              "pfand"
            ],
            "title": "Kind",
            "description": "What to do instead of the bin: let it sprout, use it up, give it away, repair it, return it, deposit"
          },
          "text": {
            "type": "string",
            "title": "Text",
            "description": "One or two sentences in the language asked"
          },
          "source": {
            "type": "string",
            "title": "Source",
            "description": "URL backing every statement of the tip"
          }
        },
        "type": "object",
        "required": [
          "kind",
          "text",
          "source"
        ],
        "title": "TipOut"
      },
      "TokenRequest": {
        "properties": {
          "scopes": {
            "anyOf": [
              {
                "items": {
                  "type": "string",
                  "enum": [
                    "data",
                    "scan",
                    "feedback"
                  ]
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scopes",
            "description": "Scopes of the token; default: all scopes of the key. Never more than the key has"
          }
        },
        "type": "object",
        "title": "TokenRequest"
      },
      "TokenResponse": {
        "properties": {
          "token": {
            "type": "string",
            "title": "Token",
            "description": "Send as `Authorization: Bearer <token>` to /v1 from the app"
          },
          "token_type": {
            "type": "string",
            "const": "Bearer",
            "title": "Token Type",
            "default": "Bearer"
          },
          "expires_in": {
            "type": "integer",
            "title": "Expires In",
            "description": "Seconds until the token expires"
          },
          "scopes": {
            "items": {
              "type": "string",
              "enum": [
                "data",
                "scan",
                "feedback"
              ]
            },
            "type": "array",
            "title": "Scopes"
          }
        },
        "type": "object",
        "required": [
          "token",
          "expires_in",
          "scopes"
        ],
        "title": "TokenResponse"
      },
      "V1PopularResponse": {
        "properties": {
          "region": {
            "$ref": "#/components/schemas/RegionOut"
          },
          "tiles": {
            "items": {
              "$ref": "#/components/schemas/TileOut"
            },
            "type": "array",
            "title": "Tiles",
            "description": "Most searched items of the region first, then the curated start list"
          },
          "territory": {
            "type": "string",
            "enum": [
              "licensed",
              "baseline"
            ],
            "title": "Territory",
            "description": "licensed: the place lies in the territory of the key, the rules of its region apply. baseline: the place lies outside, the answer is the general rule for Germany and must be shown as such"
          }
        },
        "type": "object",
        "required": [
          "region",
          "tiles",
          "territory"
        ],
        "title": "V1PopularResponse"
      },
      "V1RegionOut": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "known": {
            "type": "boolean",
            "title": "Known",
            "description": "False: region not researched yet, baseline rules are used"
          },
          "status": {
            "type": "string",
            "enum": [
              "requested",
              "research",
              "live",
              "verified",
              "official"
            ],
            "title": "Status",
            "description": "Place status in five steps: requested and research for an unknown district (research once its new-region issue exists; only GET /api/region checks that, scan, resolve and popular report requested), live for rules at vorlaeufig, verified at geprueft, official while a signed agreement with the örE is active"
          },
          "locality": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Locality"
          },
          "district": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "District"
          },
          "district_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "District Key"
          },
          "achievement_unlocked": {
            "anyOf": [
              {
                "type": "string",
                "const": "first_region"
              },
              {
                "type": "null"
              }
            ],
            "title": "Achievement Unlocked",
            "description": "Always null: first_region comes with the second place of the account (GET /api/resolve and POST /api/scan). Kept so older apps keep parsing"
          },
          "household_bins": {
            "items": {
              "$ref": "#/components/schemas/HouseholdBinOut"
            },
            "type": "array",
            "title": "Household Bins",
            "description": "Only GET /api/region (and /v1/region): the household bins the place has, with name and colour from the rules, in the order restmuell, bio, papier, verpackung; a bin the örE does not have is missing. An unknown place gets the baseline bins for Germany. Empty in scan, resolve and popular responses"
          },
          "territory": {
            "type": "string",
            "enum": [
              "licensed",
              "baseline"
            ],
            "title": "Territory",
            "description": "licensed: the place lies in the territory of the key, the rules of its region apply. baseline: the place lies outside, the answer is the general rule for Germany and must be shown as such"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "known",
          "status",
          "territory"
        ],
        "title": "V1RegionOut"
      },
      "V1ResolveResponse": {
        "properties": {
          "region": {
            "$ref": "#/components/schemas/RegionOut"
          },
          "result": {
            "$ref": "#/components/schemas/ResolutionOut"
          },
          "achievement_unlocked": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "lookup_25",
                  "first_region",
                  "places_3",
                  "places_10",
                  "season_christmas_tree",
                  "season_new_year",
                  "hazardous_scout",
                  "electrical_scout",
                  "parts_split",
                  "special_bin",
                  "bin_restmuell_1",
                  "bin_restmuell_2",
                  "bin_restmuell_3",
                  "bin_restmuell_4",
                  "bin_restmuell_5",
                  "bin_bio_1",
                  "bin_bio_2",
                  "bin_bio_3",
                  "bin_bio_4",
                  "bin_bio_5",
                  "bin_papier_1",
                  "bin_papier_2",
                  "bin_papier_3",
                  "bin_papier_4",
                  "bin_papier_5",
                  "bin_verpackung_1",
                  "bin_verpackung_2",
                  "bin_verpackung_3",
                  "bin_verpackung_4",
                  "bin_verpackung_5",
                  "bin_glas_1",
                  "bin_glas_2",
                  "bin_glas_3",
                  "bin_glas_4",
                  "bin_glas_5",
                  "bin_kompost_1",
                  "bin_kompost_2",
                  "bin_kompost_3",
                  "bin_kompost_4",
                  "bin_kompost_5",
                  "streak_1",
                  "streak_2",
                  "streak_3",
                  "streak_7",
                  "streak_14",
                  "streak_30"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Achievement Unlocked",
            "description": "Achievement unlocked by this result for a registered account: lookup_25 Nachschlagewerk, first_region Ortsentdecker:in (second place), places_3 Ortskundige:r, places_10 Weltenbummler:in; scouts: hazardous_scout Schadstoff-Scout, electrical_scout Elektro-Scout; Mystery: parts_split Zerlegekünstler:in, special_bin Sonderfall; seasonal: season_christmas_tree Oh Tannenbaum, season_new_year Guten Rutsch; bin tiers: bin_<bin>_<1..5> at 1, 5, 10, 50, 100 items of the bin; streak: streak_<days> at 1, 2, 3, 7, 14, 30 days in a row; only the first time. If one result unlocks several, this is the first, GET /api/me lists all"
          },
          "answer": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AnswerOut"
              },
              {
                "type": "null"
              }
            ],
            "description": "The finished answer built from the other fields: headline, bins, one row per item and part, certainty, the open question with the resolve parameters of each option, reliability, status of the place, sources with titles and the notices a client has to show. Texts in `language`, each with its code. Always set by this API version; the other fields stay as they are"
          },
          "territory": {
            "type": "string",
            "enum": [
              "licensed",
              "baseline"
            ],
            "title": "Territory",
            "description": "licensed: the place lies in the territory of the key, the rules of its region apply. baseline: the place lies outside, the answer is the general rule for Germany and must be shown as such"
          }
        },
        "type": "object",
        "required": [
          "region",
          "result",
          "territory"
        ],
        "title": "V1ResolveResponse"
      },
      "V1ScanRequest": {
        "properties": {
          "image": {
            "type": "string",
            "maxLength": 10000000,
            "title": "Image",
            "description": "Base64 encoded JPEG or PNG, a data: URL prefix is allowed"
          },
          "postal_code": {
            "type": "string",
            "pattern": "^\\d{5}$",
            "title": "Postal Code"
          },
          "language": {
            "type": "string",
            "enum": [
              "de",
              "en"
            ],
            "title": "Language",
            "default": "de"
          },
          "profile": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Profile"
              },
              {
                "type": "null"
              }
            ]
          },
          "hint": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ],
            "title": "Hint",
            "description": "Optional user hint or correction"
          }
        },
        "type": "object",
        "required": [
          "image",
          "postal_code"
        ],
        "title": "V1ScanRequest"
      },
      "V1ScanResponse": {
        "properties": {
          "region": {
            "$ref": "#/components/schemas/RegionOut"
          },
          "status": {
            "type": "string",
            "enum": [
              "recognized",
              "uncertain",
              "unknown"
            ],
            "title": "Status",
            "description": "uncertain: show `question` (with `clarification`, if set, as yes/no buttons) and `alternatives` before trusting the result; also set for a generic item (`result.item.generic`) and when an alternative ends in another bin here; unknown: offer /items search or a new photo with a hint"
          },
          "description": {
            "type": "string",
            "title": "Description"
          },
          "confidence": {
            "type": "number",
            "title": "Confidence",
            "description": "Self-reported by the model, not calibrated; for logging only"
          },
          "result": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ResolutionOut"
              },
              {
                "type": "null"
              }
            ],
            "description": "None if the item was not recognized"
          },
          "alternatives": {
            "items": {
              "$ref": "#/components/schemas/ItemOut"
            },
            "type": "array",
            "title": "Alternatives",
            "description": "Other plausible items ('Meintest du ...?'). With a condition question the other variant comes first, also when the model did not name it"
          },
          "question": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Question",
            "description": "Clarifying question (at most one per scan): the result depends on a condition the photo does not show, or the item is easy to confuse"
          },
          "clarification": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ClarificationOut"
              },
              {
                "type": "null"
              }
            ],
            "description": "Set when `question` is a yes/no question about the item's condition: the item to resolve for each answer. None for other questions (answer them via `alternatives`)"
          },
          "parts": {
            "items": {
              "$ref": "#/components/schemas/ResolutionOut"
            },
            "type": "array",
            "title": "Parts",
            "description": "Separable parts sorted differently"
          },
          "scan_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scan Id",
            "description": "Random id of this scan for feedback and deletion (keep it on the device); None if the scan log is switched off or failed"
          },
          "photo_stored": {
            "type": "boolean",
            "title": "Photo Stored",
            "description": "True if the photo was kept (only with store_photo)",
            "default": false
          },
          "quota": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/QuotaOut"
              },
              {
                "type": "null"
              }
            ],
            "description": "The account's scan quota after this scan"
          },
          "bbox": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BBoxOut"
              },
              {
                "type": "null"
              }
            ],
            "description": "Box around the recognized item in the photo the app sent (after EXIF rotation), for a soft highlight. None if the feature is off (SCAN_BBOX), the model gave no usable box or the box covers nearly the whole photo. Describes the photo, not the rule; never stored."
          },
          "achievement_unlocked": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "lookup_25",
                  "first_region",
                  "places_3",
                  "places_10",
                  "season_christmas_tree",
                  "season_new_year",
                  "hazardous_scout",
                  "electrical_scout",
                  "parts_split",
                  "special_bin",
                  "bin_restmuell_1",
                  "bin_restmuell_2",
                  "bin_restmuell_3",
                  "bin_restmuell_4",
                  "bin_restmuell_5",
                  "bin_bio_1",
                  "bin_bio_2",
                  "bin_bio_3",
                  "bin_bio_4",
                  "bin_bio_5",
                  "bin_papier_1",
                  "bin_papier_2",
                  "bin_papier_3",
                  "bin_papier_4",
                  "bin_papier_5",
                  "bin_verpackung_1",
                  "bin_verpackung_2",
                  "bin_verpackung_3",
                  "bin_verpackung_4",
                  "bin_verpackung_5",
                  "bin_glas_1",
                  "bin_glas_2",
                  "bin_glas_3",
                  "bin_glas_4",
                  "bin_glas_5",
                  "bin_kompost_1",
                  "bin_kompost_2",
                  "bin_kompost_3",
                  "bin_kompost_4",
                  "bin_kompost_5",
                  "streak_1",
                  "streak_2",
                  "streak_3",
                  "streak_7",
                  "streak_14",
                  "streak_30"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Achievement Unlocked",
            "description": "Achievement unlocked by this result for a registered account: lookup_25 Nachschlagewerk, first_region Ortsentdecker:in (second place), places_3 Ortskundige:r, places_10 Weltenbummler:in; scouts: hazardous_scout Schadstoff-Scout, electrical_scout Elektro-Scout; Mystery: parts_split Zerlegekünstler:in, special_bin Sonderfall; seasonal: season_christmas_tree Oh Tannenbaum, season_new_year Guten Rutsch; bin tiers: bin_<bin>_<1..5> at 1, 5, 10, 50, 100 items of the bin; streak: streak_<days> at 1, 2, 3, 7, 14, 30 days in a row; only the first time. If one result unlocks several, this is the first, GET /api/me lists all"
          },
          "answer": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AnswerOut"
              },
              {
                "type": "null"
              }
            ],
            "description": "The finished answer built from the other fields: headline, bins, one row per item and part, certainty, the open question with the resolve parameters of each option, reliability, status of the place, sources with titles and the notices a client has to show. Texts in `language`, each with its code. Always set by this API version; the other fields stay as they are"
          },
          "territory": {
            "type": "string",
            "enum": [
              "licensed",
              "baseline"
            ],
            "title": "Territory",
            "description": "licensed: the place lies in the territory of the key, the rules of its region apply. baseline: the place lies outside, the answer is the general rule for Germany and must be shown as such"
          }
        },
        "type": "object",
        "required": [
          "region",
          "status",
          "description",
          "confidence",
          "result",
          "territory"
        ],
        "title": "V1ScanResponse"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "WhyOut": {
        "properties": {
          "text": {
            "type": "string",
            "title": "Text"
          },
          "source": {
            "type": "string",
            "title": "Source",
            "description": "URL backing the explanation; not part of sources, no effect on trust"
          }
        },
        "type": "object",
        "required": [
          "text",
          "source"
        ],
        "title": "WhyOut"
      }
    },
    "securitySchemes": {
      "api_key": {
        "type": "http",
        "description": "API key (trk_...) from the customer's backend, or a token from POST /v1/token",
        "scheme": "bearer"
      }
    }
  }
}
