{
  "openapi": "3.1.0",
  "info": {"title": "TennisDatum Customer Test API", "version": "1.0-test", "description": "Read-only access to approved provider-scoped tennis observations. Histories are partial; identities can overlap. Paid subscriber provisioning and streaming are not offered by this test release. Private test credential: 5,000 requests per UTC day."},
  "servers": [{"url": "https://api.tennisdatum.com"}],
  "security": [{"bearerAuth": []}],
  "components": {
    "securitySchemes": {"bearerAuth": {"type": "http", "scheme": "bearer"}},
    "schemas": {
      "MatchSummary": {"type": "object", "description": "A provider-scoped observation, not necessarily a globally distinct match.", "properties": {"id": {"type":"string"}, "tour":{"type":"string"}, "tournament":{"type":"string"}, "players":{"type":"array","items":{"type":"string"},"minItems":2,"maxItems":2}, "status":{"type":"string","enum":["scheduled","live","suspended","finished","retired","walkover","cancelled","stale"]}, "observed_at":{"type":"string","format":"date-time"}, "fresh_until":{"type":["string","null"],"format":"date-time"}, "stale":{"type":"boolean"}, "score":{"type":"object","description":"sets, sets_won, game_points and serving (0, 1 or null). Unknown values are null."}, "point_coverage":{"type":"string","enum":["none","partial"]}, "has_point_history":{"type":"boolean"}, "has_statistics":{"type":"boolean"}}},
      "Error": {"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}
    },
    "responses": {
      "BadQuery":{"description":"Invalid query or unsupported value","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},
      "Unauthorized":{"description":"Missing or invalid bearer key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},
      "NotFound":{"description":"Unknown endpoint or match"},
      "Quota":{"description":"Daily private-test quota exhausted"},
      "Unavailable":{"description":"Service or publication unavailable"}
    }
  },
  "paths": {
    "/health":{"get":{"security":[],"summary":"Public configuration and latest publication receipt","responses":{"200":{"description":"Configuration booleans, deployed release and latest publication metadata; no secrets."}}}},
    "/v1/tennis/matches":{"get":{"summary":"List recorded match observations","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"maximum":100000,"default":0}},{"name":"tour","in":"query","schema":{"type":"string","maxLength":200}},{"name":"status","in":"query","description":"Expired live observations are returned as stale, and excluded from status=live.","schema":{"type":"string","enum":["scheduled","live","suspended","finished","retired","walkover","cancelled","stale"]}}],"responses":{"200":{"description":"Paginated observations. X-RateLimit-Limit and X-RateLimit-Remaining are returned.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MatchSummary"}},"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"},"generated_at":{"type":"string","format":"date-time"},"identity_scope":{"type":"string"}}}}}},"400":{"$ref":"#/components/responses/BadQuery"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/Quota"},"503":{"$ref":"#/components/responses/Unavailable"}}}},
    "/v1/tennis/matches/{id}":{"get":{"summary":"Get one match with available history and statistics","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{1,80}$"}}],"responses":{"200":{"description":"Match fields plus point_history (partial recorded sets/games/point-score tokens or null) and statistics (period/side facts or null). Individual point times and winners are not implied."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/Quota"}}}},
    "/v1/tennis/matches/{id}/points":{"get":{"summary":"Get available partial recorded history","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"id, stale, coverage and data. data is partial history or null. History capture time is not an individual point timestamp."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/Quota"}}}},
    "/v1/tennis/matches/{id}/statistics":{"get":{"summary":"Get available mapped match statistics","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"id, stale, coverage and data. data is null or facts with field, period, side, unit, value/ratio/percentage and capture time. Values are not independently accuracy-certified."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/Quota"}}}},
    "/v1/tennis/coverage":{"get":{"summary":"Stored provider-scoped record counts by tour","responses":{"200":{"description":"data array of tour and record count, plus identity and coverage limitations. These counts are not worldwide distinct match totals."},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/Quota"}}}}
  }
}
