{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/wso2/main/json-schema/wso2-gateway-response-with-token-schema.json",
  "title": "Gateway Response With Token",
  "description": "Platform gateway response including the one-time registration token (POST create or regenerate-token).",
  "x-generated": "2026-10-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/wso2-platform-gateways-api-openapi.yml#/components/schemas/GatewayResponseWithToken",
  "allOf": [
    {
      "$ref": "#/$defs/PlatformGatewayResponse"
    },
    {
      "type": "object",
      "properties": {
        "registrationToken": {
          "type": "string",
          "description": "Registration token (returned only once on create or regenerate). Use as api-key when connecting\nthe gateway to the control plane WebSocket. Store e.g. as GATEWAY_REGISTRATION_TOKEN.\n"
        }
      }
    }
  ],
  "$defs": {
    "PlatformGatewayResponse": {
      "title": "Platform Gateway Response",
      "description": "Platform gateway response (without registration token). Used for list and get.",
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "readOnly": true,
          "description": "Gateway UUID"
        },
        "name": {
          "type": "string"
        },
        "displayName": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "properties": {
          "type": "object",
          "additionalProperties": true,
          "description": "Custom key-value properties"
        },
        "vhost": {
          "type": "string",
          "format": "uri",
          "readOnly": true,
          "description": "Gateway URL (e.g. https://host or https://host:9443). Same name as platform API; type is URL."
        },
        "isActive": {
          "type": "boolean",
          "readOnly": true,
          "description": "Indicates if the gateway is currently connected to the control plane via WebSocket"
        },
        "permissions": {
          "type": "object",
          "description": "Gateway visibility permissions configuration",
          "properties": {
            "permissionType": {
              "type": "string",
              "enum": [
                "PUBLIC",
                "ALLOW",
                "DENY"
              ],
              "default": "PUBLIC",
              "description": "Permission type for gateway visibility:\n- PUBLIC: Gateway is visible to all users\n- ALLOW: Gateway is visible only to specified roles\n- DENY: Gateway is hidden from specified roles\n"
            },
            "roles": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "List of roles for ALLOW/DENY permission types"
            }
          }
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time",
          "readOnly": true
        }
      }
    }
  }
}