{
  "openapi": "3.1.0",
  "info": {
    "title": "SenFlote Maps — Places API",
    "version": "1.0.0",
    "summary": "The SenFlote Places registry: authenticated read/write for partner apps, and a credential-free public read + proposal surface.",
    "description": "Base path /v1. Every response uses the envelope {success, data, error, meta}. Authenticated routes take a Sanctum bearer token issued by the operator (`places:credential:issue`); the caller app comes from the credential, never from the request body. Tokens are read-only by default, expire after 90 days (`PLACES_PARTNER_TOKEN_TTL_DAYS`), and are limited per token to 300 requests/minute by default (`PLACES_PARTNER_RATE_LIMIT_PER_MINUTE`). The public surface (/v1/public/*) is the credential-free public tier and answers 404 as if absent unless enabled by the operator; it is not the partner API. Errors: 401 unauthenticated, 403 forbidden, 404 not_found (an invisible place is always 404, never 403), 422 validation_failed, 409 possible_duplicate/already_imported, 429 rate_limited."
  },
  "servers": [
    {
      "url": "https://maps.senflote.com",
      "description": "Production"
    },
    {
      "url": "http://127.0.0.1:8095",
      "description": "Local (never a substitute for production data)"
    }
  ],
  "tags": [
    {
      "name": "places",
      "description": "Authenticated registry (partner apps)"
    },
    {
      "name": "public",
      "description": "Credential-free public surface (off unless enabled)"
    }
  ],
  "paths": {
    "/v1/categories": {
      "get": {
        "tags": [
          "places"
        ],
        "operationId": "listCategories",
        "summary": "List categories",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The categories",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CategoryList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/places": {
      "get": {
        "tags": [
          "places"
        ],
        "operationId": "listPlaces",
        "summary": "List places visible to the caller",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 100
            },
            "description": "Accent- and case-insensitive name substring."
          },
          {
            "name": "category",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          },
          {
            "name": "bbox",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^-?\\d+(\\.\\d+)?,-?\\d+(\\.\\d+)?,-?\\d+(\\.\\d+)?,-?\\d+(\\.\\d+)?$"
            },
            "description": "Viewport filter: west,south,east,north in WGS84. Composes with the caller's visibility scope. The box is clamped to the Senegal/Gambia archive bounds; a box that does not overlap it returns an empty page. 422 on a malformed or inverted box."
          }
        ],
        "responses": {
          "200": {
            "description": "A page of places",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaceList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "tags": [
          "places"
        ],
        "operationId": "createPlace",
        "summary": "Create a place (write credential required)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "force",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "Create even when similar places exist nearby."
          },
          {
            "$ref": "#/components/parameters/ScopeHeader"
          },
          {
            "$ref": "#/components/parameters/SubjectHeader"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlaceInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaceEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "possible_duplicate or already_imported",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/places/nearby": {
      "get": {
        "tags": [
          "places"
        ],
        "operationId": "listPlacesNearby",
        "summary": "Places within a radius, nearest first",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "lat",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "lng",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "radius",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 5000
            },
            "description": "Metres; at most 5000."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Places in range",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaceList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/places/{publicId}": {
      "get": {
        "tags": [
          "places"
        ],
        "operationId": "getPlace",
        "summary": "A visible place by id",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/PublicId"
          }
        ],
        "responses": {
          "200": {
            "description": "The place",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaceEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "patch": {
        "tags": [
          "places"
        ],
        "operationId": "updatePlace",
        "summary": "Edit a place you own (write credential required)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/PublicId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlacePatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaceEnvelope"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/public/categories": {
      "get": {
        "tags": [
          "public"
        ],
        "operationId": "listPublicCategories",
        "summary": "List categories (no credential)",
        "security": [],
        "responses": {
          "200": {
            "description": "The categories; meta.contributions_enabled says whether proposals are open",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CategoryList"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/public/places": {
      "get": {
        "tags": [
          "public"
        ],
        "operationId": "listPublicPlaces",
        "summary": "List public published places (no credential)",
        "security": [],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "category",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 2100
            },
            "description": "One category key, or a comma-separated list of up to 20 (a place in any of them matches). Unknown keys match nothing. 422 above 20 keys."
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          },
          {
            "name": "bbox",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^-?\\d+(\\.\\d+)?,-?\\d+(\\.\\d+)?,-?\\d+(\\.\\d+)?,-?\\d+(\\.\\d+)?$"
            },
            "description": "Viewport filter: west,south,east,north in WGS84. The box is clamped to the Senegal/Gambia archive bounds; a box that does not overlap it returns an empty page. 422 on a malformed or inverted box."
          },
          {
            "name": "has",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "Comma-separated attribute keys the place must have: opening_hours, wheelchair, wifi, card, mobile_money, toilets, parking. A boolean key must be true; the others just present. All keys must match. 422 on an unknown key."
          },
          {
            "name": "verified",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "Only places a reviewer confirmed on site. Not a business verification."
          }
        ],
        "responses": {
          "200": {
            "description": "A page of public places",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicPlaceList"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        }
      }
    },
    "/v1/public/places/nearby": {
      "get": {
        "tags": [
          "public"
        ],
        "operationId": "listPublicPlacesNearby",
        "summary": "Public published places within a radius (no credential)",
        "security": [],
        "parameters": [
          {
            "name": "lat",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "lng",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "radius",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 5000
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Public places in range",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicPlaceList"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          }
        }
      }
    },
    "/v1/public/places/{publicId}": {
      "get": {
        "tags": [
          "public"
        ],
        "operationId": "getPublicPlace",
        "summary": "A public published place by id (no credential)",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/PublicId"
          }
        ],
        "responses": {
          "200": {
            "description": "The public place",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicPlaceEnvelope"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/public/places/{publicId}/meta": {
      "get": {
        "tags": [
          "public"
        ],
        "operationId": "getPublicPlaceMeta",
        "summary": "Provenance and public history of a public place (no credential)",
        "description": "Source, last update and up to ten public revisions. A revision exposes only its date, its origin and the names of the fields it changed: never the actor, the reason, the old value or the new value. reliability is null until P5 ships.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/PublicId"
          }
        ],
        "responses": {
          "200": {
            "description": "The public provenance",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicPlaceMetaEnvelope"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/v1/public/contributions": {
      "post": {
        "tags": [
          "public"
        ],
        "operationId": "proposeContribution",
        "summary": "Propose a new place or a correction (no credential; off unless enabled)",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContributionInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Accepted for review; nothing becomes public until a reviewer approves it",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContributionEnvelope"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/public/route": {
      "post": {
        "tags": [
          "public"
        ],
        "operationId": "publicRoute",
        "summary": "Route between two points (local-first Valhalla proxy; disabled unless configured)",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "from_lat",
                  "from_lng",
                  "to_lat",
                  "to_lng"
                ],
                "properties": {
                  "from_lat": {
                    "type": "number"
                  },
                  "from_lng": {
                    "type": "number"
                  },
                  "to_lat": {
                    "type": "number"
                  },
                  "to_lng": {
                    "type": "number"
                  },
                  "costing": {
                    "type": "string",
                    "enum": [
                      "auto",
                      "pedestrian",
                      "bicycle"
                    ],
                    "default": "auto"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Route summary and GeoJSON line",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RouteEnvelope"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "description": "Routing engine unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/public/reverse": {
      "get": {
        "tags": [
          "public"
        ],
        "operationId": "publicReverse",
        "summary": "Reverse geocode a visitor point (cached; disabled unless configured)",
        "security": [],
        "parameters": [
          {
            "name": "lat",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "lng",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Approximate textual address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReverseAddressEnvelope"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "description": "Geocoder unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/v1/public/geocode": {
      "get": {
        "tags": [
          "public"
        ],
        "operationId": "publicGeocode",
        "summary": "Forward geocode an address or landmark (cached; asked only when no place matches)",
        "security": [],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 120
            }
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "fr",
                "en",
                "ar"
              ],
              "default": "fr"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 5,
              "default": 3
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Up to five bounded hits, best first",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GeocodeHitList"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationFailed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "description": "Geocoder unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Sanctum token issued by the operator, with abilities places:read and/or places:write. Shown once; expires after 90 days by default; revocable per app. The public tier (/v1/public/*) does not use it."
      }
    },
    "parameters": {
      "PublicId": {
        "name": "publicId",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "pattern": "^plc_[0-9a-hjkmnp-tv-z]{26}$"
        }
      },
      "ScopeHeader": {
        "name": "X-Scope",
        "in": "header",
        "schema": {
          "type": "string"
        },
        "description": "The scope the credential asserts; app_private places with this owner_scope become visible."
      },
      "SubjectHeader": {
        "name": "X-Subject",
        "in": "header",
        "schema": {
          "type": "string"
        },
        "description": "An opaque per-user subject; personal places for this subject become visible."
      }
    },
    "responses": {
      "Unauthenticated": {
        "description": "Missing or invalid credential",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        }
      },
      "Forbidden": {
        "description": "The credential cannot do that",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        }
      },
      "NotFound": {
        "description": "Not found (an invisible place is 404, never 403)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        }
      },
      "ValidationFailed": {
        "description": "The request is invalid",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        }
      },
      "RateLimited": {
        "description": "Too many requests. Partner routes are limited per credential (300/min by default); the response carries X-RateLimit-* and Retry-After. error.code is rate_limited.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorEnvelope"
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "code",
          "message"
        ],
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "unauthenticated",
              "forbidden",
              "not_found",
              "validation_failed",
              "possible_duplicate",
              "already_imported",
              "rate_limited",
              "http_error",
              "routing_unavailable",
              "geocoding_unavailable",
              "address_not_found"
            ]
          },
          "message": {
            "type": "string"
          },
          "fields": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "candidates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Place"
            }
          }
        }
      },
      "ErrorEnvelope": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "const": false
          },
          "data": {
            "type": "null"
          },
          "error": {
            "$ref": "#/components/schemas/Error"
          },
          "meta": {
            "type": "object"
          }
        }
      },
      "Category": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "CategoryList": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Category"
            }
          },
          "error": {
            "type": "null"
          },
          "meta": {
            "type": "object",
            "properties": {
              "contributions_enabled": {
                "type": "boolean"
              }
            }
          }
        }
      },
      "Place": {
        "type": "object",
        "description": "A registry place. owner_scope and owner_subject appear only for the owning app.",
        "properties": {
          "public_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "category_key": {
            "type": "string"
          },
          "lat": {
            "type": "number"
          },
          "lng": {
            "type": "number"
          },
          "visibility": {
            "type": "string",
            "enum": [
              "public",
              "app_private",
              "personal"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "published"
            ]
          },
          "source": {
            "type": "string"
          },
          "source_ref": {
            "type": [
              "string",
              "null"
            ]
          },
          "license": {
            "type": "string"
          },
          "owner_scope": {
            "type": [
              "string",
              "null"
            ]
          },
          "owner_subject": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "PlaceEnvelope": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/Place"
          },
          "error": {
            "type": "null"
          },
          "meta": {
            "type": "object"
          }
        }
      },
      "PlaceList": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Place"
            }
          },
          "error": {
            "type": "null"
          },
          "meta": {
            "type": "object",
            "properties": {
              "total": {
                "type": "integer"
              },
              "page": {
                "type": "integer"
              },
              "limit": {
                "type": "integer"
              },
              "count": {
                "type": "integer"
              }
            }
          }
        }
      },
      "PublicPlace": {
        "type": "object",
        "description": "The public fields the credential-free surface exposes: the registry facts and the page presentation.",
        "required": [
          "public_id",
          "name",
          "category_key",
          "lat",
          "lng",
          "license",
          "attributes",
          "page",
          "verified"
        ],
        "properties": {
          "public_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "category_key": {
            "type": "string"
          },
          "lat": {
            "type": "number"
          },
          "lng": {
            "type": "number"
          },
          "license": {
            "type": "string"
          },
          "attributes": {
            "type": "object",
            "description": "Only the allowed keys; an object, empty when none are known. Never contact data.",
            "additionalProperties": false,
            "properties": {
              "opening_hours": {
                "type": "string",
                "maxLength": 255,
                "description": "OSM opening_hours syntax."
              },
              "wheelchair": {
                "type": "string",
                "enum": [
                  "yes",
                  "no",
                  "limited"
                ]
              },
              "wifi": {
                "type": "boolean"
              },
              "card": {
                "type": "boolean"
              },
              "mobile_money": {
                "type": "boolean"
              },
              "toilets": {
                "type": "boolean"
              },
              "parking": {
                "type": "boolean"
              }
            }
          },
          "verified": {
            "type": "boolean",
            "description": "A console reviewer confirmed the place on site. Never says who."
          },
          "page": {
            "type": "object",
            "description": "Operator-curated presentation. Always the full object; minimalist is the default.",
            "additionalProperties": false,
            "required": [
              "theme",
              "accent",
              "cover_url",
              "photos",
              "description",
              "social"
            ],
            "properties": {
              "theme": {
                "type": "string",
                "enum": [
                  "minimalist",
                  "editorial",
                  "practical",
                  "immersive"
                ],
                "description": "The place page layout. Minimalist reproduces the plain detail card."
              },
              "accent": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^#[0-9a-fA-F]{6}$",
                "description": "Optional accent colour; the page falls back to the theme accent."
              },
              "cover_url": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Optional https cover photo."
              },
              "photos": {
                "type": "array",
                "maxItems": 4,
                "items": {
                  "type": "string"
                },
                "description": "Optional https gallery photos, at most four."
              },
              "description": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 2000,
                "description": "A short operator-written description of the place."
              },
              "social": {
                "type": "object",
                "description": "Curated social links. Never a phone, e-mail or claim contact field.",
                "additionalProperties": false,
                "properties": {
                  "instagram": {
                    "type": "string"
                  },
                  "facebook": {
                    "type": "string"
                  },
                  "whatsapp": {
                    "type": "string"
                  },
                  "x": {
                    "type": "string"
                  },
                  "tiktok": {
                    "type": "string"
                  },
                  "youtube": {
                    "type": "string"
                  },
                  "linkedin": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      },
      "PublicPlaceEnvelope": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/PublicPlace"
          },
          "error": {
            "type": "null"
          },
          "meta": {
            "type": "object"
          }
        }
      },
      "PublicPlaceList": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicPlace"
            }
          },
          "error": {
            "type": "null"
          },
          "meta": {
            "type": "object",
            "properties": {
              "total": {
                "type": "integer"
              },
              "page": {
                "type": "integer"
              },
              "limit": {
                "type": "integer"
              },
              "count": {
                "type": "integer"
              }
            }
          }
        }
      },
      "PublicPlaceHistoryEntry": {
        "type": "object",
        "description": "One public revision. actor, reason, old value and new value are never present.",
        "required": [
          "at",
          "origin",
          "fields"
        ],
        "properties": {
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "origin": {
            "type": "string",
            "description": "The write path that made the change, e.g. bulk_publish, partner_api, admin_edit."
          },
          "fields": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Names of the fields that changed."
          }
        }
      },
      "PublicPlaceMeta": {
        "type": "object",
        "description": "Provenance of a public place. Never carries photos or contact data in v1.",
        "required": [
          "source",
          "updated_at",
          "history",
          "reliability"
        ],
        "properties": {
          "source": {
            "type": "string",
            "description": "The upstream source, e.g. osm."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "history": {
            "type": "array",
            "maxItems": 10,
            "items": {
              "$ref": "#/components/schemas/PublicPlaceHistoryEntry"
            }
          },
          "reliability": {
            "type": [
              "object",
              "null"
            ],
            "description": "Reserved for P5; null until reliability scoring ships."
          }
        }
      },
      "PublicPlaceMetaEnvelope": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/PublicPlaceMeta"
          },
          "error": {
            "type": "null"
          },
          "meta": {
            "type": "object"
          }
        }
      },
      "PlaceInput": {
        "type": "object",
        "required": [
          "name",
          "category_key",
          "lat",
          "lng",
          "source",
          "license"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "category_key": {
            "type": "string"
          },
          "lat": {
            "type": "number"
          },
          "lng": {
            "type": "number"
          },
          "visibility": {
            "type": "string",
            "enum": [
              "public",
              "app_private",
              "personal"
            ],
            "default": "public"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "published"
            ],
            "default": "draft"
          },
          "source": {
            "type": "string",
            "maxLength": 100
          },
          "source_ref": {
            "type": "string",
            "maxLength": 255
          },
          "license": {
            "type": "string",
            "maxLength": 100
          }
        }
      },
      "PlacePatch": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "category_key": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "published"
            ]
          },
          "lat": {
            "type": "number"
          },
          "lng": {
            "type": "number"
          }
        }
      },
      "ContributionInput": {
        "type": "object",
        "required": [
          "type"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "new_place",
              "correction"
            ]
          },
          "target": {
            "type": "string",
            "description": "public_id of a public published place; required for a correction."
          },
          "name": {
            "type": "string",
            "maxLength": 255
          },
          "category_key": {
            "type": "string"
          },
          "lat": {
            "type": "number"
          },
          "lng": {
            "type": "number"
          },
          "note": {
            "type": "string",
            "maxLength": 1000
          },
          "contact": {
            "type": "string",
            "maxLength": 255,
            "description": "Private to reviewers; never published."
          },
          "website": {
            "type": "string",
            "description": "Honeypot; leave empty."
          }
        }
      },
      "ContributionEnvelope": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "enum": [
                  "submitted"
                ]
              }
            }
          },
          "error": {
            "type": "null"
          },
          "meta": {
            "type": "object"
          }
        }
      },
      "Route": {
        "type": "object",
        "properties": {
          "distance_km": {
            "type": "number"
          },
          "duration_min": {
            "type": "integer"
          },
          "costing": {
            "type": "string",
            "enum": [
              "auto",
              "pedestrian",
              "bicycle"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "valhalla"
            ]
          },
          "geometry": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "LineString"
                ]
              },
              "coordinates": {
                "type": "array",
                "items": {
                  "type": "array",
                  "items": {
                    "type": "number"
                  }
                }
              }
            }
          }
        }
      },
      "RouteEnvelope": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/Route"
          },
          "error": {
            "type": "null"
          },
          "meta": {
            "type": "object"
          }
        }
      },
      "ReverseAddress": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string"
          },
          "source": {
            "type": "string",
            "enum": [
              "nominatim"
            ]
          },
          "confidence": {
            "type": "string",
            "enum": [
              "approximate"
            ]
          }
        }
      },
      "ReverseAddressEnvelope": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/ReverseAddress"
          },
          "error": {
            "type": "null"
          },
          "meta": {
            "type": "object"
          }
        }
      },
      "GeocodeHit": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string"
          },
          "lat": {
            "type": "number"
          },
          "lng": {
            "type": "number"
          },
          "type": {
            "type": "string",
            "description": "Nominatim place type, e.g. marketplace"
          },
          "bbox": {
            "type": "array",
            "items": {
              "type": "number"
            },
            "minItems": 4,
            "maxItems": 4,
            "nullable": true,
            "description": "[west, south, east, north]"
          }
        }
      },
      "GeocodeHitList": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GeocodeHit"
            }
          },
          "error": {
            "type": "null"
          },
          "meta": {
            "type": "object"
          }
        }
      }
    }
  }
}
