Fraud Prevention API

Version 1

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

Download OpenAPI Specification

List custom fraud rules

gethttps://api.nexmo.com/v1/fraud-defender/configuration/custom-rules/:product

Authentication

KeyDescriptionWhereExample
Authorization

Base64 encoded API key and secret joined by a colon.
Read more

Headers

Basic <base64>

Path Parameters

product
string
Required
Must be one of:SMSVOICE

Query Parameters

page_size
integer(int32)
Default100

Page size in Integer format

page
integer(int32)
Default1

Page number in Integer format

threshold
integer(int32)

Threshold value in Integer format

interval
integer(int32)

Interval value in Integer format it will be presented in minutes

countries
array

Array of ISO countries codes

Responses
Content Type
application/json

OK

page
integer(int32)
page_size
integer(int32)
total_pages
integer(int32)
total_items
integer(int32)
_embedded
object
entries
array
country
string
interval
integer(int32)
threshold
integer(int32)
product
string
id
string
_links
object
self
object
href
string
examplehttps://api.nexmo.com/v1/fraud-defender/configuration/custom-rules/SMS/e21ace94-54fa-4365-a824-38033dc06779

self link

_links
object
first
object
href
string
examplehttps://api.nexmo.com/v1/fraud-defender/configuration/custom-rules/SMS?page=0&size=100

first link of the paginated result set

last
object
href
string
examplehttps://api.nexmo.com/v1/fraud-defender/configuration/custom-rules/SMS?page=4&size=100

last link of the paginated result set

prev
object
href
string
examplehttps://api.nexmo.com/v1/fraud-defender/configuration/custom-rules/SMS?page=0&size=100

previous link of the paginated result set

self
object
href
string
examplehttps://api.nexmo.com/v1/fraud-defender/configuration/custom-rules/SMS?page=0&size=100

Example Response

{
   "page": 0,
   "page_size": 0,
   "total_pages": 0,
   "total_items": 0,
   "_embedded": {
      "entries": [
         {
            "country": "string",
            "interval": 0,
            "threshold": 0,
            "product": "string",
            "id": "string",
            "_links": {
               "self": {
                  "href": "https://api.nexmo.com/v1/fraud-defender/configuration/custom-rules/SMS/e21ace94-54fa-4365-a824-38033dc06779"
               }
            }
         }
      ]
   },
   "_links": {
      "first": {
         "href": "https://api.nexmo.com/v1/fraud-defender/configuration/custom-rules/SMS?page=0&size=100"
      },
      "last": {
         "href": "https://api.nexmo.com/v1/fraud-defender/configuration/custom-rules/SMS?page=4&size=100"
      },
      "prev": {
         "href": "https://api.nexmo.com/v1/fraud-defender/configuration/custom-rules/SMS?page=0&size=100"
      },
      "self": {
         "href": "https://api.nexmo.com/v1/fraud-defender/configuration/custom-rules/SMS?page=0&size=100"
      }
   }
}

Edit custom fraud rule by ID

puthttps://api.nexmo.com/v1/fraud-defender/configuration/custom-rules/:id

Authentication

KeyDescriptionWhereExample
Authorization

Base64 encoded API key and secret joined by a colon.
Read more

Headers

Basic <base64>

Path Parameters

Request Body
Content Type
application/json

product

Product type (SMS or VOICE)

country
string

ISO country code

interval
integer(int32)

Interval in minutes. Supported values:

  • 1 min: 1
  • 5 min: 5
  • 10 min: 10
  • 15 min: 15
  • 30 min: 30
  • 45 min: 45
  • 1 hour: 60
  • 6 hour: 360
  • 12 hour: 720
  • One day: 1440
Must be one of:1510153045603607201440
threshold
integer(int32)

Example Request

{
   "product": null,
   "country": "string",
   "interval": 1,
   "threshold": 0
}

Responses
Content Type
application/json

OK

country
string
interval
integer(int32)
threshold
integer(int32)
product
string
id
string
_links
object
self
object
href
string
examplehttps://api.nexmo.com/v1/fraud-defender/configuration/custom-rules/SMS/e21ace94-54fa-4365-a824-38033dc06779

self link

Example Response

{
   "country": "string",
   "interval": 0,
   "threshold": 0,
   "product": "string",
   "id": "string",
   "_links": {
      "self": {
         "href": "https://api.nexmo.com/v1/fraud-defender/configuration/custom-rules/SMS/e21ace94-54fa-4365-a824-38033dc06779"
      }
   }
}

Create custom fraud rule

posthttps://api.nexmo.com/v1/fraud-defender/configuration/custom-rules

Authentication

KeyDescriptionWhereExample
Authorization

Base64 encoded API key and secret joined by a colon.
Read more

Headers

Basic <base64>

Request Body
Content Type
application/json

product

Product type (SMS or VOICE)

country
string

ISO country code

interval
integer(int32)

Interval in minutes. Supported values:

  • 1 min: 1
  • 5 min: 5
  • 10 min: 10
  • 15 min: 15
  • 30 min: 30
  • 45 min: 45
  • 1 hour: 60
  • 6 hour: 360
  • 12 hour: 720
  • One day: 1440
Must be one of:1510153045603607201440
threshold
integer(int32)

Example Request

{
   "product": null,
   "country": "string",
   "interval": 1,
   "threshold": 0
}

Responses
Content Type
application/json

Created

country
string
interval
integer(int32)
threshold
integer(int32)
product
string
id
string
_links
object
self
object
href
string
examplehttps://api.nexmo.com/v1/fraud-defender/configuration/custom-rules/SMS/e21ace94-54fa-4365-a824-38033dc06779

self link

Example Response

{
   "country": "string",
   "interval": 0,
   "threshold": 0,
   "product": "string",
   "id": "string",
   "_links": {
      "self": {
         "href": "https://api.nexmo.com/v1/fraud-defender/configuration/custom-rules/SMS/e21ace94-54fa-4365-a824-38033dc06779"
      }
   }
}

Get custom fraud rule by product and id

gethttps://api.nexmo.com/v1/fraud-defender/configuration/custom-rules/:product/:id

Authentication

KeyDescriptionWhereExample
Authorization

Base64 encoded API key and secret joined by a colon.
Read more

Headers

Basic <base64>

Path Parameters

product
string
Required
Must be one of:SMSVOICE
id
string
Required

Rule ID in UUID format

Responses
Content Type
application/json

OK

country
string
interval
integer(int32)
threshold
integer(int32)
product
string
id
string
_links
object
self
object
href
string
examplehttps://api.nexmo.com/v1/fraud-defender/configuration/custom-rules/SMS/e21ace94-54fa-4365-a824-38033dc06779

self link

Example Response

{
   "country": "string",
   "interval": 0,
   "threshold": 0,
   "product": "string",
   "id": "string",
   "_links": {
      "self": {
         "href": "https://api.nexmo.com/v1/fraud-defender/configuration/custom-rules/SMS/e21ace94-54fa-4365-a824-38033dc06779"
      }
   }
}

Delete custom fraud rule by ID

deletehttps://api.nexmo.com/v1/fraud-defender/configuration/custom-rules/:product/:id

Authentication

KeyDescriptionWhereExample
Authorization

Base64 encoded API key and secret joined by a colon.
Read more

Headers

Basic <base64>

Path Parameters

product
string
Required
Must be one of:SMSVOICE
id
string
Required

Rule ID in UUID format

Responses

No Content

Errors

The following is a non-exhaustive list of error codes that may occur while using this API.

These codes are in addition to any of our generic error codes.

CodeInformation
http:error:conflict

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

system:error:internal-error

Something went wrong.