{
   "openapi": "3.0.0",
   "info": {
      "title": "Fraud Prevention API",
      "description": "The Fraud Prevention API is a set of APIs supporting Fraud detection including managing own fraud rules.",
      "version": "2.0.0",
      "contact": {
         "name": "Nexmo DevRel",
         "email": "devrel@nexmo.com",
         "url": "https://developer.nexmo.com/"
      }
   },
   "servers": [
      {
         "url": "https://api.nexmo.com",
         "description": "API URL"
      }
   ],
   "security": [
      {
         "basicAuth": []
      }
   ],
   "paths": {
      "/v2/fraud-defender/networks": {
         "get": {
            "summary": "Retrieves all networks",
            "description": "Returns a complete list of networks. Supports filtering by name, mcc, country code or PLMN. If both mcc and country_code are provided, mcc takes precedence.",
            "parameters": [
               {
                  "name": "name",
                  "in": "query",
                  "description": "Filter by network name",
                  "required": false,
                  "schema": {
                     "$ref": "#/components/schemas/network/NetworkName"
                  }
               },
               {
                  "name": "mcc",
                  "in": "query",
                  "description": "Filter by Mobile Country Code (MCC)",
                  "required": false,
                  "schema": {
                     "$ref": "#/components/schemas/network/Mcc"
                  }
               },
               {
                  "name": "country_code",
                  "in": "query",
                  "description": "Filter by ISO country code - alternative to `MCC` for identifying country",
                  "required": false,
                  "schema": {
                     "$ref": "#/components/schemas/common/CountryCode"
                  }
               },
               {
                  "name": "plmn",
                  "in": "query",
                  "description": "Filter by public land mobile network (PLMN)",
                  "required": false,
                  "schema": {
                     "$ref": "#/components/schemas/network/PublicLandMobileNetwork"
                  }
               }
            ],
            "responses": {
               "200": {
                  "description": "Successfully retrieved networks",
                  "content": {
                     "application/json": {
                        "schema": {
                           "allOf": [
                              {
                                 "$ref": "#/components/schemas/network/NetworksResponse"
                              },
                              {
                                 "$ref": "#/components/schemas/common/LinksSelfResponse"
                              }
                           ]
                        }
                     }
                  }
               }
            }
         }
      },
      "/v2/fraud-defender/rules/networks": {
         "get": {
            "summary": "Retrieve all network traffic rules",
            "description": "Returns a paginated list of network rules.  Network rules define blocking rules for specific mobile networks within countries.\n",
            "parameters": [
               {
                  "name": "product",
                  "in": "query",
                  "description": "Find rules for a specific product",
                  "required": false,
                  "schema": {
                     "$ref": "#/components/schemas/common/Product"
                  }
               },
               {
                  "name": "mcc",
                  "in": "query",
                  "description": "Find rules for a specific Mobile Country Code (MCC)",
                  "required": false,
                  "schema": {
                     "$ref": "#/components/schemas/network/Mcc"
                  }
               },
               {
                  "name": "country_code",
                  "in": "query",
                  "description": "Find rules for a specific ISO country code - alternative to `MCC` for identifying country",
                  "required": false,
                  "schema": {
                     "$ref": "#/components/schemas/common/CountryCode"
                  }
               },
               {
                  "name": "network_name",
                  "in": "query",
                  "description": "Find rules for a specific network name.",
                  "required": false,
                  "schema": {
                     "$ref": "#/components/schemas/network/NetworkName"
                  }
               },
               {
                  "name": "plmn",
                  "in": "query",
                  "description": "Find rules for a specific public land mobile network (PLMN). Valid only with `status=active`, otherwise returns 400 error.",
                  "required": false,
                  "schema": {
                     "$ref": "#/components/schemas/network/PublicLandMobileNetwork"
                  }
               },
               {
                  "name": "expire_start_date",
                  "in": "query",
                  "description": "Find rules that expire on or after a specific date (YYYY-MM-DD) in UTC timezone. Valid only with `status=active`, otherwise returns 400 error.",
                  "required": false,
                  "schema": {
                     "$ref": "#/components/schemas/network/DateFilter"
                  }
               },
               {
                  "name": "expire_end_date",
                  "in": "query",
                  "description": "Find rules that expire on or before a specific date (YYYY-MM-DD) in UTC timezone. Valid only with `status=active`, otherwise returns 400 error.",
                  "required": false,
                  "schema": {
                     "$ref": "#/components/schemas/network/DateFilter"
                  }
               },
               {
                  "name": "ttl",
                  "in": "query",
                  "description": "Find rules by time to live (TTL). Valid only with `status=active`, otherwise returns 400 error.",
                  "required": false,
                  "schema": {
                     "$ref": "#/components/schemas/network/Ttl"
                  }
               },
               {
                  "name": "sort",
                  "in": "query",
                  "description": "Sort by field (product, mcc, country_code, network_name, created_at, expires_at)",
                  "required": false,
                  "schema": {
                     "$ref": "#/components/schemas/network/SortField"
                  }
               },
               {
                  "name": "status",
                  "in": "query",
                  "description": "Filter by rule status (active or archived).",
                  "required": false,
                  "schema": {
                     "$ref": "#/components/schemas/network/Status"
                  }
               },
               {
                  "name": "order",
                  "in": "query",
                  "description": "Sort order (asc or desc)",
                  "required": false,
                  "schema": {
                     "type": "string",
                     "default": "desc",
                     "enum": [
                        "asc",
                        "desc"
                     ]
                  }
               },
               {
                  "name": "page",
                  "in": "query",
                  "description": "Page number.",
                  "schema": {
                     "type": "integer",
                     "minimum": 1,
                     "default": 1
                  },
                  "required": false
               },
               {
                  "name": "page_size",
                  "in": "query",
                  "description": "Number of items per page",
                  "schema": {
                     "type": "integer",
                     "default": 10,
                     "minimum": 1,
                     "maximum": 100
                  },
                  "required": false
               }
            ],
            "responses": {
               "200": {
                  "description": "Successfully retrieved network rules",
                  "content": {
                     "application/json": {
                        "schema": {
                           "allOf": [
                              {
                                 "$ref": "#/components/schemas/network/NetworkRulesResponse"
                              },
                              {
                                 "$ref": "#/components/schemas/common/LinksPagedResponse"
                              },
                              {
                                 "$ref": "#/components/schemas/common/PageResponse"
                              }
                           ]
                        }
                     }
                  }
               }
            }
         },
         "post": {
            "summary": "Create a new traffic rule for a network",
            "requestBody": {
               "required": true,
               "content": {
                  "application/json": {
                     "schema": {
                        "$ref": "#/components/schemas/network/CreateNetworkRuleRequest"
                     }
                  }
               }
            },
            "responses": {
               "201": {
                  "description": "Rule created",
                  "content": {
                     "application/json": {
                        "schema": {
                           "$ref": "#/components/schemas/network/NetworkRuleItem"
                        }
                     }
                  }
               }
            }
         }
      },
      "/v2/fraud-defender/rules/networks/{id}": {
         "patch": {
            "summary": "Update an existing network traffic rule",
            "description": "Updates the details of a specific network traffic rule identified by `id`. Only the reason for the rule can be modified.",
            "parameters": [
               {
                  "name": "id",
                  "in": "path",
                  "required": true,
                  "schema": {
                     "$ref": "#/components/schemas/network/RuleId"
                  }
               }
            ],
            "requestBody": {
               "required": true,
               "content": {
                  "application/json": {
                     "schema": {
                        "$ref": "#/components/schemas/network/EditNetworkRuleRequest"
                     }
                  }
               }
            },
            "responses": {
               "200": {
                  "description": "Rule updated",
                  "content": {
                     "application/json": {
                        "schema": {
                           "$ref": "#/components/schemas/network/NetworkRuleItem"
                        }
                     }
                  }
               }
            }
         },
         "delete": {
            "summary": "Archive a network rule",
            "description": "Archives a specific network traffic rule identified by `id`.  Archived rules become inactive and no longer block traffic. Still, a maximum of 50 archived rules remain accessible during 90 days for record-keeping and can be retrieved using the GET endpoint with the filter `status=archived`.\n",
            "parameters": [
               {
                  "name": "id",
                  "in": "path",
                  "required": true,
                  "schema": {
                     "$ref": "#/components/schemas/network/RuleId"
                  }
               }
            ],
            "responses": {
               "204": {
                  "description": "Rule archived (no content returned)"
               }
            }
         }
      },
      "/v2/fraud-defender/rules/countries": {
         "get": {
            "summary": "Retrieve all country traffic rules",
            "description": "Returns a complete list of country rules. Country rules define which country-product combinations should have their traffic blocked.\n",
            "responses": {
               "200": {
                  "description": "A complete list of country-based traffic rules",
                  "content": {
                     "application/json": {
                        "schema": {
                           "allOf": [
                              {
                                 "$ref": "#/components/schemas/country/CountryRulesResponse"
                              },
                              {
                                 "$ref": "#/components/schemas/common/LinksSelfResponse"
                              }
                           ]
                        }
                     }
                  }
               }
            }
         },
         "put": {
            "summary": "Replace country rules",
            "description": "Replaces the country rules with the provided list.  Country rules define which country-product combinations should have their traffic blocked. The rules array must always contain a complete list of rules - any existing rules not present in this request will be removed.\n",
            "requestBody": {
               "content": {
                  "application/json": {
                     "schema": {
                        "$ref": "#/components/schemas/country/ReplaceCountryRulesRequest"
                     }
                  }
               }
            },
            "responses": {
               "200": {
                  "description": "Successfully replaced country rules",
                  "content": {
                     "application/json": {
                        "schema": {
                           "$ref": "#/components/schemas/country/CountryRulesResponse"
                        }
                     }
                  }
               }
            }
         }
      },
      "/v2/fraud-defender/countries": {
         "get": {
            "summary": "Retrieve all supported countries",
            "description": "Retrieves all supported countries along with their risk levels for fraud detection.",
            "responses": {
               "200": {
                  "description": "Successfully retrieved country data",
                  "content": {
                     "application/json": {
                        "schema": {
                           "allOf": [
                              {
                                 "$ref": "#/components/schemas/country/CountryResponse"
                              },
                              {
                                 "$ref": "#/components/schemas/common/LinksSelfResponse"
                              }
                           ]
                        }
                     }
                  }
               }
            }
         }
      }
   },
   "components": {
      "securitySchemes": {
         "basicAuth": {
            "type": "http",
            "scheme": "basic"
         }
      },
      "schemas": {
         "common": {
            "Product": {
               "type": "string",
               "enum": [
                  "SMS",
                  "VOICE"
               ],
               "description": "Product type for the traffic rule",
               "example": "SMS"
            },
            "CountryCode": {
               "type": "string",
               "description": "Country code (ISO 3166-1 Alpha-2)",
               "pattern": "^[A-Z]{2}$",
               "example": "GB"
            },
            "DateTime": {
               "type": "string",
               "format": "date-time",
               "description": "ISO 8601 datetime string in UTC timezone",
               "example": "2025-07-01T10:11:22Z"
            },
            "LinksSelfResponse": {
               "type": "object",
               "required": [
                  "_links"
               ],
               "properties": {
                  "_links": {
                     "$ref": "#/components/schemas/common/LinksSelf"
                  }
               },
               "example": {
                  "_links": {
                     "self": {
                        "href": "https://api.nexmo.com/v2/fraud-defender/networks?page=1&page_size=10"
                     }
                  }
               }
            },
            "LinksPagedResponse": {
               "type": "object",
               "required": [
                  "_links"
               ],
               "properties": {
                  "_links": {
                     "allOf": [
                        {
                           "$ref": "#/components/schemas/common/LinksPaged"
                        },
                        {
                           "$ref": "#/components/schemas/common/LinksSelf"
                        }
                     ]
                  }
               },
               "example": {
                  "_links": {
                     "self": {
                        "href": "https://api.nexmo.com/v2/fraud-defender/networks?page=1&page_size=10"
                     },
                     "next": {
                        "href": "https://api.nexmo.com/v2/fraud-defender/networks?page=2&page_size=10"
                     },
                     "prev": {
                        "href": "https://api.nexmo.com/v2/fraud-defender/networks?page=1&page_size=10"
                     }
                  }
               }
            },
            "LinksSelf": {
               "type": "object",
               "required": [
                  "self"
               ],
               "properties": {
                  "self": {
                     "$ref": "#/components/schemas/common/LinkHref"
                  }
               }
            },
            "LinksPaged": {
               "type": "object",
               "properties": {
                  "next": {
                     "$ref": "#/components/schemas/common/LinkHref"
                  },
                  "prev": {
                     "$ref": "#/components/schemas/common/LinkHref"
                  }
               }
            },
            "LinkHref": {
               "type": "object",
               "required": [
                  "href"
               ],
               "properties": {
                  "href": {
                     "type": "string",
                     "description": "URL to the resource"
                  }
               }
            },
            "PageResponse": {
               "type": "object",
               "required": [
                  "page",
                  "page_size",
                  "total_items",
                  "total_pages"
               ],
               "properties": {
                  "page": {
                     "type": "integer",
                     "description": "Current page number",
                     "minimum": 1
                  },
                  "page_size": {
                     "type": "integer",
                     "description": "Number of items per page",
                     "minimum": 1
                  },
                  "total_items": {
                     "type": "integer",
                     "description": "Total number of elements across all pages",
                     "minimum": 0
                  },
                  "total_pages": {
                     "type": "integer",
                     "description": "Total number of pages",
                     "minimum": 0
                  }
               },
               "example": {
                  "page": 1,
                  "page_size": 10,
                  "total_items": 50,
                  "total_pages": 5
               }
            }
         },
         "network": {
            "Mcc": {
               "type": "string",
               "description": "Mobile Country Code",
               "pattern": "^[0-9]{3}$",
               "example": "234"
            },
            "Ttl": {
               "type": "string",
               "enum": [
                  "PERMANENT",
                  "1d",
                  "12h",
                  "6h",
                  "3h",
                  "2h",
                  "1h"
               ],
               "description": "Time to live for the traffic rule. After this period, the rule will expire and no longer block traffic.",
               "example": "1d"
            },
            "Status": {
               "type": "string",
               "enum": [
                  "active",
                  "archived"
               ],
               "description": "Status of the traffic rule",
               "default": "active",
               "example": "active"
            },
            "SortField": {
               "type": "string",
               "enum": [
                  "product",
                  "mcc",
                  "country_code",
                  "network_name",
                  "created_at",
                  "expires_at"
               ],
               "description": "Field to sort network rules by",
               "default": "created_at",
               "example": "created_at"
            },
            "PublicLandMobileNetwork": {
               "type": "string",
               "description": "Unique network identifier consisting of Mobile Country Code (MCC) and Mobile Network Code (MNC) with no separators in between",
               "pattern": "^[0-9]{5,6}$",
               "example": "23401"
            },
            "NetworkName": {
               "type": "string",
               "description": "Network name",
               "example": "Vodafone UK"
            },
            "DateFilter": {
               "type": "string",
               "format": "date",
               "description": "Date filter in YYYY-MM-DD format in UTC timezone",
               "example": "2025-08-26"
            },
            "Reason": {
               "type": "string",
               "description": "Reason for the traffic rule action",
               "size": {
                  "minLength": 1,
                  "maxLength": 256
               },
               "example": "reason for blocks"
            },
            "NetworksResponse": {
               "type": "object",
               "required": [
                  "networks"
               ],
               "properties": {
                  "networks": {
                     "type": "array",
                     "items": {
                        "$ref": "#/components/schemas/network/NetworkItem"
                     },
                     "description": "List of networks"
                  }
               },
               "example": {
                  "networks": [
                     {
                        "name": "Vodafone UK",
                        "mcc": "234",
                        "country_code": "GB",
                        "plmns": [
                           "23477",
                           "23491"
                        ]
                     },
                     {
                        "name": "O2 UK",
                        "mcc": "234",
                        "country_code": "GB",
                        "plmns": [
                           "23411",
                           "23402"
                        ]
                     }
                  ]
               }
            },
            "NetworkItem": {
               "type": "object",
               "required": [
                  "name",
                  "mcc",
                  "country_code",
                  "plmns"
               ],
               "properties": {
                  "name": {
                     "$ref": "#/components/schemas/network/NetworkName"
                  },
                  "mcc": {
                     "$ref": "#/components/schemas/network/Mcc"
                  },
                  "country_code": {
                     "$ref": "#/components/schemas/common/CountryCode"
                  },
                  "plmns": {
                     "type": "array",
                     "items": {
                        "$ref": "#/components/schemas/network/PublicLandMobileNetwork"
                     },
                     "description": "List of all Public Land Mobile Network codes, including primary and all aliases"
                  }
               },
               "example": {
                  "name": "Vodafone UK",
                  "mcc": "234",
                  "country_code": "GB",
                  "plmns": [
                     "23401",
                     "23402"
                  ]
               }
            },
            "RuleId": {
               "type": "string",
               "format": "uuid",
               "description": "Unique ID of the traffic rule",
               "example": "3f8208fb-9aa3-4ea4-9a3f-de52a81e36bb"
            },
            "NetworkRuleItem": {
               "type": "object",
               "description": "A network rule that blocks traffic to specific mobile network within a country for a given product type.",
               "required": [
                  "id",
                  "product",
                  "mcc",
                  "network_name",
                  "plmns",
                  "reason",
                  "created_at",
                  "ttl"
               ],
               "properties": {
                  "id": {
                     "$ref": "#/components/schemas/network/RuleId"
                  },
                  "product": {
                     "$ref": "#/components/schemas/common/Product"
                  },
                  "mcc": {
                     "$ref": "#/components/schemas/network/Mcc"
                  },
                  "network_name": {
                     "$ref": "#/components/schemas/network/NetworkName"
                  },
                  "plmns": {
                     "type": "array",
                     "items": {
                        "$ref": "#/components/schemas/network/PublicLandMobileNetwork"
                     }
                  },
                  "reason": {
                     "$ref": "#/components/schemas/network/Reason"
                  },
                  "expires_at": {
                     "allOf": [
                        {
                           "$ref": "#/components/schemas/common/DateTime"
                        },
                        {
                           "nullable": true,
                           "description": "Timestamp when the rule expires (null for permanent rules) in UTC timezone"
                        }
                     ]
                  },
                  "created_at": {
                     "allOf": [
                        {
                           "$ref": "#/components/schemas/common/DateTime"
                        },
                        {
                           "description": "Timestamp when the rule was created"
                        }
                     ]
                  },
                  "ttl": {
                     "$ref": "#/components/schemas/network/Ttl"
                  }
               },
               "example": {
                  "product": "SMS",
                  "mcc": "234",
                  "network_name": "Vodafone UK",
                  "plmns": [
                     "23477",
                     "23491"
                  ],
                  "reason": "reason for blocks",
                  "expires_at": "2025-08-01T10:11:22Z",
                  "created_at": "2025-07-01T10:11:22Z",
                  "ttl": "1d",
                  "id": "3f8208fb-9aa3-4ea4-9a3f-de52a81e36bb"
               }
            },
            "NetworkRuleArchivedItem": {
               "type": "object",
               "properties": {
                  "archived_at": {
                     "$ref": "#/components/schemas/common/DateTime",
                     "description": "Timestamp when the rule was archived in UTC timezone, null if the rule is active"
                  }
               }
            },
            "NetworkRulesResponse": {
               "type": "object",
               "required": [
                  "_embedded"
               ],
               "properties": {
                  "_embedded": {
                     "type": "object",
                     "required": [
                        "rules"
                     ],
                     "properties": {
                        "rules": {
                           "type": "array",
                           "items": {
                              "allOf": [
                                 {
                                    "$ref": "#/components/schemas/network/NetworkRuleItem"
                                 },
                                 {
                                    "$ref": "#/components/schemas/network/NetworkRuleArchivedItem"
                                 }
                              ]
                           }
                        }
                     }
                  }
               },
               "example": {
                  "page": 1,
                  "page_size": 10,
                  "total_items": 50,
                  "total_pages": 5,
                  "_embedded": {
                     "rules": [
                        {
                           "product": "SMS",
                           "mcc": "234",
                           "network_name": "Vodafone UK",
                           "plmns": [
                              "23477",
                              "23492"
                           ],
                           "reason": "reason for block",
                           "expires_at": "2025-08-01T10:11:22Z",
                           "created_at": "2025-07-01T10:11:22Z",
                           "ttl": "1d",
                           "id": "3f8208fb-9aa3-4ea4-9a3f-de52a81e36bb"
                        }
                     ]
                  }
               }
            },
            "CreateNetworkRuleRequest": {
               "type": "object",
               "required": [
                  "product",
                  "plmn",
                  "reason",
                  "ttl"
               ],
               "properties": {
                  "product": {
                     "$ref": "#/components/schemas/common/Product"
                  },
                  "plmn": {
                     "$ref": "#/components/schemas/network/PublicLandMobileNetwork"
                  },
                  "reason": {
                     "$ref": "#/components/schemas/network/Reason"
                  },
                  "ttl": {
                     "$ref": "#/components/schemas/network/Ttl"
                  }
               },
               "example": {
                  "product": "SMS",
                  "plmn": "23401",
                  "reason": "reason for block",
                  "ttl": "PERMANENT"
               }
            },
            "CreateNetworkRuleResponse": {
               "$ref": "#/components/schemas/network/NetworkRuleItem",
               "example": {
                  "$ref": "#/components/examples/network/CreateNetworkRuleResponseExample"
               }
            },
            "EditNetworkRuleRequest": {
               "type": "object",
               "required": [
                  "reason"
               ],
               "properties": {
                  "reason": {
                     "$ref": "#/components/schemas/network/Reason"
                  }
               },
               "example": {
                  "reason": "Updated reason"
               }
            },
            "EditNetworkRuleResponse": {
               "$ref": "#/components/schemas/network/CreateNetworkRuleRequest",
               "example": {
                  "$ref": "#/components/examples/network/EditNetworkRuleResponseExample"
               }
            }
         },
         "country": {
            "CountryRulesResponse": {
               "type": "object",
               "required": [
                  "rules"
               ],
               "properties": {
                  "rules": {
                     "type": "array",
                     "items": {
                        "$ref": "#/components/schemas/country/CountryRuleItem"
                     },
                     "description": "Complete list of country rules defining which country-product combinations should have their traffic blocked."
                  }
               },
               "example": {
                  "rules": [
                     {
                        "country_code": "PL",
                        "product": "SMS"
                     },
                     {
                        "country_code": "DE",
                        "product": "SMS"
                     },
                     {
                        "country_code": "FR",
                        "product": "VOICE"
                     }
                  ]
               }
            },
            "CountryRuleItem": {
               "type": "object",
               "description": "A country rule defining which country-product combinations should have their traffic blocked.",
               "required": [
                  "product",
                  "country_code"
               ],
               "properties": {
                  "product": {
                     "$ref": "#/components/schemas/common/Product"
                  },
                  "country_code": {
                     "$ref": "#/components/schemas/common/CountryCode"
                  }
               },
               "example": {
                  "product": "SMS",
                  "country_code": "PL"
               }
            },
            "ReplaceCountryRulesRequest": {
               "type": "object",
               "required": [
                  "rules"
               ],
               "properties": {
                  "rules": {
                     "type": "array",
                     "items": {
                        "$ref": "#/components/schemas/country/CountryRuleItem"
                     },
                     "description": "Complete list of country rules which should block the traffic. Any existing rules not present in this array will be removed."
                  }
               },
               "example": {
                  "rules": [
                     {
                        "country_code": "PL",
                        "product": "SMS"
                     },
                     {
                        "country_code": "DE",
                        "product": "SMS"
                     },
                     {
                        "country_code": "FR",
                        "product": "VOICE"
                     }
                  ]
               }
            },
            "CountryResponse": {
               "type": "object",
               "required": [
                  "countries"
               ],
               "properties": {
                  "countries": {
                     "type": "array",
                     "description": "Complete list of supported countries with their risk levels",
                     "items": {
                        "$ref": "#/components/schemas/country/CountryItem"
                     }
                  }
               },
               "example": {
                  "countries": [
                     {
                        "country_code": "PL",
                        "continent": "EU"
                     },
                     {
                        "country_code": "US",
                        "continent": "NA"
                     },
                     {
                        "country_code": "ZM",
                        "continent": "AF",
                        "risk": "HIGH"
                     },
                     {
                        "country_code": "TD",
                        "continent": "AF",
                        "risk": "HIGH"
                     },
                     {
                        "country_code": "AU",
                        "continent": "OC"
                     }
                  ]
               }
            },
            "CountryItem": {
               "type": "object",
               "required": [
                  "country_code",
                  "continent"
               ],
               "properties": {
                  "country_code": {
                     "$ref": "#/components/schemas/country/CountryCode"
                  },
                  "continent": {
                     "$ref": "#/components/schemas/country/Continent"
                  },
                  "risk": {
                     "$ref": "#/components/schemas/country/RiskLevel"
                  }
               },
               "example": {
                  "country_code": "ZM",
                  "continent": "AF",
                  "risk": "HIGH"
               }
            },
            "CountryCode": {
               "type": "string",
               "pattern": "^[A-Z]{2}$",
               "description": "Country code (ISO 3166-1 Alpha-2)",
               "example": "PL"
            },
            "Continent": {
               "type": "string",
               "description": "Continent code to which the country belongs:\n* AF - Africa\n* AN - Antarctica  \n* AS - Asia\n* EU - Europe\n* NA - North America\n* OC - Oceania\n* SA - South America\n",
               "enum": [
                  "AF",
                  "AN",
                  "AS",
                  "EU",
                  "NA",
                  "OC",
                  "SA"
               ],
               "example": "EU"
            },
            "RiskLevel": {
               "type": "string",
               "enum": [
                  "NONE",
                  "HIGH"
               ],
               "default": "NONE",
               "description": "Risk level for fraud detection. When not specified, defaults to NONE. Countries with `HIGH` risk will have their traffic blocked by default.",
               "example": "HIGH"
            }
         }
      },
      "examples": {
         "common": {
            "ProductExample": "SMS",
            "CountryCodeExample": "GB",
            "DateTimeExample": "2025-07-01T10:11:22Z",
            "LinksSelfResponseExample": {
               "_links": {
                  "self": {
                     "href": "https://api.nexmo.com/v2/fraud-defender/networks?page=1&page_size=10"
                  }
               }
            },
            "LinksPagedResponseExample": {
               "_links": {
                  "self": {
                     "href": "https://api.nexmo.com/v2/fraud-defender/networks?page=1&page_size=10"
                  },
                  "next": {
                     "href": "https://api.nexmo.com/v2/fraud-defender/networks?page=2&page_size=10"
                  },
                  "prev": {
                     "href": "https://api.nexmo.com/v2/fraud-defender/networks?page=1&page_size=10"
                  }
               }
            },
            "PageResponseExample": {
               "page": 1,
               "page_size": 10,
               "total_items": 50,
               "total_pages": 5
            }
         },
         "network": {
            "MccExample": "234",
            "PublicLandMobileNetworkExample": "23401",
            "NetworkNameExample": "Vodafone UK",
            "DateFilterExample": "2025-08-26",
            "TtlExample": "1d",
            "StatusExample": "active",
            "SortFieldExample": "created_at",
            "ReasonExample": "reason for blocks",
            "RuleIdExample": "3f8208fb-9aa3-4ea4-9a3f-de52a81e36bb",
            "NetworkItemExample": {
               "name": "Vodafone UK",
               "mcc": "234",
               "country_code": "GB",
               "plmns": [
                  "23401",
                  "23402"
               ]
            },
            "NetworkRuleExample": {
               "product": "SMS",
               "mcc": "234",
               "network_name": "Vodafone UK",
               "plmns": [
                  "23477",
                  "23491"
               ],
               "reason": "reason for blocks",
               "expires_at": "2025-08-01T10:11:22Z",
               "created_at": "2025-07-01T10:11:22Z",
               "ttl": "1d",
               "id": "3f8208fb-9aa3-4ea4-9a3f-de52a81e36bb"
            },
            "NetworkRulesResponseExample": {
               "page": 1,
               "page_size": 10,
               "total_items": 50,
               "total_pages": 5,
               "_embedded": {
                  "rules": [
                     {
                        "product": "SMS",
                        "mcc": "234",
                        "network_name": "Vodafone UK",
                        "plmns": [
                           "23477",
                           "23492"
                        ],
                        "reason": "reason for block",
                        "expires_at": "2025-08-01T10:11:22Z",
                        "created_at": "2025-07-01T10:11:22Z",
                        "ttl": "1d",
                        "id": "3f8208fb-9aa3-4ea4-9a3f-de52a81e36bb"
                     }
                  ]
               }
            },
            "CreateNetworkRuleRequestExample": {
               "product": "SMS",
               "plmn": "23401",
               "reason": "reason for block",
               "ttl": "PERMANENT"
            },
            "CreateNetworkRuleResponseExample": {
               "id": "3f8208fb-9aa3-4ea4-9a3f-de52a81e36bb",
               "product": "SMS",
               "mcc": "234",
               "network_name": "Vodafone UK",
               "plmns": [
                  "23401"
               ],
               "reason": "reason for block",
               "expires_at": null,
               "created_at": "2025-07-01T10:11:22Z",
               "ttl": "PERMANENT"
            },
            "EditNetworkRuleRequestExample": {
               "reason": "Updated reason"
            },
            "EditNetworkRuleResponseExample": {
               "id": "3f8208fb-9aa3-4ea4-9a3f-de52a81e36bb",
               "product": "SMS",
               "mcc": "234",
               "network_name": "Vodafone UK",
               "plmns": [
                  "23401"
               ],
               "reason": "reason for block",
               "expires_at": null,
               "created_at": "2025-07-01T10:11:22Z",
               "ttl": "PERMANENT"
            },
            "NetworksResponseExample": {
               "networks": [
                  {
                     "name": "Vodafone UK",
                     "mcc": "234",
                     "country_code": "GB",
                     "plmns": [
                        "23477",
                        "23491"
                     ]
                  },
                  {
                     "name": "O2 UK",
                     "mcc": "234",
                     "country_code": "GB",
                     "plmns": [
                        "23411",
                        "23402"
                     ]
                  }
               ]
            }
         },
         "country": {
            "CountryRulesResponseExample": {
               "rules": [
                  {
                     "country_code": "PL",
                     "product": "SMS"
                  },
                  {
                     "country_code": "DE",
                     "product": "SMS"
                  },
                  {
                     "country_code": "FR",
                     "product": "VOICE"
                  }
               ]
            },
            "ReplaceCountryRulesRequestExample": {
               "rules": [
                  {
                     "country_code": "PL",
                     "product": "SMS"
                  },
                  {
                     "country_code": "DE",
                     "product": "SMS"
                  },
                  {
                     "country_code": "FR",
                     "product": "VOICE"
                  }
               ]
            },
            "CountryRuleItemExample": {
               "product": "SMS",
               "country_code": "PL"
            },
            "CountryResponseExample": {
               "countries": [
                  {
                     "country_code": "PL",
                     "continent": "EU"
                  },
                  {
                     "country_code": "US",
                     "continent": "NA"
                  },
                  {
                     "country_code": "ZM",
                     "continent": "AF",
                     "risk": "HIGH"
                  },
                  {
                     "country_code": "TD",
                     "continent": "AF",
                     "risk": "HIGH"
                  },
                  {
                     "country_code": "AU",
                     "continent": "OC"
                  }
               ]
            },
            "CountryItemHighRiskExample": {
               "country_code": "ZM",
               "continent": "AF",
               "risk": "HIGH"
            },
            "CountryCodeExample": "PL",
            "ContinentExample": "EU",
            "RiskLevelHighExample": "HIGH",
            "RiskLevelNoneExample": "NONE"
         }
      },
      "responses": {
         "ErrorBadRequest": {
            "description": "Bad Request",
            "content": {
               "application/json": {
                  "schema": {
                     "type": "object",
                     "properties": {
                        "title": {
                           "type": "string",
                           "example": "Bad request."
                        },
                        "type": {
                           "type": "string",
                           "example": "https://developer.vonage.com/api-errors#http:error:validation-fail"
                        },
                        "code": {
                           "type": "string",
                           "example": "http:error:validation-fail"
                        },
                        "detail": {
                           "type": "string",
                           "example": "Input validation failure."
                        }
                     }
                  }
               }
            }
         },
         "ErrorUnauthorized": {
            "description": "Unauthorized",
            "content": {
               "application/json": {
                  "schema": {
                     "type": "object",
                     "properties": {
                        "title": {
                           "type": "string",
                           "example": "Unauthorized."
                        },
                        "type": {
                           "type": "string",
                           "example": "https://developer.vonage.com/api-errors#unauthorized"
                        },
                        "code": {
                           "type": "string",
                           "example": "unauthorized"
                        },
                        "detail": {
                           "type": "string",
                           "example": "You did not provide a valid token. Please provide a valid token."
                        }
                     }
                  }
               }
            }
         },
         "ErrorForbidden": {
            "description": "Forbidden",
            "content": {
               "application/json": {
                  "schema": {
                     "type": "object",
                     "properties": {
                        "title": {
                           "type": "string",
                           "example": "Forbidden."
                        },
                        "type": {
                           "type": "string",
                           "example": "https://developer.vonage.com/api-errors#forbidden"
                        },
                        "code": {
                           "type": "string",
                           "example": "forbidden"
                        },
                        "detail": {
                           "type": "string",
                           "example": "No permissions to perform action."
                        }
                     }
                  }
               }
            }
         },
         "ErrorNotFound": {
            "description": "Not Found",
            "content": {
               "application/json": {
                  "schema": {
                     "properties": {
                        "type": {
                           "type": "string",
                           "example": "https://developer.vonage.com/api-errors#not-found"
                        },
                        "title": {
                           "type": "string",
                           "example": "not-found"
                        },
                        "detail": {
                           "type": "string",
                           "example": "Resource not found"
                        }
                     }
                  }
               }
            }
         },
         "ErrorConflict": {
            "description": "Conflict",
            "content": {
               "application/json": {
                  "schema": {
                     "type": "object",
                     "properties": {
                        "title": {
                           "type": "string",
                           "example": "Conflict."
                        },
                        "type": {
                           "type": "string",
                           "example": "https://developer.vonage.com/api/fraud-defender#http:error:conflict"
                        },
                        "code": {
                           "type": "string",
                           "example": "http:error:conflict"
                        },
                        "detail": {
                           "type": "string",
                           "example": "Entity couldn't be added as conflicts with currently existing one"
                        }
                     }
                  }
               }
            }
         },
         "InternalServerError": {
            "description": "Internal Error",
            "content": {
               "application/json": {
                  "schema": {
                     "type": "object",
                     "properties": {
                        "title": {
                           "type": "string",
                           "example": "Internal Error."
                        },
                        "type": {
                           "type": "string",
                           "example": "https://developer.vonage.com/api/fraud-defender#system:error:internal-error"
                        },
                        "code": {
                           "type": "string",
                           "example": "system:error:internal-error"
                        },
                        "detail": {
                           "type": "string",
                           "example": "Something went wrong."
                        }
                     }
                  }
               }
            }
         }
      }
   },
   "x-errors": {
      "http:error:conflict": {
         "description": "Rule couldn't be added as conflicts with currently existing rules"
      },
      "system:error:internal-error": {
         "description": "Something went wrong."
      }
   }
}