{
  "openapi": "3.1.0",
  "info": {
    "title": "BlueCap Drone Survey Estimate API",
    "version": "1.0.0",
    "description": "Anonymous, read-only indicative drone magnetic and LiDAR survey estimator. Results require BlueCap review and are not binding quotations."
  },
  "servers": [
    {
      "url": "https://bluecap.au"
    }
  ],
  "paths": {
    "/api/tools/survey-estimate": {
      "post": {
        "operationId": "estimateDroneSurvey",
        "summary": "Estimate drone magnetic or LiDAR survey cost and schedule",
        "description": "Calculates flight line-km, schedule and an indicative total for the selected mission region and display currency.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SurveyEstimateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Indicative estimate",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SurveyEstimateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Structured validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationError"
                }
              }
            }
          },
          "404": {
            "description": "Unavailable on this host"
          },
          "429": {
            "description": "Limit of 30 requests per minute or 300 per day exceeded"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "SurveyEstimateRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "area",
          "areaUnit",
          "lineSpacingMetres",
          "parallelDrones",
          "missionRegion",
          "displayCurrency"
        ],
        "properties": {
          "area": {
            "type": "number",
            "exclusiveMinimum": 0,
            "description": "Must also remain within the verified 15-flying-day schedule for the selected configuration."
          },
          "areaUnit": {
            "type": "string",
            "enum": [
              "km2",
              "ha"
            ]
          },
          "lineSpacingMetres": {
            "type": "integer",
            "enum": [
              25,
              50,
              100,
              180
            ]
          },
          "parallelDrones": {
            "type": "integer",
            "enum": [
              1,
              2,
              3
            ]
          },
          "missionRegion": {
            "type": "string",
            "enum": [
              "australia",
              "international"
            ]
          },
          "displayCurrency": {
            "type": "string",
            "enum": [
              "AUD",
              "USD",
              "CAD",
              "EUR",
              "CNY"
            ]
          }
        }
      },
      "SurveyEstimateResponse": {
        "type": "object",
        "required": [
          "status",
          "qualification",
          "currency",
          "displayCurrency",
          "serviceRegion",
          "inputs",
          "estimate",
          "exchangeRate",
          "model",
          "links",
          "conditions",
          "markdown"
        ],
        "properties": {
          "status": {
            "const": "indicative"
          },
          "qualification": {
            "const": "requires_review"
          },
          "currency": {
            "const": "AUD"
          },
          "displayCurrency": {
            "type": "string",
            "enum": [
              "AUD",
              "USD",
              "CAD",
              "EUR",
              "CNY"
            ]
          },
          "serviceRegion": {
            "type": "string"
          },
          "inputs": {
            "$ref": "#/components/schemas/SurveyEstimateRequest"
          },
          "estimate": {
            "type": "object"
          },
          "exchangeRate": {
            "type": "object"
          },
          "model": {
            "type": "object",
            "required": [
              "version",
              "pricingEffectiveAt"
            ]
          },
          "links": {
            "type": "object"
          },
          "conditions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "markdown": {
            "type": "string"
          }
        }
      },
      "ValidationError": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "integer"
          },
          "statusMessage": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "issues": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "field",
                    "code",
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    }
  }
}