openapi: 3.0.3 info: title: 'Altered Carbon Platform API' description: 'Customer API for the Altered Carbon Building Intelligence platform (AIRaware and LEAKaware): integration feeds for BI tools and housing management systems (properties, alerts, and AIRaware temperature, relative humidity and SporeScore; LEAKaware data is coming soon), integration API keys, webhooks and bulk data exports.' version: 1.0.0 servers: - url: 'https://staging-app.air-aware.co' tags: - name: 'Integration feeds' description: 'Flat, Power BI-friendly read feeds for one organisation. Every row carries location_id, uprn and external_ref; timestamps are ISO-8601 UTC; every feed supports ?format=csv. Works with a read-only integration API key (integration:read).' - name: 'Integration API keys' description: "Read-only API keys (Sanctum tokens with the integration:read ability) for Power BI, housing management systems and data warehouses. Each key belongs to a dedicated service user inside one organisation, so it only ever sees that organisation's data, and can only call GET/HEAD on the read endpoints. Managed by organisation, reseller or system admins with a user session; an integration key cannot manage keys." - name: Webhooks description: 'Push notifications of alert events to your HTTPS endpoint, signed with HMAC-SHA256. See the Webhooks section of the introduction for signature verification. Organisation admins (and reseller/system admins) only; needs a user session or a full-access token, not an integration:read key.' - name: 'Data export' description: 'Full organisation data export (data exit): one ZIP of CSV files (properties, gateways, sensors, readings, daily_scores, alerts, alert_notes) built in the background. Organisation admins (and reseller/system admins) only; needs a user session or a full-access token, not an integration:read key.' - name: 'Property references (signed-in admins)' description: 'Map your properties to your housing-system identifiers. These endpoints change data, so they need a signed-in organisation admin session in the web app. Read-only API keys cannot call them.' components: securitySchemes: default: type: http scheme: bearer description: 'Send your organisation API key as `Authorization: Bearer `. An organisation admin creates keys in the web app (**Profile** > **API access**, or the organisation **Integrations** page). Keys are read-only: they work only on endpoints marked **API key: works**.' security: - default: [] paths: '/api/v1/integration/organizations/{organization}/readings': get: summary: 'List sensor readings (cursor-paginated)' operationId: listSensorReadingscursorPaginated description: "Sensor readings for every sensor in the organisation, oldest first: temperature, relative humidity (the period average for summary rows), the period average mVOC and the day's SporeScore. `from` and `to` are required and may span at most 31 days per request. Page through with `cursor` = `meta.next_cursor` until it is null. Requires the list-devices permission.\n\n**API key: works.** A read-only organisation API key (`integration:read`) can call this endpoint." parameters: - in: query name: from description: 'Start of the window (inclusive), ISO-8601 instant or date, UTC.' example: '2026-09-01' required: true schema: type: string description: 'Start of the window (inclusive), ISO-8601 instant or date, UTC.' example: '2026-09-01' - in: query name: to description: 'End of the window (inclusive). A bare date covers the whole day. Max 31 days after `from`.' example: '2026-09-30' required: true schema: type: string description: 'End of the window (inclusive). A bare date covers the whole day. Max 31 days after `from`.' example: '2026-09-30' - in: query name: cursor description: "Opaque cursor from the previous page's meta.next_cursor (or the X-Next-Cursor header for CSV). Omit for the first page." example: WyIyMDI2LTA5LTAxIDAwOjE1OjAwIiw5MDAwMDFd required: false schema: type: string description: "Opaque cursor from the previous page's meta.next_cursor (or the X-Next-Cursor header for CSV). Omit for the first page." example: WyIyMDI2LTA5LTAxIDAwOjE1OjAwIiw5MDAwMDFd - in: query name: sensor_id description: 'Only readings from this sensor id.' example: 101 required: false schema: type: integer description: 'Only readings from this sensor id.' example: 101 - in: query name: per_page description: 'Rows per page, 1-1000. Default 100.' example: 500 required: false schema: type: integer description: 'Rows per page, 1-1000. Default 100.' example: 500 - in: query name: format description: 'Response format: `json` (default) or `csv`. CSV moves pagination to response headers.' example: json required: false schema: type: string description: 'Response format: `json` (default) or `csv`. CSV moves pagination to response headers.' example: json enum: - json - csv - in: query name: location_id description: 'Only rows for this Platform property id.' example: 5001 required: false schema: type: integer description: 'Only rows for this Platform property id.' example: 5001 - in: query name: uprn description: 'Only rows for the property with this UPRN (up to 12 digits).' example: '100000000001' required: false schema: type: string description: 'Only rows for the property with this UPRN (up to 12 digits).' example: '100000000001' - in: query name: external_ref description: 'Only rows for the property with this housing-system reference.' example: PROP-000123 required: false schema: type: string description: 'Only rows for the property with this housing-system reference.' example: PROP-000123 - in: query name: updated_since description: 'Only rows created or changed at/after this ISO-8601 instant or date (UTC) — use for incremental refresh.' example: '2026-10-01T00:00:00Z' required: false schema: type: string description: 'Only rows created or changed at/after this ISO-8601 instant or date (UTC) — use for incremental refresh.' example: '2026-10-01T00:00:00Z' responses: 200: description: '' content: application/json: schema: type: object example: status: success data: - reading_id: 900001 reading_time: '2026-09-01T00:15:00Z' sensor_id: 101 sensor_device_id: PUCK-EXAMPLE-0001 sensor_name: 'Bedroom 1' room_label: Bedroom location_id: 5001 property_name: 'Flat 3, 12 Example Street' uprn: '100000000001' external_ref: PROP-000123 temperature_c: 17.8 relative_humidity_pct: 71.4 mvoc_avg_ppb: 412.5 daily_sporescore: 4.35 updated_at: '2026-09-01T00:15:04Z' meta: per_page: 100 has_more: true next_cursor: WyIyMDI2LTA5LTAxIDAwOjE1OjAwIiw5MDAwMDFd from: '2026-09-01T00:00:00Z' to: '2026-09-30T23:59:59Z' properties: status: type: string example: success data: type: array example: - reading_id: 900001 reading_time: '2026-09-01T00:15:00Z' sensor_id: 101 sensor_device_id: PUCK-EXAMPLE-0001 sensor_name: 'Bedroom 1' room_label: Bedroom location_id: 5001 property_name: 'Flat 3, 12 Example Street' uprn: '100000000001' external_ref: PROP-000123 temperature_c: 17.8 relative_humidity_pct: 71.4 mvoc_avg_ppb: 412.5 daily_sporescore: 4.35 updated_at: '2026-09-01T00:15:04Z' items: type: object properties: reading_id: type: integer example: 900001 reading_time: type: string example: '2026-09-01T00:15:00Z' sensor_id: type: integer example: 101 sensor_device_id: type: string example: PUCK-EXAMPLE-0001 sensor_name: type: string example: 'Bedroom 1' room_label: type: string example: Bedroom location_id: type: integer example: 5001 property_name: type: string example: 'Flat 3, 12 Example Street' uprn: type: string example: '100000000001' external_ref: type: string example: PROP-000123 temperature_c: type: number example: 17.8 relative_humidity_pct: type: number example: 71.4 mvoc_avg_ppb: type: number example: 412.5 daily_sporescore: type: number example: 4.35 updated_at: type: string example: '2026-09-01T00:15:04Z' meta: type: object properties: per_page: type: integer example: 100 has_more: type: boolean example: true next_cursor: type: string example: WyIyMDI2LTA5LTAxIDAwOjE1OjAwIiw5MDAwMDFd from: type: string example: '2026-09-01T00:00:00Z' to: type: string example: '2026-09-30T23:59:59Z' 403: description: 'Organisation not accessible to this key' content: application/json: schema: type: object example: status: error message: 'You do not have access to this organization.' properties: status: type: string example: error message: type: string example: 'You do not have access to this organization.' 422: description: 'Invalid parameters' content: application/json: schema: type: object example: status: error message: 'Validation failed: The from field is required.' properties: status: type: string example: error message: type: string example: 'Validation failed: The from field is required.' tags: - 'Integration feeds' parameters: - in: path name: organization description: 'Platform organisation id. The key must belong to a user with access to this organisation.' example: 12 required: true schema: type: integer '/api/v1/integration/organizations/{organization}/daily': get: summary: 'List daily per-sensor summaries' operationId: listDailyPerSensorSummaries description: "One row per sensor per UTC day: average temperature, relative humidity and mVOC, and the canonical daily SporeScore with its band. Each row also carries the property's outdoor daily weather (`outdoor_temperature_avg_c`, `outdoor_relative_humidity_avg_pct`, `outdoor_specific_humidity_g_per_kg`), the indoor specific humidity (`indoor_specific_humidity_g_per_kg`) and `moisture_difference_g_per_kg` = indoor minus outdoor specific humidity in g/kg (positive: indoor air holds more moisture than outside, i.e. moisture is being added indoors). Outdoor values come from a weather archive that lags 2-5 days: they are `null` for recent days not yet available, for properties without a known location, or when weather is temporarily unavailable; `moisture_difference_g_per_kg` is `null` when either side is `null`. Indoor specific humidity is still returned when outdoor data is missing. Temperatures are degrees Celsius, humidity is a percentage. `from`/`to` are required (dates, max 366 days). Page-paginated. Requires the list-devices permission.\n\n**API key: works.** A read-only organisation API key (`integration:read`) can call this endpoint." parameters: - in: query name: from description: 'First day (inclusive), YYYY-MM-DD (UTC).' example: '2026-09-01' required: true schema: type: string description: 'First day (inclusive), YYYY-MM-DD (UTC).' example: '2026-09-01' - in: query name: to description: 'Last day (inclusive), YYYY-MM-DD (UTC). Max 366 days after `from`.' example: '2026-09-30' required: true schema: type: string description: 'Last day (inclusive), YYYY-MM-DD (UTC). Max 366 days after `from`.' example: '2026-09-30' - in: query name: sensor_id description: 'Only rows for this sensor id.' example: 101 required: false schema: type: integer description: 'Only rows for this sensor id.' example: 101 - in: query name: page description: 'Page number (1-based). Repeat until it equals meta.last_page.' example: 1 required: false schema: type: integer description: 'Page number (1-based). Repeat until it equals meta.last_page.' example: 1 - in: query name: per_page description: 'Rows per page, 1-1000. Default 100.' example: 500 required: false schema: type: integer description: 'Rows per page, 1-1000. Default 100.' example: 500 - in: query name: format description: 'Response format: `json` (default) or `csv`. CSV moves pagination to response headers.' example: json required: false schema: type: string description: 'Response format: `json` (default) or `csv`. CSV moves pagination to response headers.' example: json enum: - json - csv - in: query name: location_id description: 'Only rows for this Platform property id.' example: 5001 required: false schema: type: integer description: 'Only rows for this Platform property id.' example: 5001 - in: query name: uprn description: 'Only rows for the property with this UPRN (up to 12 digits).' example: '100000000001' required: false schema: type: string description: 'Only rows for the property with this UPRN (up to 12 digits).' example: '100000000001' - in: query name: external_ref description: 'Only rows for the property with this housing-system reference.' example: PROP-000123 required: false schema: type: string description: 'Only rows for the property with this housing-system reference.' example: PROP-000123 - in: query name: updated_since description: 'Only rows created or changed at/after this ISO-8601 instant or date (UTC) — use for incremental refresh.' example: '2026-10-01T00:00:00Z' required: false schema: type: string description: 'Only rows created or changed at/after this ISO-8601 instant or date (UTC) — use for incremental refresh.' example: '2026-10-01T00:00:00Z' responses: 200: description: '' content: application/json: schema: type: object example: status: success data: - date: '2026-09-01' sensor_id: 101 sensor_device_id: PUCK-EXAMPLE-0001 sensor_name: 'Bedroom 1' room_label: Bedroom location_id: 5001 property_name: 'Flat 3, 12 Example Street' uprn: '100000000001' external_ref: PROP-000123 temperature_avg_c: 17.6 relative_humidity_avg_pct: 70.3 mvoc_avg_ppb: 412.5 sporescore: 4.35 sporescore_band: moderate_risk outdoor_temperature_avg_c: 12.4 outdoor_relative_humidity_avg_pct: 81.5 outdoor_specific_humidity_g_per_kg: 6.9 indoor_specific_humidity_g_per_kg: 8.6 moisture_difference_g_per_kg: 1.7 updated_at: '2026-09-02T02:10:00Z' meta: current_page: 1 per_page: 100 total: 2790 last_page: 28 properties: status: type: string example: success data: type: array example: - date: '2026-09-01' sensor_id: 101 sensor_device_id: PUCK-EXAMPLE-0001 sensor_name: 'Bedroom 1' room_label: Bedroom location_id: 5001 property_name: 'Flat 3, 12 Example Street' uprn: '100000000001' external_ref: PROP-000123 temperature_avg_c: 17.6 relative_humidity_avg_pct: 70.3 mvoc_avg_ppb: 412.5 sporescore: 4.35 sporescore_band: moderate_risk outdoor_temperature_avg_c: 12.4 outdoor_relative_humidity_avg_pct: 81.5 outdoor_specific_humidity_g_per_kg: 6.9 indoor_specific_humidity_g_per_kg: 8.6 moisture_difference_g_per_kg: 1.7 updated_at: '2026-09-02T02:10:00Z' items: type: object properties: date: type: string example: '2026-09-01' sensor_id: type: integer example: 101 sensor_device_id: type: string example: PUCK-EXAMPLE-0001 sensor_name: type: string example: 'Bedroom 1' room_label: type: string example: Bedroom location_id: type: integer example: 5001 property_name: type: string example: 'Flat 3, 12 Example Street' uprn: type: string example: '100000000001' external_ref: type: string example: PROP-000123 temperature_avg_c: type: number example: 17.6 relative_humidity_avg_pct: type: number example: 70.3 mvoc_avg_ppb: type: number example: 412.5 sporescore: type: number example: 4.35 sporescore_band: type: string example: moderate_risk outdoor_temperature_avg_c: type: number example: 12.4 outdoor_relative_humidity_avg_pct: type: number example: 81.5 outdoor_specific_humidity_g_per_kg: type: number example: 6.9 indoor_specific_humidity_g_per_kg: type: number example: 8.6 moisture_difference_g_per_kg: type: number example: 1.7 updated_at: type: string example: '2026-09-02T02:10:00Z' meta: type: object properties: current_page: type: integer example: 1 per_page: type: integer example: 100 total: type: integer example: 2790 last_page: type: integer example: 28 403: description: 'Organisation not accessible to this key' content: application/json: schema: type: object example: status: error message: 'You do not have access to this organization.' properties: status: type: string example: error message: type: string example: 'You do not have access to this organization.' 422: description: 'Invalid parameters' content: application/json: schema: type: object example: status: error message: 'Validation failed: The from field is required.' properties: status: type: string example: error message: type: string example: 'Validation failed: The from field is required.' tags: - 'Integration feeds' parameters: - in: path name: organization description: 'Platform organisation id. The key must belong to a user with access to this organisation.' example: 12 required: true schema: type: integer '/api/v1/integration/organizations/{organization}/properties': get: summary: 'List properties with current risk' operationId: listPropertiesWithCurrentRisk description: "One row per property in the organisation: name, town, UPRN, external_ref, latest Home Risk score and band, highest SporeScore, sensor count and open alert summary. Page-paginated. Requires the list-devices permission.\n\n**API key: works.** A read-only organisation API key (`integration:read`) can call this endpoint." parameters: - in: query name: page description: 'Page number (1-based). Repeat until it equals meta.last_page.' example: 1 required: false schema: type: integer description: 'Page number (1-based). Repeat until it equals meta.last_page.' example: 1 - in: query name: per_page description: 'Rows per page, 1-1000. Default 100.' example: 500 required: false schema: type: integer description: 'Rows per page, 1-1000. Default 100.' example: 500 - in: query name: format description: 'Response format: `json` (default) or `csv`. CSV moves pagination to response headers.' example: json required: false schema: type: string description: 'Response format: `json` (default) or `csv`. CSV moves pagination to response headers.' example: json enum: - json - csv - in: query name: location_id description: 'Only rows for this Platform property id.' example: 5001 required: false schema: type: integer description: 'Only rows for this Platform property id.' example: 5001 - in: query name: uprn description: 'Only rows for the property with this UPRN (up to 12 digits).' example: '100000000001' required: false schema: type: string description: 'Only rows for the property with this UPRN (up to 12 digits).' example: '100000000001' - in: query name: external_ref description: 'Only rows for the property with this housing-system reference.' example: PROP-000123 required: false schema: type: string description: 'Only rows for the property with this housing-system reference.' example: PROP-000123 - in: query name: updated_since description: 'Only rows created or changed at/after this ISO-8601 instant or date (UTC) — use for incremental refresh.' example: '2026-10-01T00:00:00Z' required: false schema: type: string description: 'Only rows created or changed at/after this ISO-8601 instant or date (UTC) — use for incremental refresh.' example: '2026-10-01T00:00:00Z' responses: 200: description: '' content: application/json: schema: type: object example: status: success data: - location_id: 5001 property_name: 'Flat 3, 12 Example Street' city: Exampleton uprn: '100000000001' external_ref: PROP-000123 home_risk_score: 62 home_risk_band: High home_risk_level: high home_risk_score_date: '2026-10-05' max_sporescore: 6.1 sensors_count: 3 open_alerts_count: 1 highest_open_alert_severity: high updated_at: '2026-09-14T10:02:11Z' meta: current_page: 1 per_page: 100 total: 240 last_page: 3 properties: status: type: string example: success data: type: array example: - location_id: 5001 property_name: 'Flat 3, 12 Example Street' city: Exampleton uprn: '100000000001' external_ref: PROP-000123 home_risk_score: 62 home_risk_band: High home_risk_level: high home_risk_score_date: '2026-10-05' max_sporescore: 6.1 sensors_count: 3 open_alerts_count: 1 highest_open_alert_severity: high updated_at: '2026-09-14T10:02:11Z' items: type: object properties: location_id: type: integer example: 5001 property_name: type: string example: 'Flat 3, 12 Example Street' city: type: string example: Exampleton uprn: type: string example: '100000000001' external_ref: type: string example: PROP-000123 home_risk_score: type: integer example: 62 home_risk_band: type: string example: High home_risk_level: type: string example: high home_risk_score_date: type: string example: '2026-10-05' max_sporescore: type: number example: 6.1 sensors_count: type: integer example: 3 open_alerts_count: type: integer example: 1 highest_open_alert_severity: type: string example: high updated_at: type: string example: '2026-09-14T10:02:11Z' meta: type: object properties: current_page: type: integer example: 1 per_page: type: integer example: 100 total: type: integer example: 240 last_page: type: integer example: 3 403: description: 'Organisation not accessible to this key' content: application/json: schema: type: object example: status: error message: 'You do not have access to this organization.' properties: status: type: string example: error message: type: string example: 'You do not have access to this organization.' 422: description: 'Invalid parameters' content: application/json: schema: type: object example: status: error message: 'Validation failed: The from field is required.' properties: status: type: string example: error message: type: string example: 'Validation failed: The from field is required.' tags: - 'Integration feeds' parameters: - in: path name: organization description: 'Platform organisation id. The key must belong to a user with access to this organisation.' example: 12 required: true schema: type: integer '/api/v1/integration/organizations/{organization}/alerts': get: summary: 'List mould alerts' operationId: listMouldAlerts description: "Mould alerts for the organisation, oldest first, with status (unacknowledged / acknowledged / resolved) and property identifiers. Page-paginated. `from`/`to` filter on created_at. Requires the list-alerts permission.\n\n**API key: works.** A read-only organisation API key (`integration:read`) can call this endpoint." parameters: - in: query name: from description: 'Only alerts created at/after this instant or date (UTC).' example: '2026-09-01' required: false schema: type: string description: 'Only alerts created at/after this instant or date (UTC).' example: '2026-09-01' - in: query name: to description: 'Only alerts created at/before this instant or date (a bare date covers the whole day).' example: '2026-09-30' required: false schema: type: string description: 'Only alerts created at/before this instant or date (a bare date covers the whole day).' example: '2026-09-30' - in: query name: status description: 'Filter by state. `open` and `active` both mean not resolved.' example: open required: false schema: type: string description: 'Filter by state. `open` and `active` both mean not resolved.' example: open enum: - open - active - acknowledged - unacknowledged - resolved - in: query name: severity description: 'Comma-separated severities.' example: 'high,critical' required: false schema: type: string description: 'Comma-separated severities.' example: 'high,critical' - in: query name: sensor_id description: 'Only alerts raised by this sensor id.' example: 101 required: false schema: type: integer description: 'Only alerts raised by this sensor id.' example: 101 - in: query name: page description: 'Page number (1-based). Repeat until it equals meta.last_page.' example: 1 required: false schema: type: integer description: 'Page number (1-based). Repeat until it equals meta.last_page.' example: 1 - in: query name: per_page description: 'Rows per page, 1-1000. Default 100.' example: 500 required: false schema: type: integer description: 'Rows per page, 1-1000. Default 100.' example: 500 - in: query name: format description: 'Response format: `json` (default) or `csv`. CSV moves pagination to response headers.' example: json required: false schema: type: string description: 'Response format: `json` (default) or `csv`. CSV moves pagination to response headers.' example: json enum: - json - csv - in: query name: location_id description: 'Only rows for this Platform property id.' example: 5001 required: false schema: type: integer description: 'Only rows for this Platform property id.' example: 5001 - in: query name: uprn description: 'Only rows for the property with this UPRN (up to 12 digits).' example: '100000000001' required: false schema: type: string description: 'Only rows for the property with this UPRN (up to 12 digits).' example: '100000000001' - in: query name: external_ref description: 'Only rows for the property with this housing-system reference.' example: PROP-000123 required: false schema: type: string description: 'Only rows for the property with this housing-system reference.' example: PROP-000123 - in: query name: updated_since description: 'Only rows created or changed at/after this ISO-8601 instant or date (UTC) — use for incremental refresh.' example: '2026-10-01T00:00:00Z' required: false schema: type: string description: 'Only rows created or changed at/after this ISO-8601 instant or date (UTC) — use for incremental refresh.' example: '2026-10-01T00:00:00Z' responses: 200: description: '' content: application/json: schema: type: object example: status: success data: - alert_id: 7001 alert_type: high_mould_risk severity: high status: acknowledged message: 'High mould risk detected in Bedroom 1.' sensor_id: 101 sensor_device_id: PUCK-EXAMPLE-0001 sensor_name: 'Bedroom 1' room_label: Bedroom location_id: 5001 property_name: 'Flat 3, 12 Example Street' uprn: '100000000001' external_ref: PROP-000123 triggered_at: '2026-09-20T06:00:00Z' acknowledged_at: '2026-09-20T09:12:45Z' resolved_at: null resolution_status: null created_at: '2026-09-20T06:00:02Z' updated_at: '2026-09-20T09:12:45Z' meta: current_page: 1 per_page: 100 total: 1 last_page: 1 properties: status: type: string example: success data: type: array example: - alert_id: 7001 alert_type: high_mould_risk severity: high status: acknowledged message: 'High mould risk detected in Bedroom 1.' sensor_id: 101 sensor_device_id: PUCK-EXAMPLE-0001 sensor_name: 'Bedroom 1' room_label: Bedroom location_id: 5001 property_name: 'Flat 3, 12 Example Street' uprn: '100000000001' external_ref: PROP-000123 triggered_at: '2026-09-20T06:00:00Z' acknowledged_at: '2026-09-20T09:12:45Z' resolved_at: null resolution_status: null created_at: '2026-09-20T06:00:02Z' updated_at: '2026-09-20T09:12:45Z' items: type: object properties: alert_id: type: integer example: 7001 alert_type: type: string example: high_mould_risk severity: type: string example: high status: type: string example: acknowledged message: type: string example: 'High mould risk detected in Bedroom 1.' sensor_id: type: integer example: 101 sensor_device_id: type: string example: PUCK-EXAMPLE-0001 sensor_name: type: string example: 'Bedroom 1' room_label: type: string example: Bedroom location_id: type: integer example: 5001 property_name: type: string example: 'Flat 3, 12 Example Street' uprn: type: string example: '100000000001' external_ref: type: string example: PROP-000123 triggered_at: type: string example: '2026-09-20T06:00:00Z' acknowledged_at: type: string example: '2026-09-20T09:12:45Z' resolved_at: type: string example: null nullable: true resolution_status: type: string example: null nullable: true created_at: type: string example: '2026-09-20T06:00:02Z' updated_at: type: string example: '2026-09-20T09:12:45Z' meta: type: object properties: current_page: type: integer example: 1 per_page: type: integer example: 100 total: type: integer example: 1 last_page: type: integer example: 1 403: description: 'Organisation not accessible to this key' content: application/json: schema: type: object example: status: error message: 'You do not have access to this organization.' properties: status: type: string example: error message: type: string example: 'You do not have access to this organization.' 422: description: 'Invalid parameters' content: application/json: schema: type: object example: status: error message: 'Validation failed: The from field is required.' properties: status: type: string example: error message: type: string example: 'Validation failed: The from field is required.' tags: - 'Integration feeds' parameters: - in: path name: organization description: 'Platform organisation id. The key must belong to a user with access to this organisation.' example: 12 required: true schema: type: integer '/api/v1/organizations/{organization}/integration-clients': get: summary: 'List integration API keys' operationId: listIntegrationAPIKeys description: "All integration clients for the organisation with their current key metadata (abilities, expiry, last used). The key itself is never returned again after creation.\n\n**API key: not available.** This endpoint needs a signed-in user session in the AIRaware web app. An API key gets `403 integration_route_not_allowed`." parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: status: success data: - id: 880 name: 'Power BI - asset team' organization_id: 12 organization: id: 12 name: 'Example Housing' status: active created_by: id: 41 name: 'Alex Admin' email: alex.admin@example.com created_at: '2026-09-01T10:00:00+00:00' updated_at: '2026-09-01T10:00:00+00:00' token: id: 1550 abilities: - 'integration:read' expires_at: '2027-02-28T10:00:00+00:00' last_used_at: '2026-10-06T06:00:12+00:00' created_at: '2026-09-01T10:00:00+00:00' is_expired: false expires_in_days: 145 expiry_warning: false properties: status: type: string example: success data: type: array example: - id: 880 name: 'Power BI - asset team' organization_id: 12 organization: id: 12 name: 'Example Housing' status: active created_by: id: 41 name: 'Alex Admin' email: alex.admin@example.com created_at: '2026-09-01T10:00:00+00:00' updated_at: '2026-09-01T10:00:00+00:00' token: id: 1550 abilities: - 'integration:read' expires_at: '2027-02-28T10:00:00+00:00' last_used_at: '2026-10-06T06:00:12+00:00' created_at: '2026-09-01T10:00:00+00:00' is_expired: false expires_in_days: 145 expiry_warning: false items: type: object properties: id: type: integer example: 880 name: type: string example: 'Power BI - asset team' organization_id: type: integer example: 12 organization: type: object properties: id: type: integer example: 12 name: type: string example: 'Example Housing' status: type: string example: active created_by: type: object properties: id: type: integer example: 41 name: type: string example: 'Alex Admin' email: type: string example: alex.admin@example.com created_at: type: string example: '2026-09-01T10:00:00+00:00' updated_at: type: string example: '2026-09-01T10:00:00+00:00' token: type: object properties: id: type: integer example: 1550 abilities: type: array example: - 'integration:read' items: type: string expires_at: type: string example: '2027-02-28T10:00:00+00:00' last_used_at: type: string example: '2026-10-06T06:00:12+00:00' created_at: type: string example: '2026-09-01T10:00:00+00:00' is_expired: type: boolean example: false expires_in_days: type: integer example: 145 expiry_warning: type: boolean example: false 403: description: '' content: application/json: schema: type: object example: status: UNAUTHORIZED data: message: 'Only organisation, reseller or system admins can manage integration clients.' properties: status: type: string example: UNAUTHORIZED data: type: object properties: message: type: string example: 'Only organisation, reseller or system admins can manage integration clients.' tags: - 'Integration API keys' post: summary: 'Create an integration API key' operationId: createAnIntegrationAPIKey description: "Creates an integration client and returns its key in `plain_text_token` ONCE — store it in your secret manager. Send it as `Authorization: Bearer `.\n\n**API key: not available.** This endpoint needs a signed-in user session in the AIRaware web app. An API key gets `403 integration_route_not_allowed`." parameters: [] responses: 201: description: '' content: application/json: schema: type: object example: status: success data: client: id: 880 name: 'Power BI - asset team' organization_id: 12 organization: id: 12 name: 'Example Housing' status: active created_by: id: 41 name: 'Alex Admin' email: alex.admin@example.com created_at: '2026-10-06T09:00:00+00:00' updated_at: '2026-10-06T09:00:00+00:00' token: id: 1550 abilities: - 'integration:read' expires_at: '2027-04-04T09:00:00+00:00' last_used_at: null created_at: '2026-10-06T09:00:00+00:00' is_expired: false expires_in_days: 180 expiry_warning: false plain_text_token: 1550|example-api-key-shown-only-once properties: status: type: string example: success data: type: object properties: client: type: object properties: id: type: integer example: 880 name: type: string example: 'Power BI - asset team' organization_id: type: integer example: 12 organization: type: object properties: id: type: integer example: 12 name: type: string example: 'Example Housing' status: type: string example: active created_by: type: object properties: id: type: integer example: 41 name: type: string example: 'Alex Admin' email: type: string example: alex.admin@example.com created_at: type: string example: '2026-10-06T09:00:00+00:00' updated_at: type: string example: '2026-10-06T09:00:00+00:00' token: type: object properties: id: type: integer example: 1550 abilities: type: array example: - 'integration:read' items: type: string expires_at: type: string example: '2027-04-04T09:00:00+00:00' last_used_at: type: string example: null nullable: true created_at: type: string example: '2026-10-06T09:00:00+00:00' is_expired: type: boolean example: false expires_in_days: type: integer example: 180 expiry_warning: type: boolean example: false plain_text_token: type: string example: 1550|example-api-key-shown-only-once 403: description: '' content: application/json: schema: type: object example: message: 'The customer API is not enabled for this organisation yet.' error: customer_api_disabled properties: message: type: string example: 'The customer API is not enabled for this organisation yet.' error: type: string example: customer_api_disabled 422: description: '' content: application/json: schema: type: object example: message: 'This organisation already has the maximum number of active API keys (10).' error: key_limit_reached limit: per_org properties: message: type: string example: 'This organisation already has the maximum number of active API keys (10).' error: type: string example: key_limit_reached limit: type: string example: per_org tags: - 'Integration API keys' requestBody: required: true content: application/json: schema: type: object properties: name: type: string description: 'Descriptive name, e.g. the system that will use the key.' example: 'Power BI - asset team' expires_in_days: type: integer description: 'Key lifetime in days (1-365). Default 180.' example: 180 required: - name parameters: - in: path name: organization description: 'Platform organisation id.' example: 12 required: true schema: type: integer '/api/v1/organizations/{organization}/integration-clients/usage': get: summary: 'Rate limits and usage of the API keys' operationId: rateLimitsAndUsageOfTheAPIKeys description: "The per-key rate limits and how much of them each active key has used in the current minute and hour, with the time each window resets. Read from the same counters that enforce the limits. Only for organisations with the API add-on.\n\n**API key: not available.** This endpoint needs a signed-in user session in the AIRaware web app. An API key gets `403 integration_route_not_allowed`." parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: status: success data: limits: per_minute: 60 per_hour: 1000 keys: - client_id: 880 token_id: 4512 minute: limit: 60 used: 3 remaining: 57 resets_in: 41 resets_at: '2026-11-17T12:01:00+00:00' hour: limit: 1000 used: 12 remaining: 988 resets_in: 2100 resets_at: '2026-11-17T12:35:00+00:00' generated_at: '2026-11-17T12:00:19+00:00' properties: status: type: string example: success data: type: object properties: limits: type: object properties: per_minute: type: integer example: 60 per_hour: type: integer example: 1000 keys: type: array example: - client_id: 880 token_id: 4512 minute: limit: 60 used: 3 remaining: 57 resets_in: 41 resets_at: '2026-11-17T12:01:00+00:00' hour: limit: 1000 used: 12 remaining: 988 resets_in: 2100 resets_at: '2026-11-17T12:35:00+00:00' items: type: object properties: client_id: type: integer example: 880 token_id: type: integer example: 4512 minute: type: object properties: limit: type: integer example: 60 used: type: integer example: 3 remaining: type: integer example: 57 resets_in: type: integer example: 41 resets_at: type: string example: '2026-11-17T12:01:00+00:00' hour: type: object properties: limit: type: integer example: 1000 used: type: integer example: 12 remaining: type: integer example: 988 resets_in: type: integer example: 2100 resets_at: type: string example: '2026-11-17T12:35:00+00:00' generated_at: type: string example: '2026-11-17T12:00:19+00:00' 403: description: '' content: application/json: schema: type: object example: message: 'The customer API is not enabled for this organisation yet.' error: customer_api_disabled properties: message: type: string example: 'The customer API is not enabled for this organisation yet.' error: type: string example: customer_api_disabled tags: - 'Integration API keys' parameters: - in: path name: organization description: 'Platform organisation id.' example: 12 required: true schema: type: integer '/api/v1/organizations/{organization}/integration-clients/{client}': delete: summary: 'Revoke an integration API key' operationId: revokeAnIntegrationAPIKey description: "Deletes the client's keys immediately and marks the client revoked. Calls with the old key start returning 401 straight away.\n\n**API key: not available.** This endpoint needs a signed-in user session in the AIRaware web app. An API key gets `403 integration_route_not_allowed`." parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: status: success data: client: id: 880 name: 'Power BI - asset team' organization_id: 12 status: revoked token: null tokens_revoked: 1 properties: status: type: string example: success data: type: object properties: client: type: object properties: id: type: integer example: 880 name: type: string example: 'Power BI - asset team' organization_id: type: integer example: 12 status: type: string example: revoked token: type: string example: null nullable: true tokens_revoked: type: integer example: 1 tags: - 'Integration API keys' parameters: - in: path name: organization description: 'Platform organisation id.' example: 12 required: true schema: type: integer - in: path name: client description: 'Integration client id (within this organisation).' example: 880 required: true schema: type: integer '/api/v1/organizations/{organization}/integration-clients/{client}/rotate': post: summary: 'Rotate an integration API key' operationId: rotateAnIntegrationAPIKey description: "Issues a new key for the client (returned ONCE in `plain_text_token`) and revokes the previous one. Update the consuming system straight after rotating.\n\n**API key: not available.** This endpoint needs a signed-in user session in the AIRaware web app. An API key gets `403 integration_route_not_allowed`." parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: status: success data: client: id: 880 name: 'Power BI - asset team' organization_id: 12 organization: id: 12 name: 'Example Housing' status: active created_by: id: 41 name: 'Alex Admin' email: alex.admin@example.com created_at: '2026-10-06T09:00:00+00:00' updated_at: '2026-10-06T09:00:00+00:00' token: id: 1550 abilities: - 'integration:read' expires_at: '2027-04-04T09:00:00+00:00' last_used_at: null created_at: '2026-10-06T09:00:00+00:00' is_expired: false expires_in_days: 180 expiry_warning: false plain_text_token: 1550|example-api-key-shown-only-once properties: status: type: string example: success data: type: object properties: client: type: object properties: id: type: integer example: 880 name: type: string example: 'Power BI - asset team' organization_id: type: integer example: 12 organization: type: object properties: id: type: integer example: 12 name: type: string example: 'Example Housing' status: type: string example: active created_by: type: object properties: id: type: integer example: 41 name: type: string example: 'Alex Admin' email: type: string example: alex.admin@example.com created_at: type: string example: '2026-10-06T09:00:00+00:00' updated_at: type: string example: '2026-10-06T09:00:00+00:00' token: type: object properties: id: type: integer example: 1550 abilities: type: array example: - 'integration:read' items: type: string expires_at: type: string example: '2027-04-04T09:00:00+00:00' last_used_at: type: string example: null nullable: true created_at: type: string example: '2026-10-06T09:00:00+00:00' is_expired: type: boolean example: false expires_in_days: type: integer example: 180 expiry_warning: type: boolean example: false plain_text_token: type: string example: 1550|example-api-key-shown-only-once 422: description: '' content: application/json: schema: type: object example: status: error message: 'This integration client has been revoked. Create a new one instead.' properties: status: type: string example: error message: type: string example: 'This integration client has been revoked. Create a new one instead.' tags: - 'Integration API keys' requestBody: required: false content: application/json: schema: type: object properties: expires_in_days: type: integer description: 'Key lifetime in days (1-365). Default 180.' example: 180 parameters: - in: path name: organization description: 'Platform organisation id.' example: 12 required: true schema: type: integer - in: path name: client description: 'Integration client id (within this organisation).' example: 880 required: true schema: type: integer '/api/v1/organizations/{organization}/webhooks': get: summary: 'List webhooks' operationId: listWebhooks description: "All webhook endpoints for the organisation plus the event names you can subscribe to. Secrets are never returned, only a 4-character hint.\n\n**API key: not available.** This endpoint needs a signed-in user session in the AIRaware web app. An API key gets `403 integration_route_not_allowed`." parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: status: success data: webhooks: - id: 3 organization_id: 12 name: 'Housing system alerts' url: 'https://hooks.example-housing.org/airaware' events: - alert.created - alert.resolved is_active: true failure_count: 0 disabled_at: null disabled_reason: null last_success_at: '2026-10-05T14:02:11+00:00' last_failure_at: null secret_hint: …9f3a created_at: '2026-09-01T10:00:00+00:00' updated_at: '2026-10-05T14:02:11+00:00' available_events: - alert.created - alert.acknowledged - alert.resolved properties: status: type: string example: success data: type: object properties: webhooks: type: array example: - id: 3 organization_id: 12 name: 'Housing system alerts' url: 'https://hooks.example-housing.org/airaware' events: - alert.created - alert.resolved is_active: true failure_count: 0 disabled_at: null disabled_reason: null last_success_at: '2026-10-05T14:02:11+00:00' last_failure_at: null secret_hint: …9f3a created_at: '2026-09-01T10:00:00+00:00' updated_at: '2026-10-05T14:02:11+00:00' items: type: object properties: id: type: integer example: 3 organization_id: type: integer example: 12 name: type: string example: 'Housing system alerts' url: type: string example: 'https://hooks.example-housing.org/airaware' events: type: array example: - alert.created - alert.resolved items: type: string is_active: type: boolean example: true failure_count: type: integer example: 0 disabled_at: type: string example: null nullable: true disabled_reason: type: string example: null nullable: true last_success_at: type: string example: '2026-10-05T14:02:11+00:00' last_failure_at: type: string example: null nullable: true secret_hint: type: string example: …9f3a created_at: type: string example: '2026-09-01T10:00:00+00:00' updated_at: type: string example: '2026-10-05T14:02:11+00:00' available_events: type: array example: - alert.created - alert.acknowledged - alert.resolved items: type: string 403: description: '' content: application/json: schema: type: object example: status: error message: 'Only organisation administrators can manage integrations.' properties: status: type: string example: error message: type: string example: 'Only organisation administrators can manage integrations.' tags: - Webhooks post: summary: 'Create a webhook' operationId: createAWebhook description: "Register an HTTPS endpoint for one or more events (alert.created, alert.acknowledged, alert.resolved). The signing `secret` is returned ONCE in this response — store it securely. URLs must be public HTTPS (private/internal addresses are rejected). Max 10 webhooks per organisation.\n\n**API key: not available.** This endpoint needs a signed-in user session in the AIRaware web app. An API key gets `403 integration_route_not_allowed`." parameters: [] responses: 201: description: '' content: application/json: schema: type: object example: status: success data: id: 3 organization_id: 12 name: 'Housing system alerts' url: 'https://hooks.example-housing.org/airaware' events: - alert.created - alert.resolved is_active: true failure_count: 0 disabled_at: null disabled_reason: null last_success_at: null last_failure_at: null secret_hint: …9f3a created_at: '2026-10-06T09:00:00+00:00' updated_at: '2026-10-06T09:00:00+00:00' secret: whsec_example-secret-shown-only-once properties: status: type: string example: success data: type: object properties: id: type: integer example: 3 organization_id: type: integer example: 12 name: type: string example: 'Housing system alerts' url: type: string example: 'https://hooks.example-housing.org/airaware' events: type: array example: - alert.created - alert.resolved items: type: string is_active: type: boolean example: true failure_count: type: integer example: 0 disabled_at: type: string example: null nullable: true disabled_reason: type: string example: null nullable: true last_success_at: type: string example: null nullable: true last_failure_at: type: string example: null nullable: true secret_hint: type: string example: …9f3a created_at: type: string example: '2026-10-06T09:00:00+00:00' updated_at: type: string example: '2026-10-06T09:00:00+00:00' secret: type: string example: whsec_example-secret-shown-only-once 403: description: '' content: application/json: schema: type: object example: status: error message: 'Only organisation administrators can manage integrations.' properties: status: type: string example: error message: type: string example: 'Only organisation administrators can manage integrations.' tags: - Webhooks requestBody: required: true content: application/json: schema: type: object properties: name: type: string description: 'Label for your own reference.' example: 'Housing system alerts' url: type: string description: 'Public HTTPS URL that will receive POST deliveries.' example: 'https://hooks.example-housing.org/airaware' events: type: array description: 'Events to subscribe to.' example: - alert.created - alert.resolved items: type: string required: - url - events parameters: - in: path name: organization description: 'Platform organisation id.' example: 12 required: true schema: type: integer '/api/v1/organizations/{organization}/webhooks/{webhook}': put: summary: 'Update a webhook' operationId: updateAWebhook description: "Change the name, URL or events, or re-enable (`is_active: true`) a webhook that was auto-disabled after 20 consecutive failed deliveries. Re-enabling resets the failure counter.\n\n**API key: not available.** This endpoint needs a signed-in user session in the AIRaware web app. An API key gets `403 integration_route_not_allowed`." parameters: [] responses: 401: description: '' content: application/json: schema: type: object example: message: Unauthenticated status: error properties: message: type: string example: Unauthenticated status: type: string example: error 403: description: '' content: application/json: schema: type: object example: status: error message: 'Only organisation administrators can manage integrations.' properties: status: type: string example: error message: type: string example: 'Only organisation administrators can manage integrations.' tags: - Webhooks requestBody: required: false content: application/json: schema: type: object properties: name: type: string description: Label. example: 'Housing system alerts' url: type: string description: 'New public HTTPS URL.' example: 'https://hooks.example-housing.org/airaware-v2' events: type: array description: 'Replacement event list.' example: - alert.created - alert.acknowledged - alert.resolved items: type: string is_active: type: boolean description: 'Enable or pause deliveries.' example: true delete: summary: 'Delete a webhook' operationId: deleteAWebhook description: "Stops all deliveries to this endpoint and deletes it.\n\n**API key: not available.** This endpoint needs a signed-in user session in the AIRaware web app. An API key gets `403 integration_route_not_allowed`." parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: status: success data: deleted: true properties: status: type: string example: success data: type: object properties: deleted: type: boolean example: true tags: - Webhooks parameters: - in: path name: organization description: 'Platform organisation id.' example: 12 required: true schema: type: integer - in: path name: webhook description: 'Webhook id (within this organisation).' example: 3 required: true schema: type: integer '/api/v1/organizations/{organization}/webhooks/{webhook}/test': post: summary: 'Send a test (ping) delivery' operationId: sendATestpingDelivery description: "Sends a signed `ping` event to the endpoint now and reports the HTTP outcome. Works on disabled webhooks and does not change the failure counter, so you can verify a fix before re-enabling.\n\n**API key: not available.** This endpoint needs a signed-in user session in the AIRaware web app. An API key gets `403 integration_route_not_allowed`." parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: status: success data: success: true status_code: 200 duration_ms: 162 error: null delivery_id: 6f1c2a9e-0000-4000-8000-000000000002 properties: status: type: string example: success data: type: object properties: success: type: boolean example: true status_code: type: integer example: 200 duration_ms: type: integer example: 162 error: type: string example: null nullable: true delivery_id: type: string example: 6f1c2a9e-0000-4000-8000-000000000002 tags: - Webhooks parameters: - in: path name: organization description: 'Platform organisation id.' example: 12 required: true schema: type: integer - in: path name: webhook description: 'Webhook id (within this organisation).' example: 3 required: true schema: type: integer '/api/v1/organizations/{organization}/webhooks/{webhook}/rotate-secret': post: summary: 'Rotate the signing secret' operationId: rotateTheSigningSecret description: "Generates a new signing secret and returns it ONCE. Deliveries are signed with the new secret immediately, so update your receiver at the same time.\n\n**API key: not available.** This endpoint needs a signed-in user session in the AIRaware web app. An API key gets `403 integration_route_not_allowed`." parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: status: success data: id: 3 secret_hint: …1c7e secret: whsec_example-secret-shown-only-once properties: status: type: string example: success data: type: object properties: id: type: integer example: 3 secret_hint: type: string example: …1c7e secret: type: string example: whsec_example-secret-shown-only-once tags: - Webhooks parameters: - in: path name: organization description: 'Platform organisation id.' example: 12 required: true schema: type: integer - in: path name: webhook description: 'Webhook id (within this organisation).' example: 3 required: true schema: type: integer '/api/v1/organizations/{organization}/webhooks/{webhook}/deliveries': get: summary: 'List recent deliveries' operationId: listRecentDeliveries description: "Delivery log for a webhook, newest first (kept 30 days): event, attempt number, HTTP status, duration, error and the exact payload sent. Failed deliveries are retried after 1 min, 5 min, 30 min, 2 h and 6 h (6 attempts in total) with the same delivery_id.\n\n**API key: not available.** This endpoint needs a signed-in user session in the AIRaware web app. An API key gets `403 integration_route_not_allowed`." parameters: - in: query name: per_page description: 'Must be at least 1. Must not be greater than 100.' example: 1 required: false schema: type: integer description: 'Must be at least 1. Must not be greater than 100.' example: 1 - in: query name: event description: 'Must not be greater than 64 characters.' example: 'n' required: false schema: type: string description: 'Must not be greater than 64 characters.' example: 'n' - in: query name: success description: '' example: false required: false schema: type: boolean description: '' example: false responses: 200: description: '' content: application/json: schema: type: object example: status: success data: - id: 4410 webhook_id: 3 delivery_id: 6f1c2a9e-0000-4000-8000-000000000001 event: alert.created attempt: 1 success: true status_code: 200 duration_ms: 184 error: null response_excerpt: '{"ok":true}' delivered_at: '2026-10-05T14:02:11+00:00' payload: schema_version: 1 event: alert.created delivery_id: 6f1c2a9e-0000-4000-8000-000000000001 occurred_at: '2026-10-05T14:02:10Z' organization: id: 12 name: 'Riverside Housing Trust' alert: id: 7001 type: high_mould_risk severity: high status: unacknowledged title: 'High mould risk' message: 'High mould risk detected in Bedroom 1.' created_at: '2026-10-05T14:02:09Z' triggered_at: '2026-10-05T14:00:00Z' acknowledged_at: null resolved_at: null resolution_status: null resolution_notes: null property: id: 5001 name: 'Flat 3, 12 Example Street' city: Exampleton county: null uprn: '100000000001' external_ref: PROP-000123 sensor: id: 101 device_id: PUCK-EXAMPLE-0001 name: 'Bedroom 1' room: Bedroom meta: current_page: 1 per_page: 25 total: 1 last_page: 1 properties: status: type: string example: success data: type: array example: - id: 4410 webhook_id: 3 delivery_id: 6f1c2a9e-0000-4000-8000-000000000001 event: alert.created attempt: 1 success: true status_code: 200 duration_ms: 184 error: null response_excerpt: '{"ok":true}' delivered_at: '2026-10-05T14:02:11+00:00' payload: schema_version: 1 event: alert.created delivery_id: 6f1c2a9e-0000-4000-8000-000000000001 occurred_at: '2026-10-05T14:02:10Z' organization: id: 12 name: 'Riverside Housing Trust' alert: id: 7001 type: high_mould_risk severity: high status: unacknowledged title: 'High mould risk' message: 'High mould risk detected in Bedroom 1.' created_at: '2026-10-05T14:02:09Z' triggered_at: '2026-10-05T14:00:00Z' acknowledged_at: null resolved_at: null resolution_status: null resolution_notes: null property: id: 5001 name: 'Flat 3, 12 Example Street' city: Exampleton county: null uprn: '100000000001' external_ref: PROP-000123 sensor: id: 101 device_id: PUCK-EXAMPLE-0001 name: 'Bedroom 1' room: Bedroom items: type: object properties: id: type: integer example: 4410 webhook_id: type: integer example: 3 delivery_id: type: string example: 6f1c2a9e-0000-4000-8000-000000000001 event: type: string example: alert.created attempt: type: integer example: 1 success: type: boolean example: true status_code: type: integer example: 200 duration_ms: type: integer example: 184 error: type: string example: null nullable: true response_excerpt: type: string example: '{"ok":true}' delivered_at: type: string example: '2026-10-05T14:02:11+00:00' payload: type: object properties: schema_version: type: integer example: 1 event: type: string example: alert.created delivery_id: type: string example: 6f1c2a9e-0000-4000-8000-000000000001 occurred_at: type: string example: '2026-10-05T14:02:10Z' organization: type: object properties: id: type: integer example: 12 name: type: string example: 'Riverside Housing Trust' alert: type: object properties: id: type: integer example: 7001 type: type: string example: high_mould_risk severity: type: string example: high status: type: string example: unacknowledged title: type: string example: 'High mould risk' message: type: string example: 'High mould risk detected in Bedroom 1.' created_at: type: string example: '2026-10-05T14:02:09Z' triggered_at: type: string example: '2026-10-05T14:00:00Z' acknowledged_at: type: string example: null nullable: true resolved_at: type: string example: null nullable: true resolution_status: type: string example: null nullable: true resolution_notes: type: string example: null nullable: true property: type: object properties: id: type: integer example: 5001 name: type: string example: 'Flat 3, 12 Example Street' city: type: string example: Exampleton county: type: string example: null nullable: true uprn: type: string example: '100000000001' external_ref: type: string example: PROP-000123 sensor: type: object properties: id: type: integer example: 101 device_id: type: string example: PUCK-EXAMPLE-0001 name: type: string example: 'Bedroom 1' room: type: string example: Bedroom meta: type: object properties: current_page: type: integer example: 1 per_page: type: integer example: 25 total: type: integer example: 1 last_page: type: integer example: 1 tags: - Webhooks parameters: - in: path name: organization description: 'Platform organisation id.' example: 12 required: true schema: type: integer - in: path name: webhook description: 'Webhook id (within this organisation).' example: 3 required: true schema: type: integer '/api/v1/organizations/{organization}/exports': get: summary: 'List exports' operationId: listExports description: "The 50 most recent exports for the organisation with status (queued, running, complete, failed) and per-file row counts. Export files are deleted 7 days after completion.\n\n**API key: not available.** This endpoint needs a signed-in user session in the AIRaware web app. An API key gets `403 integration_route_not_allowed`." parameters: [] responses: 200: description: 'No exports yet' content: application/json: schema: type: object example: status: success data: [] properties: status: type: string example: success data: type: array example: [] 403: description: '' content: application/json: schema: type: object example: status: error message: 'Only organisation administrators can manage integrations.' properties: status: type: string example: error message: type: string example: 'Only organisation administrators can manage integrations.' tags: - 'Data export' post: summary: 'Start an export' operationId: startAnExport description: "Queues a full export and returns it with status `queued` (HTTP 202). Poll the export until status is `complete`, then download it. Only one export per organisation can run at a time (409 otherwise).\n\n**API key: not available.** This endpoint needs a signed-in user session in the AIRaware web app. An API key gets `403 integration_route_not_allowed`." parameters: [] responses: 202: description: '' content: application/json: schema: type: object example: status: success data: id: 42 organization_id: 12 requested_by: 3051 status: queued file_size: null row_counts: null error: null started_at: null completed_at: null expires_at: null created_at: '2026-10-06T09:00:00+00:00' downloadable: false properties: status: type: string example: success data: type: object properties: id: type: integer example: 42 organization_id: type: integer example: 12 requested_by: type: integer example: 3051 status: type: string example: queued file_size: type: string example: null nullable: true row_counts: type: string example: null nullable: true error: type: string example: null nullable: true started_at: type: string example: null nullable: true completed_at: type: string example: null nullable: true expires_at: type: string example: null nullable: true created_at: type: string example: '2026-10-06T09:00:00+00:00' downloadable: type: boolean example: false 403: description: '' content: application/json: schema: type: object example: status: error message: 'Only organisation administrators can manage integrations.' properties: status: type: string example: error message: type: string example: 'Only organisation administrators can manage integrations.' 409: description: '' content: application/json: schema: type: object example: status: error message: 'An export for this organisation is already in progress.' data: id: 41 status: running properties: status: type: string example: error message: type: string example: 'An export for this organisation is already in progress.' data: type: object properties: id: type: integer example: 41 status: type: string example: running tags: - 'Data export' parameters: - in: path name: organization description: 'Platform organisation id.' example: 12 required: true schema: type: integer '/api/v1/organizations/{organization}/exports/{export}': get: summary: 'Get an export' operationId: getAnExport description: "Status and row counts of one export. `downloadable` is true once the ZIP is ready and not yet expired.\n\n**API key: not available.** This endpoint needs a signed-in user session in the AIRaware web app. An API key gets `403 integration_route_not_allowed`." parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: status: success data: id: 41 organization_id: 12 requested_by: 3051 status: complete file_size: 18734212 row_counts: properties.csv: 240 sensors.csv: 702 readings.csv: 1834220 daily_scores.csv: 251004 alerts.csv: 1180 alert_notes.csv: 312 error: null started_at: '2026-10-06T09:00:03+00:00' completed_at: '2026-10-06T09:06:41+00:00' expires_at: '2026-10-13T09:06:41+00:00' created_at: '2026-10-06T09:00:00+00:00' downloadable: true properties: status: type: string example: success data: type: object properties: id: type: integer example: 41 organization_id: type: integer example: 12 requested_by: type: integer example: 3051 status: type: string example: complete file_size: type: integer example: 18734212 row_counts: type: object properties: properties.csv: type: integer example: 240 sensors.csv: type: integer example: 702 readings.csv: type: integer example: 1834220 daily_scores.csv: type: integer example: 251004 alerts.csv: type: integer example: 1180 alert_notes.csv: type: integer example: 312 error: type: string example: null nullable: true started_at: type: string example: '2026-10-06T09:00:03+00:00' completed_at: type: string example: '2026-10-06T09:06:41+00:00' expires_at: type: string example: '2026-10-13T09:06:41+00:00' created_at: type: string example: '2026-10-06T09:00:00+00:00' downloadable: type: boolean example: true tags: - 'Data export' parameters: - in: path name: organization description: 'Platform organisation id.' example: 12 required: true schema: type: integer - in: path name: export description: 'Export id.' example: 41 required: true schema: type: integer '/api/v1/organizations/{organization}/exports/{export}/download': get: summary: 'Download an export' operationId: downloadAnExport description: "Redirects (302) to a short-lived (10 minute) signed download URL for the ZIP. Pass `redirect=0` to get the URL as JSON instead. 409 if the export is not complete, 410 if it has expired.\n\n**API key: not available.** This endpoint needs a signed-in user session in the AIRaware web app. An API key gets `403 integration_route_not_allowed`." parameters: - in: query name: redirect description: 'Set to 0/false to receive {url, expires_at} as JSON instead of a redirect.' example: false required: false schema: type: boolean description: 'Set to 0/false to receive {url, expires_at} as JSON instead of a redirect.' example: false responses: 200: description: 'With redirect=0' content: application/json: schema: type: object example: status: success data: url: 'https://storage.example.com/exports/org-12-export-41.zip?signature=example' expires_at: '2026-10-06T09:20:00+00:00' properties: status: type: string example: success data: type: object properties: url: type: string example: 'https://storage.example.com/exports/org-12-export-41.zip?signature=example' expires_at: type: string example: '2026-10-06T09:20:00+00:00' 409: description: '' content: application/json: schema: type: object example: status: error message: 'This export is not available for download.' properties: status: type: string example: error message: type: string example: 'This export is not available for download.' tags: - 'Data export' parameters: - in: path name: organization description: 'Platform organisation id.' example: 12 required: true schema: type: integer - in: path name: export description: 'Export id.' example: 41 required: true schema: type: integer '/api/v1/integration/organizations/{organization}/properties/references': post: summary: 'Bulk-set property UPRN / external_ref' operationId: bulkSetPropertyUPRNExternalRef description: "Map your properties to your housing-system identifiers in bulk (max 5000 rows). Send JSON `{\"rows\": [...]}`, a multipart CSV `file`, or a `text/csv` body with columns location_id (or name + postcode), uprn, external_ref. An absent key or empty CSV cell leaves a value unchanged; an explicit JSON null clears it. external_ref must be unique within the organisation. Use `dry_run=true` to preview. Needs a signed-in organisation admin session, not an API key: API keys are read-only and get 403 integration_route_not_allowed.\n\n**API key: not available.** This endpoint needs a signed-in user session in the AIRaware web app. An API key gets `403 integration_route_not_allowed`." parameters: - in: query name: dry_run description: 'Validate and report what would change without saving.' example: true required: false schema: type: boolean description: 'Validate and report what would change without saving.' example: true responses: 200: description: '' content: application/json: schema: type: object example: status: success data: dry_run: false summary: updated: 1 matched: 0 not_found: 1 ambiguous: 0 invalid: 0 results: - row: 1 status: updated location_id: 5001 uprn: '100000000001' external_ref: PROP-000123 - row: 2 status: not_found location_id: null properties: status: type: string example: success data: type: object properties: dry_run: type: boolean example: false summary: type: object properties: updated: type: integer example: 1 matched: type: integer example: 0 not_found: type: integer example: 1 ambiguous: type: integer example: 0 invalid: type: integer example: 0 results: type: array example: - row: 1 status: updated location_id: 5001 uprn: '100000000001' external_ref: PROP-000123 - row: 2 status: not_found location_id: null items: type: object properties: row: type: integer example: 1 status: type: string example: updated location_id: type: integer example: 5001 uprn: type: string example: '100000000001' external_ref: type: string example: PROP-000123 403: description: '' content: application/json: schema: type: object example: status: error message: 'Only organisation admins can import property references.' properties: status: type: string example: error message: type: string example: 'Only organisation admins can import property references.' 422: description: '' content: application/json: schema: type: object example: status: error message: 'Too many rows: maximum is 5000 per request.' properties: status: type: string example: error message: type: string example: 'Too many rows: maximum is 5000 per request.' tags: - 'Property references (signed-in admins)' requestBody: required: false content: application/json: schema: type: object properties: rows: type: array description: 'Rows to apply (JSON form).' example: - [] items: type: object properties: location_id: type: integer description: 'Platform property id. Either this or name + postcode.' example: 5001 name: type: string description: 'Property name, used with postcode when location_id is not given.' example: 'Flat 3, 12 Example Street' postcode: type: string description: 'Postcode, used with name.' example: 'AB1 2CD' uprn: type: string description: 'Unique Property Reference Number, 1-12 digits.' example: '100000000001' external_ref: type: string description: 'Your housing-system property reference (max 100 chars).' example: PROP-000123 parameters: - in: path name: organization description: 'Platform organisation id. The key must belong to a user with access to this organisation.' example: 12 required: true schema: type: integer