{
  "openapi": "3.1.0",
  "info": {
    "title": "fast-surf overseas API",
    "version": "0.1.0"
  },
  "paths": {
    "/v1/surf/health": {
      "get": {
        "tags": [
          "fast-surf"
        ],
        "summary": "Health",
        "operationId": "health_v1_surf_health_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SurfHealth"
                }
              }
            }
          },
          "503": {
            "description": "Confirmed source or downstream functional failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SurfHealth"
                }
              }
            }
          }
        },
        "description": "Functional health uses cached authenticated HTTP, token, signed-download and source checks. Healthy APIs return 200: state=operational for fresh data, state=degraded for delayed data, with verification_state=passed. Failed source readiness or HTTP functionality returns 503 with state=unavailable. Initial or missing probe evidence returns 200 with state=unknown and verification_state=pending. No WebSocket probes are performed. Products are assessed independently. health_policy=functional-v1."
      }
    },
    "/v1/surf/auth/token": {
      "post": {
        "tags": [
          "fast-surf"
        ],
        "summary": "Token",
        "operationId": "token_v1_surf_auth_token_post",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/surf/batches": {
      "get": {
        "tags": [
          "fast-surf"
        ],
        "summary": "Batches",
        "operationId": "batches_v1_surf_batches_get",
        "parameters": [
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Start"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "End"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Before"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 100,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchPage"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/surf": {
      "get": {
        "tags": [
          "fast-surf"
        ],
        "summary": "Legacy",
        "operationId": "legacy_v1_surf_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "BatchInfo": {
        "properties": {
          "batch_start": {
            "type": "string",
            "format": "date-time",
            "title": "Batch Start"
          },
          "batch_end": {
            "type": "string",
            "format": "date-time",
            "title": "Batch End"
          },
          "revision": {
            "type": "integer",
            "title": "Revision"
          },
          "published_at": {
            "type": "string",
            "format": "date-time",
            "title": "Published At"
          },
          "latest_observation_at": {
            "type": "string",
            "format": "date-time",
            "title": "Latest Observation At"
          },
          "station_count": {
            "type": "integer",
            "title": "Station Count"
          },
          "expected_station_count": {
            "type": "integer",
            "title": "Expected Station Count"
          },
          "size_bytes": {
            "type": "integer",
            "title": "Size Bytes"
          },
          "md5": {
            "type": "string",
            "title": "Md5"
          },
          "download_url": {
            "type": "string",
            "title": "Download Url"
          },
          "download_expires_at": {
            "type": "string",
            "format": "date-time",
            "title": "Download Expires At"
          }
        },
        "type": "object",
        "required": [
          "batch_start",
          "batch_end",
          "revision",
          "published_at",
          "latest_observation_at",
          "station_count",
          "expected_station_count",
          "size_bytes",
          "md5",
          "download_url",
          "download_expires_at"
        ],
        "title": "BatchInfo"
      },
      "BatchPage": {
        "properties": {
          "start": {
            "type": "string",
            "format": "date-time",
            "title": "Start"
          },
          "end": {
            "type": "string",
            "format": "date-time",
            "title": "End"
          },
          "data": {
            "items": {
              "$ref": "#/components/schemas/BatchInfo"
            },
            "type": "array",
            "title": "Data"
          },
          "next_before": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Before"
          }
        },
        "type": "object",
        "required": [
          "start",
          "end",
          "data"
        ],
        "title": "BatchPage"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "SurfHealth": {
        "properties": {
          "service": {
            "const": "surf",
            "default": "surf",
            "title": "Service",
            "type": "string"
          },
          "state": {
            "default": "unavailable",
            "enum": [
              "operational",
              "degraded",
              "unavailable",
              "unknown"
            ],
            "title": "State",
            "type": "string"
          },
          "checked_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Checked At"
          },
          "health_policy": {
            "const": "functional-v1",
            "default": "functional-v1",
            "title": "Health Policy",
            "type": "string"
          },
          "verification_state": {
            "default": "pending",
            "enum": [
              "passed",
              "failed",
              "pending"
            ],
            "title": "Verification State",
            "type": "string"
          },
          "ready": {
            "title": "Ready",
            "type": "boolean"
          },
          "delivery_ready": {
            "default": false,
            "title": "Delivery Ready",
            "type": "boolean"
          },
          "source_checks": {
            "additionalProperties": true,
            "default": {},
            "title": "Source Checks",
            "type": "object"
          },
          "functional_checks": {
            "additionalProperties": true,
            "default": {},
            "title": "Functional Checks",
            "type": "object"
          },
          "latest_observation_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Latest Observation At"
          },
          "last_batch_published_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Last Batch Published At"
          },
          "configured": {
            "default": false,
            "title": "Configured",
            "type": "boolean"
          },
          "collector": {
            "additionalProperties": true,
            "default": {},
            "title": "Collector",
            "type": "object"
          },
          "publisher": {
            "additionalProperties": true,
            "default": {},
            "title": "Publisher",
            "type": "object"
          },
          "cleanup": {
            "additionalProperties": true,
            "default": {},
            "title": "Cleanup",
            "type": "object"
          },
          "history_start": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "History Start"
          },
          "latest_batch_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Latest Batch At"
          },
          "last_observation_received_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Last Observation Received At"
          },
          "available_batches": {
            "default": 0,
            "title": "Available Batches",
            "type": "integer"
          },
          "pending_batches": {
            "default": 0,
            "title": "Pending Batches",
            "type": "integer"
          },
          "coverage_gaps": {
            "default": [],
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Coverage Gaps",
            "type": "array"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Error"
          },
          "data_fresh": {
            "type": "boolean",
            "default": false,
            "title": "Data Fresh"
          }
        },
        "required": [
          "ready"
        ],
        "title": "SurfHealth",
        "type": "object"
      },
      "TokenResponse": {
        "properties": {
          "token": {
            "type": "string",
            "title": "Token"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "title": "Expires At"
          }
        },
        "type": "object",
        "required": [
          "token",
          "expires_at"
        ],
        "title": "TokenResponse"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      }
    }
  }
}
