Fraud Prevention API

The Fraud Prevention API is a set of APIs supporting Fraud detection including managing own fraud rules.

OpenAPI-Spezifikation herunterladen

Retrieves all networks

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.

gethttps://api.nexmo.com/v2/fraud-defender/networks

Authentifizierung

SchlüsselBeschreibungWoBeispiel
Authorization

Base64-kodierter API-Schlüssel und Geheimnis, verbunden durch einen Doppelpunkt.
Mehr lesen

Headers

Basic <base64>

Abfrage Parameter

name
string
BeispielVodafone UK

Filter by network name

mcc
string
Beispiel234

Filter by Mobile Country Code (MCC)

country_code
string
BeispielGB

Filter by ISO country code - alternative to MCC for identifying country

plmn
string
Beispiel23401

Filter by public land mobile network (PLMN)

Antworten
Inhalt Typ
application/json

Successfully retrieved networks

networks
array
Erforderlich

List of networks

name
string
Erforderlich
BeispielVodafone UK

Network name

mcc
string
Erforderlich
Beispiel234

Mobile Country Code

country_code
string
Erforderlich
BeispielGB

Country code (ISO 3166-1 Alpha-2)

plmns
array
Erforderlich

List of all Public Land Mobile Network codes, including primary and all aliases

_links
object
Erforderlich
self
object
Erforderlich
href
string
Erforderlich

URL to the resource

Beispiel Antwort

{
   "networks": [
      {
         "name": "Vodafone UK",
         "mcc": "234",
         "country_code": "GB",
         "plmns": [
            "23401",
            "23402"
         ]
      }
   ],
   "_links": {
      "self": {
         "href": "string"
      }
   }
}

Retrieve all network traffic rules

Returns a paginated list of network rules. Network rules define blocking rules for specific mobile networks within countries.

gethttps://api.nexmo.com/v2/fraud-defender/rules/networks

Authentifizierung

SchlüsselBeschreibungWoBeispiel
Authorization

Base64-kodierter API-Schlüssel und Geheimnis, verbunden durch einen Doppelpunkt.
Mehr lesen

Headers

Basic <base64>

Abfrage Parameter

product
string
BeispielSMS

Find rules for a specific product

Muss eines der folgenden sein:SMSVOICE
mcc
string
Beispiel234

Find rules for a specific Mobile Country Code (MCC)

country_code
string
BeispielGB

Find rules for a specific ISO country code - alternative to MCC for identifying country

network_name
string
BeispielVodafone UK

Find rules for a specific network name.

plmn
string
Beispiel23401

Find rules for a specific public land mobile network (PLMN). Valid only with status=active, otherwise returns 400 error.

expire_start_date
string(date)
Beispiel2025-08-26

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.

expire_end_date
string(date)
Beispiel2025-08-26

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.

ttl
string
Beispiel1d

Find rules by time to live (TTL). Valid only with status=active, otherwise returns 400 error.

Muss eines der folgenden sein:PERMANENT1d12h6h3h2h1h
sort
string
Standardcreated_at
Beispielcreated_at

Sort by field (product, mcc, country_code, network_name, created_at, expires_at)

Muss eines der folgenden sein:productmcccountry_codenetwork_namecreated_atexpires_at
status
string
Standardactive
Beispielactive

Filter by rule status (active or archived).

Muss eines der folgenden sein:activearchived
order
string
Standarddesc

Sort order (asc or desc)

Muss eines der folgenden sein:ascdesc
page
integer
Min1
Standard1

Page number.

page_size
integer
Min1
Max100
Standard10

Number of items per page

Antworten
Inhalt Typ
application/json

Successfully retrieved network rules

_embedded
object
Erforderlich
rules
array
Erforderlich
id
string(uuid)
Erforderlich
Beispiel3f8208fb-9aa3-4ea4-9a3f-de52a81e36bb

Unique ID of the traffic rule

product
string
Erforderlich
BeispielSMS

Product type for the traffic rule

Muss eines der folgenden sein:SMSVOICE
mcc
string
Erforderlich
Beispiel234

Mobile Country Code

network_name
string
Erforderlich
BeispielVodafone UK

Network name

plmns
array
Erforderlich
reason
string
Erforderlich
Beispielreason for blocks

Reason for the traffic rule action

expires_at
string(date-time)
Beispiel2025-07-01T10:11:22Z

ISO 8601 datetime string in UTC timezone

created_at
string(date-time)
Erforderlich
Beispiel2025-07-01T10:11:22Z

ISO 8601 datetime string in UTC timezone

ttl
string
Erforderlich
Beispiel1d

Time to live for the traffic rule. After this period, the rule will expire and no longer block traffic.

Muss eines der folgenden sein:PERMANENT1d12h6h3h2h1h
archived_at
string(date-time)
Beispiel2025-07-01T10:11:22Z

ISO 8601 datetime string in UTC timezone

_links
object
Erforderlich
next
object
href
string
Erforderlich

URL to the resource

prev
object
href
string
Erforderlich

URL to the resource

self
object
Erforderlich
href
string
Erforderlich

URL to the resource

page
integer
Erforderlich
Min1

Current page number

page_size
integer
Erforderlich
Min1

Number of items per page

total_items
integer
Erforderlich

Total number of elements across all pages

total_pages
integer
Erforderlich

Total number of pages

Beispiel Antwort

{
   "_embedded": {
      "rules": [
         {
            "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",
            "archived_at": "2025-07-01T10:11:22Z"
         }
      ]
   },
   "_links": {
      "next": {
         "href": "string"
      },
      "prev": {
         "href": "string"
      },
      "self": {
         "href": "string"
      }
   },
   "page": 1,
   "page_size": 1,
   "total_items": 0,
   "total_pages": 0
}

Create a new traffic rule for a network

posthttps://api.nexmo.com/v2/fraud-defender/rules/networks

Authentifizierung

SchlüsselBeschreibungWoBeispiel
Authorization

Base64-kodierter API-Schlüssel und Geheimnis, verbunden durch einen Doppelpunkt.
Mehr lesen

Headers

Basic <base64>

Anfrage Körper
Inhalt Typ
application/json

product
string
Erforderlich
BeispielSMS

Product type for the traffic rule

Muss eines der folgenden sein:SMSVOICE
plmn
string
Erforderlich
Beispiel23401

Unique network identifier consisting of Mobile Country Code (MCC) and Mobile Network Code (MNC) with no separators in between

reason
string
Erforderlich
Beispielreason for blocks

Reason for the traffic rule action

ttl
string
Erforderlich
Beispiel1d

Time to live for the traffic rule. After this period, the rule will expire and no longer block traffic.

Muss eines der folgenden sein:PERMANENT1d12h6h3h2h1h

Beispiel Anfrage

{
   "product": "SMS",
   "plmn": "23401",
   "reason": "reason for blocks",
   "ttl": "1d"
}

Antworten
Inhalt Typ
application/json

Rule created

id
string(uuid)
Erforderlich
Beispiel3f8208fb-9aa3-4ea4-9a3f-de52a81e36bb

Unique ID of the traffic rule

product
string
Erforderlich
BeispielSMS

Product type for the traffic rule

Muss eines der folgenden sein:SMSVOICE
mcc
string
Erforderlich
Beispiel234

Mobile Country Code

network_name
string
Erforderlich
BeispielVodafone UK

Network name

plmns
array
Erforderlich
reason
string
Erforderlich
Beispielreason for blocks

Reason for the traffic rule action

expires_at
string(date-time)
Beispiel2025-07-01T10:11:22Z

ISO 8601 datetime string in UTC timezone

created_at
string(date-time)
Erforderlich
Beispiel2025-07-01T10:11:22Z

ISO 8601 datetime string in UTC timezone

ttl
string
Erforderlich
Beispiel1d

Time to live for the traffic rule. After this period, the rule will expire and no longer block traffic.

Muss eines der folgenden sein:PERMANENT1d12h6h3h2h1h

Beispiel Antwort

{
   "id": "3f8208fb-9aa3-4ea4-9a3f-de52a81e36bb",
   "product": "SMS",
   "mcc": "234",
   "network_name": "Vodafone UK",
   "plmns": [
      "23401"
   ],
   "reason": "reason for blocks",
   "expires_at": "string",
   "created_at": "string",
   "ttl": "1d"
}

Update an existing network traffic rule

Updates the details of a specific network traffic rule identified by id. Only the reason for the rule can be modified.

patchhttps://api.nexmo.com/v2/fraud-defender/rules/networks/:id

Authentifizierung

SchlüsselBeschreibungWoBeispiel
Authorization

Base64-kodierter API-Schlüssel und Geheimnis, verbunden durch einen Doppelpunkt.
Mehr lesen

Headers

Basic <base64>

Pfad Parameter

id
string(uuid)
Erforderlich
Beispiel3f8208fb-9aa3-4ea4-9a3f-de52a81e36bb

Anfrage Körper
Inhalt Typ
application/json

reason
string
Erforderlich
Beispielreason for blocks

Reason for the traffic rule action

Beispiel Anfrage

{
   "reason": "reason for blocks"
}

Antworten
Inhalt Typ
application/json

Rule updated

id
string(uuid)
Erforderlich
Beispiel3f8208fb-9aa3-4ea4-9a3f-de52a81e36bb

Unique ID of the traffic rule

product
string
Erforderlich
BeispielSMS

Product type for the traffic rule

Muss eines der folgenden sein:SMSVOICE
mcc
string
Erforderlich
Beispiel234

Mobile Country Code

network_name
string
Erforderlich
BeispielVodafone UK

Network name

plmns
array
Erforderlich
reason
string
Erforderlich
Beispielreason for blocks

Reason for the traffic rule action

expires_at
string(date-time)
Beispiel2025-07-01T10:11:22Z

ISO 8601 datetime string in UTC timezone

created_at
string(date-time)
Erforderlich
Beispiel2025-07-01T10:11:22Z

ISO 8601 datetime string in UTC timezone

ttl
string
Erforderlich
Beispiel1d

Time to live for the traffic rule. After this period, the rule will expire and no longer block traffic.

Muss eines der folgenden sein:PERMANENT1d12h6h3h2h1h

Beispiel Antwort

{
   "id": "3f8208fb-9aa3-4ea4-9a3f-de52a81e36bb",
   "product": "SMS",
   "mcc": "234",
   "network_name": "Vodafone UK",
   "plmns": [
      "23401"
   ],
   "reason": "reason for blocks",
   "expires_at": "string",
   "created_at": "string",
   "ttl": "1d"
}

Archive a network rule

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.

deletehttps://api.nexmo.com/v2/fraud-defender/rules/networks/:id

Authentifizierung

SchlüsselBeschreibungWoBeispiel
Authorization

Base64-kodierter API-Schlüssel und Geheimnis, verbunden durch einen Doppelpunkt.
Mehr lesen

Headers

Basic <base64>

Pfad Parameter

id
string(uuid)
Erforderlich
Beispiel3f8208fb-9aa3-4ea4-9a3f-de52a81e36bb

Antworten

Rule archived (no content returned)

Retrieve all country traffic rules

Returns a complete list of country rules. Country rules define which country-product combinations should have their traffic blocked.

gethttps://api.nexmo.com/v2/fraud-defender/rules/countries

Authentifizierung

SchlüsselBeschreibungWoBeispiel
Authorization

Base64-kodierter API-Schlüssel und Geheimnis, verbunden durch einen Doppelpunkt.
Mehr lesen

Headers

Basic <base64>

Antworten
Inhalt Typ
application/json

A complete list of country-based traffic rules

rules
array
Erforderlich

Complete list of country rules defining which country-product combinations should have their traffic blocked.

product
string
Erforderlich
BeispielSMS

Product type for the traffic rule

Muss eines der folgenden sein:SMSVOICE
country_code
string
Erforderlich
BeispielGB

Country code (ISO 3166-1 Alpha-2)

_links
object
Erforderlich
self
object
Erforderlich
href
string
Erforderlich

URL to the resource

Beispiel Antwort

{
   "rules": [
      {
         "product": "SMS",
         "country_code": "PL"
      }
   ],
   "_links": {
      "self": {
         "href": "string"
      }
   }
}

Replace country rules

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.

puthttps://api.nexmo.com/v2/fraud-defender/rules/countries

Authentifizierung

SchlüsselBeschreibungWoBeispiel
Authorization

Base64-kodierter API-Schlüssel und Geheimnis, verbunden durch einen Doppelpunkt.
Mehr lesen

Headers

Basic <base64>

Anfrage Körper
Inhalt Typ
application/json

rules
array
Erforderlich

Complete list of country rules which should block the traffic. Any existing rules not present in this array will be removed.

product
string
Erforderlich
BeispielSMS

Product type for the traffic rule

Muss eines der folgenden sein:SMSVOICE
country_code
string
Erforderlich
BeispielGB

Country code (ISO 3166-1 Alpha-2)

Beispiel Anfrage

{
   "rules": [
      {
         "product": "SMS",
         "country_code": "PL"
      }
   ]
}

Antworten
Inhalt Typ
application/json

Successfully replaced country rules

rules
array
Erforderlich

Complete list of country rules defining which country-product combinations should have their traffic blocked.

product
string
Erforderlich
BeispielSMS

Product type for the traffic rule

Muss eines der folgenden sein:SMSVOICE
country_code
string
Erforderlich
BeispielGB

Country code (ISO 3166-1 Alpha-2)

Beispiel Antwort

{
   "rules": [
      {
         "product": "SMS",
         "country_code": "PL"
      }
   ]
}

Retrieve all supported countries

Retrieves all supported countries along with their risk levels for fraud detection.

gethttps://api.nexmo.com/v2/fraud-defender/countries

Authentifizierung

SchlüsselBeschreibungWoBeispiel
Authorization

Base64-kodierter API-Schlüssel und Geheimnis, verbunden durch einen Doppelpunkt.
Mehr lesen

Headers

Basic <base64>

Antworten
Inhalt Typ
application/json

Successfully retrieved country data

countries
array
Erforderlich

Complete list of supported countries with their risk levels

country_code
string
Erforderlich
BeispielPL

Country code (ISO 3166-1 Alpha-2)

continent
string
Erforderlich
BeispielEU

Continent code to which the country belongs:

  • AF - Africa
  • AN - Antarctica
  • AS - Asia
  • EU - Europe
  • NA - North America
  • OC - Oceania
  • SA - South America
Muss eines der folgenden sein:AFANASEUNAOCSA
risk
string
StandardNONE
BeispielHIGH

Risk level for fraud detection. When not specified, defaults to NONE. Countries with HIGH risk will have their traffic blocked by default.

Muss eines der folgenden sein:NONEHIGH
_links
object
Erforderlich
self
object
Erforderlich
href
string
Erforderlich

URL to the resource

Beispiel Antwort

{
   "countries": [
      {
         "country_code": "ZM",
         "continent": "AF",
         "risk": "HIGH"
      }
   ],
   "_links": {
      "self": {
         "href": "string"
      }
   }
}

Fehler

Im Folgenden finden Sie eine nicht erschöpfende Liste von Fehlercodes, die bei der Verwendung dieser API auftreten können.

Diese Codes gelten zusätzlich zu unseren generische Fehlercodes.

CodeInformationen
http:error:conflict

Rule couldn't be added as conflicts with currently existing rules

system:error:internal-error

Something went wrong.