{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/airthings/json-schema/airthings-add-hook-request-enriched-schema.json",
  "title": "AddHookRequest-enriched",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/airthings-webhooks-api-openapi.yml#/components/schemas/AddHookRequest-enriched",
  "type": "object",
  "properties": {
    "active": {
      "type": "boolean"
    },
    "devices": {
      "items": {
        "type": "string",
        "maxLength": 10,
        "minLength": 10
      },
      "deprecated": true,
      "description": "List of device serial numbers to subscribe to (deprecated, use locations instead)",
      "type": "array"
    },
    "eventTypes": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      ]
    },
    "headers": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object"
        }
      ]
    },
    "labels": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object"
        }
      ]
    },
    "locations": {
      "items": {
        "type": "string",
        "format": "uuid"
      },
      "description": "List of location IDs to subscribe to (needs to be empty if subscribedToAll is set true)",
      "type": "array"
    },
    "name": {
      "type": "string"
    },
    "sensorUnits": {
      "$ref": "#/$defs/HookSensorUnits"
    },
    "subscribedToAll": {
      "type": "boolean",
      "description": "Subscribe to all devices in all locations, including devices and locations that are added in the future"
    },
    "url": {
      "type": "string"
    }
  },
  "required": [
    "name",
    "url"
  ],
  "$defs": {
    "HookSensorUnits": {
      "type": "object",
      "format": "string",
      "properties": {
        "radonUnit": {
          "type": "string",
          "enum": [
            "pci",
            "bq"
          ]
        },
        "tempUnit": {
          "type": "string",
          "enum": [
            "c",
            "f"
          ]
        },
        "pressureUnit": {
          "type": "string",
          "enum": [
            "hpa",
            "inhg"
          ]
        },
        "vocUnit": {
          "type": "string",
          "enum": [
            "ppb",
            "mgpc"
          ]
        }
      }
    }
  }
}