{"openapi":"3.0.3","info":{"title":"Haccly: sensor readings API","version":"1","description":"Integration API for temperature sensors: send readings from your own sensors (plan Pro, module \"Sensors (API)\"). Create the API key in Haccly under \"Czujniki\" (Owner) and send it as `Authorization: Bearer <key>`. Up to 500 readings a request, 120 requests a minute per key; `measuredAt` within the last 7 days, with a time zone offset."},"servers":[{"url":"/"}],"paths":{"/api/v1/sensor-readings":{"post":{"operationId":"haccly.sensors.v1.SensorsService.SendSensorReadings","tags":["sensors.v1"],"description":"Readings from the Client's system: `Authorization: Bearer <API key>`, no session. Up to 500 readings; each one\ngets its own status. The same sensor and measurement time is never stored twice. Errors: API_KEY_INVALID (401),\nSUBSCRIPTION_REQUIRED, ORGANIZATION_BLOCKED or MODULE_DISABLED (403, the organization has no Pro now),\nRATE_LIMITED (429).","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/haccly.sensors.v1.SendSensorReadingsRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/haccly.sensors.v1.SendSensorReadingsResponse"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[{"apiKey":[]}]}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"The API key of the organization (hk_...)."}},"schemas":{"Error":{"type":"object","description":"Error body returned by every endpoint on a non-2xx status.","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"array","items":{"type":"object"}}},"required":["code","message"]},"haccly.sensors.v1.ReadingResult":{"type":"object","properties":{"sensorId":{"type":"string"},"measuredAt":{"type":"string"},"status":{"$ref":"#/components/schemas/haccly.sensors.v1.ReadingStatus"}},"required":["sensorId","measuredAt","status"],"additionalProperties":false},"haccly.sensors.v1.ReadingStatus":{"type":"string","enum":["READING_STATUS_UNSPECIFIED","READING_STATUS_ACCEPTED","READING_STATUS_DUPLICATE","READING_STATUS_UNASSIGNED","READING_STATUS_TIME_OUT_OF_RANGE"]},"haccly.sensors.v1.SendSensorReadingsRequest":{"type":"object","properties":{"readings":{"type":"array","items":{"$ref":"#/components/schemas/haccly.sensors.v1.SensorReadingInput"}}},"required":["readings"],"additionalProperties":false},"haccly.sensors.v1.SendSensorReadingsResponse":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/haccly.sensors.v1.ReadingResult"},"description":"In the order of the request."},"accepted":{"type":"integer","format":"int32"},"duplicates":{"type":"integer","format":"int32"},"unassigned":{"type":"integer","format":"int32"},"rejected":{"type":"integer","format":"int32"}},"required":["results","accepted","duplicates","unassigned","rejected"],"additionalProperties":false},"haccly.sensors.v1.SensorReadingInput":{"type":"object","properties":{"sensorId":{"type":"string","description":"The sensor's id in the Client's system (e.g. a serial number), 1–100 characters."},"measuredAt":{"type":"string","description":"RFC 3339 with an offset: when it was measured. At most 7 days back and 5 minutes ahead."},"value":{"type":"number","description":"°C."}},"required":["sensorId","measuredAt","value"],"additionalProperties":false}}}}