{
  "openapi": "3.1.0",
  "info": {
    "title": "Vindur Public API",
    "version": "1.0.0",
    "description": "Public, keyless API for discovering Vindur quiet nature sanctuaries, silence ratings, coordinates and canonical spot URLs. Includes rate-limit headers, typed JSON errors, cursor-friendly pagination, SSE streaming, batch reads, sandbox endpoints and Idempotency-Key guidance.",
    "contact": {
      "name": "Vindur",
      "url": "https://vindur.app/iletisim",
      "email": "hello@vindur.app"
    },
    "x-rateLimitPolicy": "120 requests per minute. On 429, retry with exponential backoff starting at 2 seconds.",
    "x-versioning": "Current stable API version is v1. Versioned aliases are available under /api/v1/* while unversioned endpoints remain canonical."
  },
  "servers": [
    {
      "url": "https://vindur.app",
      "description": "Production"
    }
  ],
  "security": [],
  "paths": {
    "/api/health": {
      "get": {
        "operationId": "getHealth",
        "summary": "Check API availability",
        "responses": {
          "200": {
            "description": "Service health",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Health"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-retry-policy": "For 429 or transient 5xx responses, retry with exponential backoff starting at 2 seconds and cap at 3 attempts."
      }
    },
    "/api/spots": {
      "get": {
        "operationId": "listSpots",
        "summary": "List public quiet nature sanctuaries",
        "description": "Returns public Vindur sanctuary summaries. No API key or OAuth token is required.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "description": "Search text such as orman, sahil, gölet, kamp or picnic.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tag",
            "in": "query",
            "description": "Optional tag filter.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "minRating",
            "in": "query",
            "description": "Minimum silence rating from 1 to 5.",
            "schema": {
              "type": "number",
              "minimum": 1,
              "maximum": 5
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of records to return.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpotList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-retry-policy": "For 429 or transient 5xx responses, retry with exponential backoff starting at 2 seconds and cap at 3 attempts."
      }
    },
    "/api/spots/{id}": {
      "get": {
        "operationId": "getSpot",
        "summary": "Get one public sanctuary",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Spot id or slug.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One public sanctuary",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "const": "spot"
                    },
                    "data": {
                      "$ref": "#/components/schemas/Spot"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-retry-policy": "For 429 or transient 5xx responses, retry with exponential backoff starting at 2 seconds and cap at 3 attempts."
      }
    },
    "/api/search": {
      "get": {
        "operationId": "searchSpots",
        "summary": "Search public sanctuaries",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Search results",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpotList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-retry-policy": "For 429 or transient 5xx responses, retry with exponential backoff starting at 2 seconds and cap at 3 attempts."
      }
    },
    "/api/ask": {
      "get": {
        "operationId": "askVindur",
        "summary": "Ask a lightweight NLWeb-compatible question",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Grounded answer with sources",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AskResponse"
                }
              }
            }
          }
        },
        "x-retry-policy": "For 429 or transient 5xx responses, retry with exponential backoff starting at 2 seconds and cap at 3 attempts."
      },
      "post": {
        "operationId": "askVindurPost",
        "summary": "Ask a lightweight NLWeb-compatible question",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "query": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Grounded answer with sources",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AskResponse"
                }
              }
            }
          }
        },
        "x-retry-policy": "For 429 or transient 5xx responses, retry with exponential backoff starting at 2 seconds and cap at 3 attempts."
      }
    },
    "/ask": {
      "get": {
        "operationId": "askVindurRoot",
        "summary": "Ask a lightweight NLWeb-compatible question at the root /ask path",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "stream",
            "in": "query",
            "description": "Set true to receive Server-Sent Events.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Grounded answer with sources",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AskResponse"
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string",
                  "description": "SSE stream with metadata, answer, sources and done events."
                }
              }
            }
          }
        },
        "x-retry-policy": "For 429 or transient 5xx responses, retry with exponential backoff starting at 2 seconds and cap at 3 attempts."
      },
      "post": {
        "operationId": "askVindurRootPost",
        "summary": "Ask a lightweight NLWeb-compatible question",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "query": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Grounded answer with sources",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AskResponse"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "x-retry-policy": "For 429 or transient 5xx responses, retry with exponential backoff starting at 2 seconds and cap at 3 attempts."
      }
    },
    "/api/batch": {
      "post": {
        "operationId": "batchVindurReads",
        "summary": "Run up to 10 public read operations in one request",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-retry-policy": "For 429 or transient 5xx responses, retry with exponential backoff starting at 2 seconds and cap at 3 attempts."
      }
    },
    "/api/jobs/{id}": {
      "get": {
        "operationId": "getJob",
        "summary": "Read async job status for agent recovery pattern documentation",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "x-retry-policy": "For 429 or transient 5xx responses, retry with exponential backoff starting at 2 seconds and cap at 3 attempts."
      }
    },
    "/api/sandbox/spots": {
      "get": {
        "operationId": "listSandboxSpots",
        "summary": "Sandbox list endpoint with the same public schema",
        "description": "Returns public Vindur sanctuary summaries. No API key or OAuth token is required.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "description": "Search text such as orman, sahil, gölet, kamp or picnic.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tag",
            "in": "query",
            "description": "Optional tag filter.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "minRating",
            "in": "query",
            "description": "Minimum silence rating from 1 to 5.",
            "schema": {
              "type": "number",
              "minimum": 1,
              "maximum": 5
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of records to return.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpotList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-retry-policy": "For 429 or transient 5xx responses, retry with exponential backoff starting at 2 seconds and cap at 3 attempts."
      }
    },
    "/api/v1/spots": {
      "get": {
        "operationId": "listSpotsV1",
        "summary": "List public quiet nature sanctuaries",
        "description": "Returns public Vindur sanctuary summaries. No API key or OAuth token is required.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "description": "Search text such as orman, sahil, gölet, kamp or picnic.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tag",
            "in": "query",
            "description": "Optional tag filter.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "minRating",
            "in": "query",
            "description": "Minimum silence rating from 1 to 5.",
            "schema": {
              "type": "number",
              "minimum": 1,
              "maximum": 5
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Maximum number of records to return.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpotList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-retry-policy": "For 429 or transient 5xx responses, retry with exponential backoff starting at 2 seconds and cap at 3 attempts."
      }
    },
    "/api/v1/search": {
      "get": {
        "operationId": "searchSpotsV1",
        "summary": "Search public sanctuaries",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Search results",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpotList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-retry-policy": "For 429 or transient 5xx responses, retry with exponential backoff starting at 2 seconds and cap at 3 attempts."
      }
    },
    "/api/webhooks": {
      "get": {
        "operationId": "getWebhookCapability",
        "summary": "Read documented webhook capability and signature verification details",
        "responses": {
          "200": {
            "description": "Successful response",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "x-retry-policy": "For 429 or transient 5xx responses, retry with exponential backoff starting at 2 seconds and cap at 3 attempts."
      }
    }
  },
  "components": {
    "responses": {
      "MethodNotAllowed": {
        "description": "Method not allowed",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "NotFound": {
        "description": "Resource not found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "RateLimited": {
        "description": "Rate limited. Retry with exponential backoff.",
        "headers": {
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/X-RateLimit-Limit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/X-RateLimit-Remaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/X-RateLimit-Reset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "BadRequest": {
        "description": "Bad request",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "Health": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "service": {
            "type": "string"
          },
          "docs": {
            "type": "string",
            "format": "uri"
          },
          "openapi": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "SpotList": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Spot"
            }
          },
          "meta": {
            "type": "object",
            "properties": {
              "totalReturned": {
                "type": "integer"
              },
              "totalAvailable": {
                "type": "integer"
              },
              "nextCursor": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "source": {
                "type": "string"
              },
              "canonicalDocs": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      },
      "Spot": {
        "type": "object",
        "required": [
          "id",
          "name",
          "url",
          "latitude",
          "longitude",
          "silenceRating"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "description": {
            "type": "string"
          },
          "latitude": {
            "type": "number"
          },
          "longitude": {
            "type": "number"
          },
          "coordinates": {
            "type": "object",
            "properties": {
              "latitude": {
                "type": "number"
              },
              "longitude": {
                "type": "number"
              }
            }
          },
          "mapsUrl": {
            "type": "string",
            "format": "uri"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "activities": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "accessStatus": {
            "type": "string",
            "enum": [
              "free",
              "paid"
            ]
          },
          "fireStatus": {
            "type": [
              "string",
              "null"
            ]
          },
          "sceneryType": {
            "type": [
              "string",
              "null"
            ]
          },
          "transportation": {
            "type": [
              "string",
              "null"
            ]
          },
          "silenceRating": {
            "type": "number",
            "minimum": 1,
            "maximum": 5
          },
          "commentsCount": {
            "type": "integer"
          }
        }
      },
      "AskResponse": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string"
          },
          "answer": {
            "type": "string"
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string",
                  "format": "uri"
                },
                "apiUrl": {
                  "type": "string",
                  "format": "uri"
                }
              }
            }
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "docs": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      },
      "BatchRequest": {
        "type": "object",
        "required": [
          "operations"
        ],
        "properties": {
          "operations": {
            "type": "array",
            "maxItems": 10,
            "items": {
              "type": "object",
              "required": [
                "path"
              ],
              "properties": {
                "path": {
                  "type": "string"
                },
                "query": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      },
      "BatchResponse": {
        "type": "object",
        "properties": {
          "object": {
            "const": "batch_result"
          },
          "results": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "index": {
                  "type": "integer"
                },
                "status": {
                  "type": "integer"
                },
                "body": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "meta": {
            "type": "object"
          }
        }
      },
      "Job": {
        "type": "object",
        "properties": {
          "object": {
            "const": "job"
          },
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "completedAt": {
            "type": "string"
          },
          "result": {
            "type": "object"
          }
        }
      }
    },
    "parameters": {
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": false,
        "description": "Optional idempotency key for POST requests. Public read responses are deterministic and safe to retry.",
        "schema": {
          "type": "string",
          "maxLength": 128
        }
      },
      "Cursor": {
        "name": "cursor",
        "in": "query",
        "required": false,
        "description": "Opaque cursor for forward pagination. If omitted, returns the first page.",
        "schema": {
          "type": "string"
        }
      }
    },
    "headers": {
      "X-RateLimit-Limit": {
        "description": "Maximum public API requests per minute.",
        "schema": {
          "type": "string"
        }
      },
      "X-RateLimit-Remaining": {
        "description": "Remaining requests in the current window.",
        "schema": {
          "type": "string"
        }
      },
      "X-RateLimit-Reset": {
        "description": "Unix timestamp when the current window resets.",
        "schema": {
          "type": "string"
        }
      },
      "X-Request-Id": {
        "description": "Request identifier for debugging and agent recovery.",
        "schema": {
          "type": "string"
        }
      }
    }
  }
}
