basePath: /api/v1 definitions: airquality.AirQuality: properties: aqi: type: integer heat_index: type: number humidity: type: number pm1_0: type: number pm2_5: type: number pm10_0: type: number temperature: type: number type: object airquality.CurrentAirQuality: properties: aqi: type: integer heat_index: type: number humidity: type: number last_seen: type: string location: $ref: '#/definitions/airquality.Location' pm1_0: type: number pm2_5: type: number pm10_0: type: number sample_count: example: 6 type: integer status: example: online type: string temperature: type: number type: object airquality.CurrentResponse: properties: data: $ref: '#/definitions/airquality.CurrentAirQuality' type: object airquality.CustomRangeResponse: properties: data: items: $ref: '#/definitions/airquality.DataPoint' type: array type: object airquality.DataPoint: properties: label: type: string metrics: $ref: '#/definitions/airquality.AirQuality' timestamp: type: string type: object airquality.HistoricalResponse: properties: data: items: $ref: '#/definitions/airquality.DataPoint' type: array timeline: example: daily type: string type: object airquality.Location: properties: lat: example: 24.8607 type: number lon: example: 67.0011 type: number provider: example: mobile type: string timestamp: type: string type: object airquality.PublicMapDevice: properties: aqi: type: integer id: type: string is_outdoor: type: boolean lat: type: number lon: type: number measured_at: type: string name: type: string pm2_5: type: number status: type: string temperature: type: number type: object airquality.PublicMapResponse: properties: data: items: $ref: '#/definitions/airquality.PublicMapDevice' type: array type: object device.CreateDeviceRequest: properties: is_location_public: example: false type: boolean is_outdoor: example: false type: boolean is_public: example: false type: boolean name: example: Living Room Sensor maxLength: 100 type: string required: - name type: object device.CreateDeviceResponse: properties: data: $ref: '#/definitions/device.CreatedDevice' type: object device.CreatedDevice: properties: created_at: type: string device_id: example: dev_9f1c8a3b4d2e4f0a5b6c7d8e9f001122 type: string device_key: example: sk_1a2b3c4d5e6f...store this now, it won't be shown again type: string id: type: string is_location_public: example: false type: boolean is_outdoor: example: false type: boolean is_public: example: false type: boolean name: example: Living Room Sensor type: string updated_at: type: string type: object device.Device: properties: created_at: type: string device_id: example: dev_9f1c8a3b4d2e4f0a5b6c7d8e9f001122 type: string firmware_version: description: FirmwareVersion is the version the device last reported; null until it reports one. example: 0.1.0 type: string id: type: string is_location_public: example: false type: boolean is_outdoor: example: false type: boolean is_public: example: false type: boolean name: example: Living Room Sensor type: string ota: allOf: - $ref: '#/definitions/device.OtaSummary' description: Ota summarizes the device's firmware-update state in listings; null when unknown. updated_at: type: string type: object device.ListDevicesResponse: properties: data: items: $ref: '#/definitions/device.Device' type: array type: object device.ListPublicDevicesResponse: properties: data: items: $ref: '#/definitions/device.PublicDevice' type: array type: object device.OtaSummary: properties: progress: example: 40 type: integer status: description: |- Status is one of: up_to_date, update_available, approved, downloading, installing, failed. enum: - up_to_date - update_available - approved - downloading - installing - failed example: update_available type: string version: description: Version is the release the status refers to (the available or in-progress one). example: 0.2.0 type: string type: object device.PublicDevice: properties: created_at: type: string id: type: string is_outdoor: type: boolean is_public: type: boolean name: type: string updated_at: type: string type: object device.PublicDeviceResponse: properties: data: $ref: '#/definitions/device.PublicDevice' type: object device.RotateKeyResponse: properties: data: $ref: '#/definitions/device.CreatedDevice' type: object device.UpdateDeviceRequest: properties: is_location_public: type: boolean is_outdoor: type: boolean is_public: type: boolean name: example: Balcony Sensor maxLength: 100 minLength: 1 type: string type: object device.UpdateDeviceResponse: properties: data: $ref: '#/definitions/device.Device' type: object devicelog.Entry: properties: boot_count: example: 12 minimum: 0 type: integer level: enum: - debug - info - warn - error example: warn type: string message: example: 'reconnect failed: timeout' maxLength: 256 type: string tag: example: wifi maxLength: 32 type: string ts: description: Ts is the device's Unix time in seconds, omitted until its clock is synced. example: 1793700000 type: integer uptime_ms: example: 183000 minimum: 0 type: integer required: - boot_count - level - message - uptime_ms type: object devicelog.ListResponse: properties: data: items: $ref: '#/definitions/devicelog.Log' type: array next_before: description: NextBefore is the cursor for the next (older) page, or null at the end. type: integer type: object devicelog.Log: properties: boot_count: type: integer created_at: type: string device_ts: type: string id: type: integer level: example: warn type: string message: type: string tag: example: wifi type: string uptime_ms: type: integer type: object devicelog.UploadRequest: properties: dropped: description: Dropped counts entries the device discarded because its buffer was full. example: 0 minimum: 0 type: integer entries: items: $ref: '#/definitions/devicelog.Entry' maxItems: 50 type: array type: object devicelog.UploadResponse: properties: data: $ref: '#/definitions/devicelog.UploadResult' type: object devicelog.UploadResult: properties: accepted: example: 12 type: integer type: object devicereading.Location: properties: lat: example: 24.8607 maximum: 90 minimum: -90 type: number lon: example: 67.0011 maximum: 180 minimum: -180 type: number provider: example: mobile maxLength: 50 type: string required: - lat - lon - provider type: object devicereading.PMSData: properties: pm1_0: example: 5.2 minimum: 0 type: number pm2_5: example: 12.1 minimum: 0 type: number pm10_0: example: 18.3 minimum: 0 type: number provider: example: pms5003 maxLength: 50 type: string required: - pm10_0 - pm1_0 - pm2_5 - provider type: object devicereading.TemperatureData: properties: heat_index: example: 36.8 type: number humidity: example: 64.5 maximum: 100 minimum: 0 type: number provider: example: dht22 maxLength: 50 type: string temperature: example: 31.2 type: number required: - heat_index - humidity - provider - temperature type: object devicereading.UploadRequest: properties: aqi: example: 57 minimum: 0 type: integer location: allOf: - $ref: '#/definitions/devicereading.Location' description: 'Location is optional: the device may have no paired mobile at upload time.' pms_data: $ref: '#/definitions/devicereading.PMSData' temperature_data: $ref: '#/definitions/devicereading.TemperatureData' required: - aqi - pms_data - temperature_data type: object devicereading.UploadResponse: properties: data: $ref: '#/definitions/devicereading.UploadedReading' type: object devicereading.UploadedReading: properties: created_at: type: string id: type: integer type: object firmware.ApproveRequest: properties: release_id: type: string required: - release_id type: object firmware.DeviceJob: properties: job_id: type: string sha256: type: string size: type: integer status: enum: - approved - downloading - installing example: approved type: string url: type: string version: example: 0.2.0 type: string type: object firmware.DeviceJobResponse: properties: data: $ref: '#/definitions/firmware.DeviceJob' type: object firmware.DeviceOta: properties: available: allOf: - $ref: '#/definitions/firmware.Release' description: Available is the newest release newer than CurrentVersion, if any. current_version: description: |- CurrentVersion is the firmware the device last reported; null if it never did (firmware that predates OTA support). example: 0.1.0 type: string job: allOf: - $ref: '#/definitions/firmware.Job' description: Job is the most recent update job of the device, if any. type: object firmware.DeviceOtaResponse: properties: data: $ref: '#/definitions/firmware.DeviceOta' type: object firmware.Job: properties: approved_at: type: string error: type: string id: type: string progress: example: 40 type: integer release_id: type: string status: enum: - approved - downloading - installing - succeeded - failed - cancelled example: downloading type: string updated_at: type: string version: example: 0.2.0 type: string type: object firmware.JobResponse: properties: data: $ref: '#/definitions/firmware.Job' type: object firmware.PublishReleaseRequest: properties: notes: example: Adds secure BLE pairing. maxLength: 4000 type: string sha256: example: 53ff9481b8ea2e8ec2c9533432c1e66df99c68a0a9e3079dc455547b13d39346 type: string size: example: 1600800 type: integer url: example: https://github.com/open-aiq/aqs-device/releases/download/v0.2.0/device_rust.bin maxLength: 2048 type: string version: example: 0.2.0 maxLength: 32 type: string required: - sha256 - size - url - version type: object firmware.Release: properties: created_at: type: string id: type: string notes: type: string sha256: type: string size: example: 1600800 type: integer url: type: string version: example: 0.2.0 type: string type: object firmware.ReleaseResponse: properties: data: $ref: '#/definitions/firmware.Release' type: object firmware.StatusReportRequest: properties: error: maxLength: 500 type: string job_id: type: string progress: example: 40 maximum: 100 minimum: 0 type: integer status: enum: - downloading - installing - succeeded - failed example: downloading type: string version: description: Version is the firmware version currently running on the device. example: 0.1.0 maxLength: 32 type: string required: - job_id - status - version type: object problem.Problem: properties: detail: example: One or more request values are invalid. type: string errors: items: $ref: '#/definitions/problem.Violation' type: array instance: example: /api/v1/devices type: string status: example: 422 type: integer title: example: Request validation failed type: string type: example: https://docs.air-iq.net/reference/errors/#validation-error type: string type: object problem.Violation: properties: code: example: required type: string detail: example: name is required type: string in: enum: - body - query - path example: body type: string name: example: name type: string type: object host: localhost:8080 info: contact: {} description: Air quality monitoring API title: Air Quality API version: "1.0" paths: /account: delete: description: Permanently deletes every device you own, with its readings, logs and firmware update history, then your sign-in account. If it fails partway, calling it again finishes the job. produces: - application/json responses: "204": description: No Content "401": description: Unauthorized schema: $ref: '#/definitions/problem.Problem' "422": description: Unprocessable Entity schema: $ref: '#/definitions/problem.Problem' "500": description: Internal Server Error schema: $ref: '#/definitions/problem.Problem' security: - BearerAuth: [] summary: Delete your account tags: - Account /air-quality/current: get: description: Returns sensor metrics averaged over the last hour, the device status (offline when nothing was received for 20 minutes), the last_seen timestamp, and the latest known location. 404 only when the device has never reported. produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/airquality.CurrentResponse' "401": description: Unauthorized schema: $ref: '#/definitions/problem.Problem' "404": description: Not Found schema: $ref: '#/definitions/problem.Problem' "422": description: Unprocessable Entity schema: $ref: '#/definitions/problem.Problem' "500": description: Internal Server Error schema: $ref: '#/definitions/problem.Problem' security: - BearerAuth: [] summary: Get current air quality tags: - Air Quality /air-quality/custom: get: description: Returns air quality data points between start_date and end_date parameters: - description: Start date (YYYY-MM-DD) in: query name: start_date required: true type: string - description: End date (YYYY-MM-DD) in: query name: end_date required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/airquality.CustomRangeResponse' "401": description: Unauthorized schema: $ref: '#/definitions/problem.Problem' "422": description: Unprocessable Entity schema: $ref: '#/definitions/problem.Problem' "500": description: Internal Server Error schema: $ref: '#/definitions/problem.Problem' security: - BearerAuth: [] summary: Get air quality data for a custom date range tags: - Air Quality /air-quality/historical: get: description: Returns historical air quality data aggregated by timeline parameters: - description: Timeline enum: - daily - weekly - monthly - yearly in: query name: timeline required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/airquality.HistoricalResponse' "401": description: Unauthorized schema: $ref: '#/definitions/problem.Problem' "422": description: Unprocessable Entity schema: $ref: '#/definitions/problem.Problem' "500": description: Internal Server Error schema: $ref: '#/definitions/problem.Problem' security: - BearerAuth: [] summary: Get historical air quality data tags: - Air Quality /data: post: consumes: - application/json description: Stores one full sensor reading (particulate matter, AQI, temperature, optional location). The device authenticates with its X-Device-ID and X-Device-Key headers. parameters: - description: Public device id (dev_...) in: header name: X-Device-ID required: true type: string - description: Secret device key (sk_...) in: header name: X-Device-Key required: true type: string - description: Firmware version running on the device, e.g. 0.2.0 in: header name: X-Firmware-Version type: string - description: Sensor reading in: body name: request required: true schema: $ref: '#/definitions/devicereading.UploadRequest' produces: - application/json responses: "201": description: Created schema: $ref: '#/definitions/devicereading.UploadResponse' "400": description: Bad Request schema: $ref: '#/definitions/problem.Problem' "401": description: Unauthorized schema: $ref: '#/definitions/problem.Problem' "413": description: Request Entity Too Large schema: $ref: '#/definitions/problem.Problem' "415": description: Unsupported Media Type schema: $ref: '#/definitions/problem.Problem' "422": description: Unprocessable Entity schema: $ref: '#/definitions/problem.Problem' "500": description: Internal Server Error schema: $ref: '#/definitions/problem.Problem' summary: Upload a sensor reading tags: - Device Data /device/logs: post: consumes: - application/json description: Stores up to 50 important log entries (warnings, errors, boot, WiFi, OTA events) from the calling device. Limited to 20 uploads per device per hour. parameters: - description: Public device id (dev_...) in: header name: X-Device-ID required: true type: string - description: Secret device key (sk_...) in: header name: X-Device-Key required: true type: string - description: Log batch in: body name: request required: true schema: $ref: '#/definitions/devicelog.UploadRequest' produces: - application/json responses: "201": description: Created schema: $ref: '#/definitions/devicelog.UploadResponse' "401": description: Unauthorized schema: $ref: '#/definitions/problem.Problem' "413": description: Request Entity Too Large schema: $ref: '#/definitions/problem.Problem' "415": description: Unsupported Media Type schema: $ref: '#/definitions/problem.Problem' "422": description: Unprocessable Entity schema: $ref: '#/definitions/problem.Problem' "429": description: Too Many Requests schema: $ref: '#/definitions/problem.Problem' "500": description: Internal Server Error schema: $ref: '#/definitions/problem.Problem' summary: Upload device log entries (device) tags: - Device Data /device/ota: get: description: Returns the update the owner approved for the calling device, or null. parameters: - description: Public device id (dev_...) in: header name: X-Device-ID required: true type: string - description: Secret device key (sk_...) in: header name: X-Device-Key required: true type: string - description: Running firmware version in: header name: X-Firmware-Version type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/firmware.DeviceJobResponse' "401": description: Unauthorized schema: $ref: '#/definitions/problem.Problem' "500": description: Internal Server Error schema: $ref: '#/definitions/problem.Problem' summary: Check for an approved update (device) tags: - Device Data /device/ota/status: post: consumes: - application/json description: The device reports downloading (with progress), installing, succeeded or failed. 409 means the job was cancelled or already finished and the device must stop. parameters: - description: Public device id (dev_...) in: header name: X-Device-ID required: true type: string - description: Secret device key (sk_...) in: header name: X-Device-Key required: true type: string - description: Progress report in: body name: request required: true schema: $ref: '#/definitions/firmware.StatusReportRequest' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/firmware.JobResponse' "401": description: Unauthorized schema: $ref: '#/definitions/problem.Problem' "404": description: Not Found schema: $ref: '#/definitions/problem.Problem' "409": description: Conflict schema: $ref: '#/definitions/problem.Problem' "422": description: Unprocessable Entity schema: $ref: '#/definitions/problem.Problem' "500": description: Internal Server Error schema: $ref: '#/definitions/problem.Problem' summary: Report update progress (device) tags: - Device Data /devices: get: description: Returns all registered devices. Secret keys are never included. produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/device.ListDevicesResponse' "401": description: Unauthorized schema: $ref: '#/definitions/problem.Problem' "422": description: Unprocessable Entity schema: $ref: '#/definitions/problem.Problem' "500": description: Internal Server Error schema: $ref: '#/definitions/problem.Problem' security: - BearerAuth: [] summary: List all devices tags: - Devices post: consumes: - application/json description: Registers a device and returns its credentials. The device_key is a secret shown only once here; store it securely. Only the mobile app may call this; browser sessions get 403 mobile-app-required. parameters: - description: Device to register in: body name: request required: true schema: $ref: '#/definitions/device.CreateDeviceRequest' produces: - application/json responses: "201": description: Created schema: $ref: '#/definitions/device.CreateDeviceResponse' "400": description: Bad Request schema: $ref: '#/definitions/problem.Problem' "401": description: Unauthorized schema: $ref: '#/definitions/problem.Problem' "403": description: Forbidden schema: $ref: '#/definitions/problem.Problem' "413": description: Request Entity Too Large schema: $ref: '#/definitions/problem.Problem' "415": description: Unsupported Media Type schema: $ref: '#/definitions/problem.Problem' "422": description: Unprocessable Entity schema: $ref: '#/definitions/problem.Problem' "500": description: Internal Server Error schema: $ref: '#/definitions/problem.Problem' security: - BearerAuth: [] summary: Register a new device tags: - Devices /devices/{id}: delete: description: Permanently deletes a device by its id. parameters: - description: Device id (UUID) in: path name: id required: true type: string produces: - application/json responses: "204": description: No Content "401": description: Unauthorized schema: $ref: '#/definitions/problem.Problem' "404": description: Not Found schema: $ref: '#/definitions/problem.Problem' "422": description: Unprocessable Entity schema: $ref: '#/definitions/problem.Problem' "500": description: Internal Server Error schema: $ref: '#/definitions/problem.Problem' security: - BearerAuth: [] summary: Delete a device tags: - Devices patch: consumes: - application/json description: Partially updates a device. Exact location can only be shared by a public device, and making a device private revokes location sharing. parameters: - description: Device id (UUID) in: path name: id required: true type: string - description: Fields to update in: body name: request required: true schema: $ref: '#/definitions/device.UpdateDeviceRequest' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/device.UpdateDeviceResponse' "400": description: Bad Request schema: $ref: '#/definitions/problem.Problem' "401": description: Unauthorized schema: $ref: '#/definitions/problem.Problem' "404": description: Not Found schema: $ref: '#/definitions/problem.Problem' "413": description: Request Entity Too Large schema: $ref: '#/definitions/problem.Problem' "415": description: Unsupported Media Type schema: $ref: '#/definitions/problem.Problem' "422": description: Unprocessable Entity schema: $ref: '#/definitions/problem.Problem' "500": description: Internal Server Error schema: $ref: '#/definitions/problem.Problem' security: - BearerAuth: [] summary: Update a device tags: - Devices /devices/{id}/current: get: description: Same as /air-quality/current but restricted to a single device parameters: - description: Device id (UUID) in: path name: id required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/airquality.CurrentResponse' "401": description: Unauthorized schema: $ref: '#/definitions/problem.Problem' "404": description: Not Found schema: $ref: '#/definitions/problem.Problem' "422": description: Unprocessable Entity schema: $ref: '#/definitions/problem.Problem' "500": description: Internal Server Error schema: $ref: '#/definitions/problem.Problem' security: - BearerAuth: [] summary: Get current air quality for one device tags: - Air Quality /devices/{id}/historical: get: description: Same as /air-quality/historical but restricted to a single device parameters: - description: Device id (UUID) in: path name: id required: true type: string - description: Timeline enum: - daily - weekly - monthly - yearly in: query name: timeline required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/airquality.HistoricalResponse' "401": description: Unauthorized schema: $ref: '#/definitions/problem.Problem' "404": description: Not Found schema: $ref: '#/definitions/problem.Problem' "422": description: Unprocessable Entity schema: $ref: '#/definitions/problem.Problem' "500": description: Internal Server Error schema: $ref: '#/definitions/problem.Problem' security: - BearerAuth: [] summary: Get historical air quality data for one device tags: - Air Quality /devices/{id}/logs: get: description: Returns the device's log entries, newest first. level is the minimum level (warn returns warn and error). Page with next_before. parameters: - description: Device id (UUID) in: path name: id required: true type: string - description: Minimum level enum: - debug - info - warn - error in: query name: level type: string - description: Page size (1-200, default 50) in: query name: limit type: integer - description: Return entries older than this id (from next_before) in: query name: before type: integer produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/devicelog.ListResponse' "401": description: Unauthorized schema: $ref: '#/definitions/problem.Problem' "404": description: Not Found schema: $ref: '#/definitions/problem.Problem' "422": description: Unprocessable Entity schema: $ref: '#/definitions/problem.Problem' "500": description: Internal Server Error schema: $ref: '#/definitions/problem.Problem' security: - BearerAuth: [] summary: List a device's logs tags: - Devices /devices/{id}/ota: get: description: Returns the running firmware version, the newest newer release (if any) and the latest update job. parameters: - description: Device id (UUID) in: path name: id required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/firmware.DeviceOtaResponse' "401": description: Unauthorized schema: $ref: '#/definitions/problem.Problem' "404": description: Not Found schema: $ref: '#/definitions/problem.Problem' "422": description: Unprocessable Entity schema: $ref: '#/definitions/problem.Problem' "500": description: Internal Server Error schema: $ref: '#/definitions/problem.Problem' security: - BearerAuth: [] summary: Get a device's firmware update state tags: - Firmware /devices/{id}/ota/approve: post: consumes: - application/json description: Approves installing a release on the device. The device downloads it on its next check-in (after its next upload, or immediately when the app sends OTA:CHECK over BLE). parameters: - description: Device id (UUID) in: path name: id required: true type: string - description: Release to install in: body name: request required: true schema: $ref: '#/definitions/firmware.ApproveRequest' produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/firmware.JobResponse' "401": description: Unauthorized schema: $ref: '#/definitions/problem.Problem' "404": description: Not Found schema: $ref: '#/definitions/problem.Problem' "409": description: Conflict schema: $ref: '#/definitions/problem.Problem' "422": description: Unprocessable Entity schema: $ref: '#/definitions/problem.Problem' "500": description: Internal Server Error schema: $ref: '#/definitions/problem.Problem' security: - BearerAuth: [] summary: Approve a firmware update tags: - Firmware /devices/{id}/ota/cancel: post: description: Withdraws an approval before the device starts downloading. parameters: - description: Device id (UUID) in: path name: id required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/firmware.JobResponse' "401": description: Unauthorized schema: $ref: '#/definitions/problem.Problem' "404": description: Not Found schema: $ref: '#/definitions/problem.Problem' "409": description: Conflict schema: $ref: '#/definitions/problem.Problem' "422": description: Unprocessable Entity schema: $ref: '#/definitions/problem.Problem' "500": description: Internal Server Error schema: $ref: '#/definitions/problem.Problem' security: - BearerAuth: [] summary: Cancel an approved firmware update tags: - Firmware /devices/{id}/rotate-key: post: description: Generates a new device_key for the device, invalidating the old one immediately. The new key is shown only in this response; update the physical device with it right away. Only the mobile app may call this; browser sessions get 403 mobile-app-required. parameters: - description: Device id (UUID) in: path name: id required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/device.RotateKeyResponse' "401": description: Unauthorized schema: $ref: '#/definitions/problem.Problem' "403": description: Forbidden schema: $ref: '#/definitions/problem.Problem' "404": description: Not Found schema: $ref: '#/definitions/problem.Problem' "422": description: Unprocessable Entity schema: $ref: '#/definitions/problem.Problem' "500": description: Internal Server Error schema: $ref: '#/definitions/problem.Problem' security: - BearerAuth: [] summary: Rotate a device's secret key tags: - Devices /firmware/releases: post: consumes: - application/json description: Registers an OTA image hosted at an HTTPS URL. Called by the device release pipeline with the FIRMWARE_PUBLISH_TOKEN bearer token. Owners are then offered the update in the app. parameters: - description: Bearer in: header name: Authorization required: true type: string - description: Release metadata in: body name: request required: true schema: $ref: '#/definitions/firmware.PublishReleaseRequest' produces: - application/json responses: "201": description: Created schema: $ref: '#/definitions/firmware.ReleaseResponse' "401": description: Unauthorized schema: $ref: '#/definitions/problem.Problem' "409": description: Conflict schema: $ref: '#/definitions/problem.Problem' "415": description: Unsupported Media Type schema: $ref: '#/definitions/problem.Problem' "422": description: Unprocessable Entity schema: $ref: '#/definitions/problem.Problem' "500": description: Internal Server Error schema: $ref: '#/definitions/problem.Problem' summary: Publish a firmware release tags: - Firmware /public/devices: get: produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/device.ListPublicDevicesResponse' summary: List public devices tags: - Public /public/devices/{id}: get: parameters: - description: Device id (UUID) in: path name: id required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/device.PublicDeviceResponse' "404": description: Not Found schema: $ref: '#/definitions/problem.Problem' "422": description: Unprocessable Entity schema: $ref: '#/definitions/problem.Problem' summary: Get a public device tags: - Public /public/devices/{id}/current: get: parameters: - description: Device id (UUID) in: path name: id required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/airquality.CurrentResponse' "404": description: Not Found schema: $ref: '#/definitions/problem.Problem' "422": description: Unprocessable Entity schema: $ref: '#/definitions/problem.Problem' "500": description: Internal Server Error schema: $ref: '#/definitions/problem.Problem' summary: Get current readings for a public device tags: - Public /public/devices/{id}/historical: get: parameters: - description: Device id (UUID) in: path name: id required: true type: string - description: Timeline enum: - daily - weekly - monthly - yearly in: query name: timeline required: true type: string produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/airquality.HistoricalResponse' "404": description: Not Found schema: $ref: '#/definitions/problem.Problem' "422": description: Unprocessable Entity schema: $ref: '#/definitions/problem.Problem' "500": description: Internal Server Error schema: $ref: '#/definitions/problem.Problem' summary: Get historical readings for a public device tags: - Public /public/map/devices: get: description: Returns the latest complete sample for devices whose owners explicitly publish both readings and exact location. produces: - application/json responses: "200": description: OK schema: $ref: '#/definitions/airquality.PublicMapResponse' "422": description: Unprocessable Entity schema: $ref: '#/definitions/problem.Problem' "500": description: Internal Server Error schema: $ref: '#/definitions/problem.Problem' summary: List public devices for the community map tags: - Public securityDefinitions: BearerAuth: description: 'Clerk session token using the Bearer scheme. Example: "Bearer {token}"' in: header name: Authorization type: apiKey swagger: "2.0"