{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "Create a new subscription to a Query API",
    "properties": {
        "authorization": {
            "description": "Whether the WebSocket connection requires authorization. NB: Default should be 'true' if the API requires authorization, and 'false' otherwise.",
            "type": "boolean"
        },
        "max_update_rate_ms": {
            "default": 100,
            "description": "Rate limiting for messages. Sets the minimum interval (in milliseconds) between consecutive WebSocket messages.",
            "type": "integer"
        },
        "params": {
            "description": "Object containing attributes to filter the resource on as per the Query Parameters specification. Can be empty.",
            "type": "object"
        },
        "persist": {
            "default": false,
            "description": "Whether the API will retain or destroy the subscription after the final client disconnects",
            "type": "boolean"
        },
        "resource_path": {
            "description": "HTTP resource path in the Query API to which this subscription relates",
            "enum": [
                "/nodes",
                "/devices",
                "/sources",
                "/flows",
                "/senders",
                "/receivers"
            ],
            "type": "string"
        },
        "secure": {
            "description": "Whether a secure WebSocket connection (wss://) is required. NB: Default should be 'true' if the API is being presented via HTTPS, and 'false' otherwise.",
            "type": "boolean"
        }
    },
    "required": [
        "max_update_rate_ms",
        "persist",
        "resource_path",
        "params"
    ],
    "title": "Subscription creation",
    "type": "object"
}
