{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/gsma/json-schema/gsma-retrieve-sessions-input-schema.json",
  "title": "RetrieveSessionsInput",
  "description": "Parameters to get QoS session information by device",
  "x-generated": "2026-11-09",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/gsma-qos-sessions-api-openapi.yml#/components/schemas/RetrieveSessionsInput",
  "type": "object",
  "properties": {
    "device": {
      "$ref": "#/$defs/Device"
    }
  },
  "$defs": {
    "Device": {
      "description": "End-user equipment able to connect to a mobile network. Examples of devices include smartphones or IoT sensors/actuators.\n\nThe developer can choose to provide the below specified device identifiers:\n\n* `ipv4Address`\n* `ipv6Address`\n* `phoneNumber`\n* `networkAccessIdentifier`\n\nNOTE1: the network operator might support only a subset of these options. The API invoker can provide multiple identifiers to be compatible across different network operators. In this case the identifiers MUST belong to the same device\nNOTE2: for the Commonalities release v0.4, we are enforcing that the networkAccessIdentifier is only part of the schema for future-proofing, and CAMARA does not currently allow its use. After the CAMARA meta-release work is concluded and the relevant issues are resolved, its use will need to be explicitly documented in the guidelines.\n",
      "type": "object",
      "properties": {
        "phoneNumber": {
          "$ref": "#/$defs/PhoneNumber"
        },
        "networkAccessIdentifier": {
          "$ref": "#/$defs/NetworkAccessIdentifier"
        },
        "ipv4Address": {
          "$ref": "#/$defs/DeviceIpv4Addr"
        },
        "ipv6Address": {
          "$ref": "#/$defs/DeviceIpv6Address"
        }
      },
      "minProperties": 1
    },
    "DeviceIpv4Addr": {
      "type": "object",
      "description": "The device should be identified by either the public (observed) IP address and port as seen by the application server, or the private (local) and any public (observed) IP addresses in use by the device (this information can be obtained by various means, for example from some DNS servers).\n\nIf the allocated and observed IP addresses are the same (i.e. NAT is not in use) then  the same address should be specified for both publicAddress and privateAddress.\n\nIf NAT64 is in use, the device should be identified by its publicAddress and publicPort, or separately by its allocated IPv6 address (field ipv6Address of the Device object)\n\nIn all cases, publicAddress must be specified, along with at least one of either privateAddress or publicPort, dependent upon which is known. In general, mobile devices cannot be identified by their public IPv4 address alone.\n",
      "properties": {
        "publicAddress": {
          "$ref": "#/$defs/SingleIpv4Addr"
        },
        "privateAddress": {
          "$ref": "#/$defs/SingleIpv4Addr"
        },
        "publicPort": {
          "$ref": "#/$defs/Port"
        }
      },
      "anyOf": [
        {
          "required": [
            "publicAddress",
            "privateAddress"
          ]
        },
        {
          "required": [
            "publicAddress",
            "publicPort"
          ]
        }
      ]
    },
    "DeviceIpv6Address": {
      "description": "The device should be identified by the observed IPv6 address, or by any single IPv6 address from within the subnet allocated to the device (e.g. adding ::0 to the /64 prefix).\n\nThe session shall apply to all IP flows between the device subnet and the specified application server, unless further restricted by the optional parameters devicePorts or applicationServerPorts.\n",
      "type": "string",
      "format": "ipv6"
    },
    "NetworkAccessIdentifier": {
      "description": "A public identifier addressing a subscription in a mobile network. In 3GPP terminology, it corresponds to the GPSI formatted with the External Identifier ({Local Identifier}@{Domain Identifier}). Unlike the telephone number, the network access identifier is not subjected to portability ruling in force, and is individually managed by each operator.",
      "type": "string"
    },
    "PhoneNumber": {
      "description": "A public identifier addressing a telephone subscription. In mobile networks it corresponds to the MSISDN (Mobile Station International Subscriber Directory Number). In order to be globally unique it has to be formatted in international format, according to E.164 standard, prefixed with '+'.",
      "type": "string",
      "pattern": "^\\+[1-9][0-9]{4,14}$"
    },
    "Port": {
      "description": "TCP or UDP port number",
      "type": "integer",
      "minimum": 0,
      "maximum": 65535
    },
    "SingleIpv4Addr": {
      "description": "A single IPv4 address with no subnet mask",
      "type": "string",
      "format": "ipv4"
    }
  }
}