openapi: 3.0.3 info: title: AgriTwin Platform API & Telemetry Contracts version: 0.1.0 description: Official OpenAPI contracts for plots, sensors, time-series telemetry, analysis results, and growth visual states. paths: /api/health: get: summary: Service Health Check responses: '200': description: Service is healthy /api/plots: get: summary: List accessible plots responses: '200': description: List of plots post: summary: Create new plot responses: '201': description: Plot created /api/plots/{id}: get: summary: Get plot by ID parameters: - name: id in: path required: true schema: type: string responses: '200': description: Plot details /api/plots/{id}/growth-state: get: summary: Get current computed GrowthVisualState for plot crop parameters: - name: id in: path required: true schema: type: string responses: '200': description: Computed growth visual state (or null if no data) /api/ingest/reading: post: summary: Fallback REST endpoint for sensor readings requestBody: required: true content: application/json: schema: type: object required: [plot_id, sensor_id, ts, value, unit] properties: plot_id: { type: string } sensor_id: { type: string } ts: { type: string, format: date-time } value: { type: number } unit: { type: string } quality: { type: string, enum: [GOOD, SUSPECT, MISSING] } responses: '201': description: Reading ingested into TimescaleDB