{"openapi": "3.0.3", "info": {"title": "Mallport Farm workspace API", "version": "1.0.0", "description": "Farm operational data: parcels (with boundary lineage), crops, soil, irrigation, livestock, telemetry readings. Export schema_version 4. Summary/export/telemetry ingest and DRF write documented in spec.json; not a statutory cadastral or full FMIS product."}, "servers": [{"url": "https://mallport.co.uk/farm-workspace/api/v1/"}], "paths": {"summary/": {"get": {"operationId": "farmWorkspaceSummary", "summary": "Counts and fingerprint", "description": "Authenticate with a logged-in browser session (same-origin cookie) as the farmer user, or send Authorization: Bearer mpfw.<uuid>.<secret> or X-Farm-Workspace-Key with summary scope.", "security": [{"FarmWorkspaceBearer": []}, {"FarmWorkspaceHeader": []}, {}], "responses": {"200": {"description": "JSON with schema farm_workspace.v1.summary", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true}}}}, "401": {"description": "Missing or invalid auth"}, "403": {"description": "No farmer profile or wrong scope"}, "429": {"description": "API key rate limited"}}}}, "export/": {"get": {"operationId": "farmWorkspaceExport", "summary": "Full workspace JSON export", "description": "Bearer or X-Farm-Workspace-Key only; scope must include export.", "security": [{"FarmWorkspaceBearer": []}, {"FarmWorkspaceHeader": []}], "responses": {"200": {"description": "Compact JSON; schema_version 4", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true}}}}, "401": {"description": "Missing or invalid token"}, "403": {"description": "Insufficient scope"}, "429": {"description": "Rate limited"}}}}, "telemetry/ingest/": {"post": {"operationId": "farmWorkspaceTelemetryIngest", "summary": "Ingest sensor / telematics readings", "description": "JSON body: single object or {\"readings\": [...]}. Each item needs source_label, optional recorded_at (ISO 8601), optional external_device_id, payload object. Scopes: telemetry_write or workspace_write.", "security": [{"FarmWorkspaceBearer": []}, {"FarmWorkspaceHeader": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true}}}}, "responses": {"200": {"description": "created_reading_ids, count"}, "400": {"description": "Validation error"}, "401": {"description": "Unauthorized"}, "403": {"description": "Scope or no farmer profile"}, "429": {"description": "Rate limited"}}}}, "spec.json": {"get": {"operationId": "farmWorkspaceSpec", "summary": "Human-oriented endpoint map", "security": [], "responses": {"200": {"description": "Discovery JSON"}}}}, "openapi.json": {"get": {"operationId": "farmWorkspaceOpenapi", "summary": "This OpenAPI document", "security": [], "responses": {"200": {"description": "OpenAPI 3.0 JSON"}}}}}, "components": {"securitySchemes": {"FarmWorkspaceBearer": {"type": "http", "scheme": "bearer", "bearerFormat": "mpfw.<uuid>.<secret>", "description": "Token from manage.py create_farm_workspace_api_key (shown once)."}, "FarmWorkspaceHeader": {"type": "apiKey", "in": "header", "name": "X-Farm-Workspace-Key"}}}, "externalDocs": {"description": "Browser exports and delete-all", "url": "https://mallport.co.uk/farm-workspace/"}, "x-mallport": {"export_schema_version": 4, "drf_write_root_relative": "write/", "browser_export_json": "https://mallport.co.uk/farm-workspace/export.json", "browser_export_csv_zip": "https://mallport.co.uk/farm-workspace/export.zip", "example_summary_url": "https://mallport.co.uk/farm-workspace/api/v1/summary/", "example_export_url": "https://mallport.co.uk/farm-workspace/api/v1/export/", "legacy_spec_url": "https://mallport.co.uk/farm-workspace/api/v1/spec.json", "openapi_self_url": "https://mallport.co.uk/farm-workspace/api/v1/openapi.json"}}