{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/gsma/json-schema/gsma-qos-profile-device-request-schema.json",
  "title": "QosProfileDeviceRequest",
  "description": "Request object for QoS Profiles for a given device\n",
  "x-generated": "2026-11-09",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/gsma-qos-profiles-api-openapi.yml#/components/schemas/QosProfileDeviceRequest",
  "type": "object",
  "properties": {
    "device": {
      "$ref": "#/$defs/Device"
    },
    "name": {
      "$ref": "#/$defs/QosProfileName"
    },
    "status": {
      "$ref": "#/$defs/QosProfileStatusEnum"
    }
  },
  "$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`\nNOTE1: the network operator might support only a subset of these options. The API consumer can provide multiple identifiers to be compatible across different operators. In this case the identifiers MUST belong to the same device.\nNOTE2: as for this Commonalities release, 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
    },
    "QosProfileName": {
      "description": "A unique name for identifying a specific QoS profile.\nThis may follow different formats depending on the service providers implementation.\nSome options addresses:\n  - A UUID style string\n  - Support for predefined profile names like `QOS_E`, `QOS_S`, `QOS_M`, and `QOS_L`\n  - A searchable descriptive name\n",
      "type": "string",
      "minLength": 3,
      "maxLength": 256,
      "format": "string",
      "pattern": "^[a-zA-Z0-9_.-]+$"
    },
    "QosProfileStatusEnum": {
      "description": "The current status of the QoS Profile\n- `ACTIVE`- QoS Profile is available to be used\n- `INACTIVE`- QoS Profile is not currently available to be deployed\n- `DEPRECATED`- QoS profile is actively being used in a QoD session, but can not be deployed in new QoD sessions\n",
      "type": "string",
      "enum": [
        "ACTIVE",
        "INACTIVE",
        "DEPRECATED"
      ]
    },
    "SingleIpv4Addr": {
      "description": "A single IPv4 address with no subnet mask",
      "type": "string",
      "format": "ipv4"
    }
  }
}