Fraud Defender API
The Fraud Defender API is a set of APIs supporting Fraud detection including managing own fraud rules. For more details, please visit the Vonage Developer Center.
Available Operations
Authentication
| Key | Description | Where | Example |
|---|---|---|---|
| Authorization | Base64 encoded API key and secret joined by a colon. | Headers | Basic <base64> |
smsvoicesms1544The prefix attribute is used to check whether a phone number begins with a particular sequence of digits. It's not related to phone number prefixes.
My custom prefix ruleHuman readable reason
blockblockallowactiveactivearchivedallExample Request
{
"product": "sms",
"prefix": "44",
"reason": "My custom prefix rule",
"action": "block",
"status": "active"
}{
"product": "sms",
"prefix": "44",
"reason": "My custom prefix rule",
"action": "block",
"status": "active"
}test-idsmsvoicesms1544The prefix attribute is used to check whether a phone number begins with a particular sequence of digits. It's not related to phone number prefixes.
fromfromtooutboundoutboundOutbound rules apply to traffic generated from you API Key. Inbound rules apply to traffic sent to your phone numbers.
blockblockallowMy custom prefix ruleHuman readable reason
editvieweditactiveactivearchivedall2022-12-09T18:19:262022-11-09T18:19:262022-10-09T18:19:26HAL Links object
A single HAL link object
https://api.vonage.com/v1/resources/abc123The URL for the resource
Indicates if the href is a URI template
application/jsonMedia type hint for the target resource
resource-nameSecondary key for selecting link objects
Resource TitleHuman-readable title for the link
Example Response
{
"id": "test-id",
"product": "sms",
"prefix": "44",
"direction": "from",
"traffic_direction": "outbound",
"action": "block",
"reason": "My custom prefix rule",
"permission": "edit",
"status": "active",
"created_timestamp": "2022-12-09T18:19:26",
"updated_timestamp": "2022-11-09T18:19:26",
"archived_timestamp": "2022-10-09T18:19:26",
"_links": {
"self": {
"href": "https://api.nexmo.com/v1/fraud-defender/rules/test-id"
}
}
}Authentication
| Key | Description | Where | Example |
|---|---|---|---|
| Authorization | Base64 encoded API key and secret joined by a colon. | Headers | Basic <base64> |
Query Parameters
smsif passed, lists rules for that product. if not, gives such for all product types
voicesms1544phone prefix filter
My custom prefix rulereason filter
blockaction filter
blockallowrule type filter (allow, block)
allowblockactivefilter rules by status (active, archived, all)
activearchivedalltruedefines whether to display default rules or not
trueshow custom rules flag
10Page size in Integer format
12Page number in Integer format
sort by product, prefix or traffic and it's case-insensitive
productprefixtrafficdescsort order either asc or desc and it's case-insensitive
ascdescHAL Links object
A single HAL link object
https://api.vonage.com/v1/resources/abc123The URL for the resource
Indicates if the href is a URI template
application/jsonMedia type hint for the target resource
resource-nameSecondary key for selecting link objects
Resource TitleHuman-readable title for the link
10Items per page
12Page Offset
1100Number of pages in the entire result set
100Number of items in the entire result set
test-idsmsvoicesms1544The prefix attribute is used to check whether a phone number begins with a particular sequence of digits. It's not related to phone number prefixes.
fromfromtooutboundoutboundOutbound rules apply to traffic generated from you API Key. Inbound rules apply to traffic sent to your phone numbers.
blockblockallowMy custom prefix ruleHuman readable reason
editvieweditactiveactivearchivedall2022-12-09T18:19:262022-11-09T18:19:262022-10-09T18:19:26HAL Links object
A single HAL link object
https://api.vonage.com/v1/resources/abc123The URL for the resource
Indicates if the href is a URI template
application/jsonMedia type hint for the target resource
resource-nameSecondary key for selecting link objects
Resource TitleHuman-readable title for the link
Example Response
{
"links": {
"first": {
"href": "https://api.nexmo.com/v1/fraud-defender/rules?order=asc&page=1&page_size=3"
},
"last": {
"href": "https://api.nexmo.com/v1/fraud-defender/rules?order=asc&page=4&page_size=3"
},
"next": {
"href": "https://api.nexmo.com/v1/fraud-defender/rules?order=asc&page=3&page_size=3"
},
"prev": {
"href": "https://api.nexmo.com/v1/fraud-defender/rules?order=asc&page=1&page_size=3"
},
"self": {
"href": "https://api.nexmo.com/v1/fraud-defender/rules?order=asc&page=2&page_size=3"
}
},
"page": {
"page_size": 10,
"page": 2,
"total_pages": 100,
"total_items": 100
},
"_embedded": {
"rules": [
{
"id": "test-id",
"product": "sms",
"prefix": "44",
"direction": "from",
"traffic_direction": "outbound",
"action": "block",
"reason": "My custom prefix rule",
"permission": "edit",
"status": "active",
"created_timestamp": "2022-12-09T18:19:26",
"updated_timestamp": "2022-11-09T18:19:26",
"archived_timestamp": "2022-10-09T18:19:26",
"_links": {
"self": {
"href": "https://api.nexmo.com/v1/fraud-defender/rules/test-id"
}
}
}
]
}
}Authentication
| Key | Description | Where | Example |
|---|---|---|---|
| Authorization | Base64 encoded API key and secret joined by a colon. | Headers | Basic <base64> |
test-idsmsvoicesms1544The prefix attribute is used to check whether a phone number begins with a particular sequence of digits. It's not related to phone number prefixes.
fromfromtooutboundoutboundOutbound rules apply to traffic generated from you API Key. Inbound rules apply to traffic sent to your phone numbers.
blockblockallowMy custom prefix ruleHuman readable reason
editvieweditactiveactivearchivedall2022-12-09T18:19:262022-11-09T18:19:262022-10-09T18:19:26HAL Links object
A single HAL link object
https://api.vonage.com/v1/resources/abc123The URL for the resource
Indicates if the href is a URI template
application/jsonMedia type hint for the target resource
resource-nameSecondary key for selecting link objects
Resource TitleHuman-readable title for the link
Example Response
{
"id": "test-id",
"product": "sms",
"prefix": "44",
"direction": "from",
"traffic_direction": "outbound",
"action": "block",
"reason": "My custom prefix rule",
"permission": "edit",
"status": "active",
"created_timestamp": "2022-12-09T18:19:26",
"updated_timestamp": "2022-11-09T18:19:26",
"archived_timestamp": "2022-10-09T18:19:26",
"_links": {
"self": {
"href": "https://api.nexmo.com/v1/fraud-defender/rules/test-id"
}
}
}Authentication
| Key | Description | Where | Example |
|---|---|---|---|
| Authorization | Base64 encoded API key and secret joined by a colon. | Headers | Basic <base64> |
Authentication
| Key | Description | Where | Example |
|---|---|---|---|
| Authorization | Base64 encoded API key and secret joined by a colon. | Headers | Basic <base64> |
My custom prefix ruleHuman readable reason
Example Request
{
"reason": "My custom prefix rule"
}{
"reason": "My custom prefix rule"
}test-idsmsvoicesms1544The prefix attribute is used to check whether a phone number begins with a particular sequence of digits. It's not related to phone number prefixes.
fromfromtooutboundoutboundOutbound rules apply to traffic generated from you API Key. Inbound rules apply to traffic sent to your phone numbers.
blockblockallowMy custom prefix ruleHuman readable reason
editvieweditactiveactivearchivedall2022-12-09T18:19:262022-11-09T18:19:262022-10-09T18:19:26HAL Links object
A single HAL link object
https://api.vonage.com/v1/resources/abc123The URL for the resource
Indicates if the href is a URI template
application/jsonMedia type hint for the target resource
resource-nameSecondary key for selecting link objects
Resource TitleHuman-readable title for the link
Example Response
{
"id": "test-id",
"product": "sms",
"prefix": "44",
"direction": "from",
"traffic_direction": "outbound",
"action": "block",
"reason": "My custom prefix rule",
"permission": "edit",
"status": "active",
"created_timestamp": "2022-12-09T18:19:26",
"updated_timestamp": "2022-11-09T18:19:26",
"archived_timestamp": "2022-10-09T18:19:26",
"_links": {
"self": {
"href": "https://api.nexmo.com/v1/fraud-defender/rules/test-id"
}
}
}Available Operations
Authentication
| Key | Description | Where | Example |
|---|---|---|---|
| Authorization | Base64 encoded API key and secret joined by a colon. | Headers | Basic <base64> |
trueused to turn on/off AIT protection
standardRequired if protection_enabled is set to true. Default AIT protection level will be used for countries where no specific per-country configuration exists.
highstandardnonearray of specific per-country AIT protection level configurations
UScountry code in ISO 3166-1 Alpha-2 standard
highAIT protection level
highstandardnoneHAL Links object
A single HAL link object
https://api.vonage.com/v1/resources/abc123The URL for the resource
Indicates if the href is a URI template
application/jsonMedia type hint for the target resource
resource-nameSecondary key for selecting link objects
Resource TitleHuman-readable title for the link
Example Response
{
"data": {
"protection_enabled": true,
"default_protection_level": "standard",
"protection_level_per_country": [
{
"country": "US",
"protection_level": "high"
}
],
"_links": {
"self": {
"href": "https://api.nexmo.com/v1/fraud-defender/configurations/protections/ait/SMS"
}
}
}
}Authentication
| Key | Description | Where | Example |
|---|---|---|---|
| Authorization | Base64 encoded API key and secret joined by a colon. | Headers | Basic <base64> |
trueused to turn on/off AIT protection
standardRequired if protection_enabled is set to true. Default AIT protection level will be used for countries where no specific per-country configuration exists.
highstandardnonearray of specific per-country AIT protection level configurations
UScountry code in ISO 3166-1 Alpha-2 standard
highAIT protection level
highstandardnoneExample Request
{
"data": {
"protection_enabled": true,
"default_protection_level": "standard",
"protection_level_per_country": [
{
"country": "US",
"protection_level": "high"
}
]
}
}{
"data": {
"protection_enabled": true,
"default_protection_level": "standard",
"protection_level_per_country": [
{
"country": "US",
"protection_level": "high"
}
]
}
}trueused to turn on/off AIT protection
standardRequired if protection_enabled is set to true. Default AIT protection level will be used for countries where no specific per-country configuration exists.
highstandardnonearray of specific per-country AIT protection level configurations
UScountry code in ISO 3166-1 Alpha-2 standard
highAIT protection level
highstandardnoneHAL Links object
A single HAL link object
https://api.vonage.com/v1/resources/abc123The URL for the resource
Indicates if the href is a URI template
application/jsonMedia type hint for the target resource
resource-nameSecondary key for selecting link objects
Resource TitleHuman-readable title for the link
Example Response
{
"data": {
"protection_enabled": true,
"default_protection_level": "standard",
"protection_level_per_country": [
{
"country": "US",
"protection_level": "high"
}
],
"_links": {
"self": {
"href": "https://api.nexmo.com/v1/fraud-defender/configurations/protections/ait/SMS"
}
}
}
}Authentication
| Key | Description | Where | Example |
|---|---|---|---|
| Authorization | Base64 encoded API key and secret joined by a colon. | Headers | Basic <base64> |
10Items per page
12Page Offset
1100Number of pages in the entire result set
100Number of items in the entire result set
abcdef01-2345-6789-abcd-ef0123456789Internal ID, to be used as the ID when updating or deleting a record
List of destination countries
DZ,AZ,BD,BB,BY,BJ,BG,EG,SV,GH,KZ,KG,LA,MV,MM,NG,PH,PK,PS,RU,LK,SD,SY,TJ,AE,UZ,BH,IR,IQ,IL,JO,KW,LB,OM,QA,SA,YE1Number of messages allowed in the 10 minutes time period, after which messages will be blocked.
HAL Links object
A single HAL link object
https://api.vonage.com/v1/resources/abc123The URL for the resource
Indicates if the href is a URI template
application/jsonMedia type hint for the target resource
resource-nameSecondary key for selecting link objects
Resource TitleHuman-readable title for the link
HAL Links object
A single HAL link object
https://api.vonage.com/v1/resources/abc123The URL for the resource
Indicates if the href is a URI template
application/jsonMedia type hint for the target resource
resource-nameSecondary key for selecting link objects
Resource TitleHuman-readable title for the link
Example Response
{
"page": {
"page_size": 10,
"page": 2,
"total_pages": 100,
"total_items": 100
},
"_embedded": {
"entries": [
{
"id": "abcdef01-2345-6789-abcd-ef0123456789",
"destination_countries": [
"DZ"
],
"block_value": 1,
"_links": {
"self": {
"href": "https://api.nexmo.com/v1/fraud-defender/protection-configuration/absolute-burst/abcdef01-2345-6789-abcd-ef0123456789"
}
}
}
]
},
"links": {
"first": {
"href": "https://api.nexmo.com/v1/fraud-defender/protection-configuration/absolute-burst?page=1&size=100"
},
"last": {
"href": "https://api.nexmo.com/v1/fraud-defender/protection-configuration/absolute-burst?page=4&size=100"
},
"prev": {
"href": "https://api.nexmo.com/v1/fraud-defender/protection-configuration/absolute-burst?page=1&size=100"
},
"self": {
"href": "https://api.nexmo.com/v1/fraud-defender/protection-configuration/absolute-burst?page=1&size=100"
}
}
}Authentication
| Key | Description | Where | Example |
|---|---|---|---|
| Authorization | Base64 encoded API key and secret joined by a colon. | Headers | Basic <base64> |
DZ,AZ,BD,BB,BY,BJ,BG,EG,SV,GH,KZ,KG,LA,MV,MM,NG,PH,PK,PS,RU,LK,SD,SY,TJ,AE,UZ,BH,IR,IQ,IL,JO,KW,LB,OM,QA,SA,YE1Number of messages allowed in the 10 minutes time period, after which messages will be blocked.
Example Request
{
"destination_countries": [
"DZ"
],
"block_value": 1
}{
"destination_countries": [
"DZ"
],
"block_value": 1
}abcdef01-2345-6789-abcd-ef0123456789Internal ID, to be used as the ID when updating or deleting a record
List of destination countries
DZ,AZ,BD,BB,BY,BJ,BG,EG,SV,GH,KZ,KG,LA,MV,MM,NG,PH,PK,PS,RU,LK,SD,SY,TJ,AE,UZ,BH,IR,IQ,IL,JO,KW,LB,OM,QA,SA,YE1Number of messages allowed in the 10 minutes time period, after which messages will be blocked.
HAL Links object
A single HAL link object
https://api.vonage.com/v1/resources/abc123The URL for the resource
Indicates if the href is a URI template
application/jsonMedia type hint for the target resource
resource-nameSecondary key for selecting link objects
Resource TitleHuman-readable title for the link
Example Response
{
"id": "abcdef01-2345-6789-abcd-ef0123456789",
"destination_countries": [
"DZ"
],
"block_value": 1,
"_links": {
"self": {
"href": "https://api.nexmo.com/v1/fraud-defender/protection-configuration/absolute-burst/abcdef01-2345-6789-abcd-ef0123456789"
}
}
}Authentication
| Key | Description | Where | Example |
|---|---|---|---|
| Authorization | Base64 encoded API key and secret joined by a colon. | Headers | Basic <base64> |
abcdef01-2345-6789-abcd-ef0123456789Internal ID, to be used as the ID when updating or deleting a record
List of destination countries
DZ,AZ,BD,BB,BY,BJ,BG,EG,SV,GH,KZ,KG,LA,MV,MM,NG,PH,PK,PS,RU,LK,SD,SY,TJ,AE,UZ,BH,IR,IQ,IL,JO,KW,LB,OM,QA,SA,YE1Number of messages allowed in the 10 minutes time period, after which messages will be blocked.
HAL Links object
A single HAL link object
https://api.vonage.com/v1/resources/abc123The URL for the resource
Indicates if the href is a URI template
application/jsonMedia type hint for the target resource
resource-nameSecondary key for selecting link objects
Resource TitleHuman-readable title for the link
Example Response
{
"id": "abcdef01-2345-6789-abcd-ef0123456789",
"destination_countries": [
"DZ"
],
"block_value": 1,
"_links": {
"self": {
"href": "https://api.nexmo.com/v1/fraud-defender/protection-configuration/absolute-burst/abcdef01-2345-6789-abcd-ef0123456789"
}
}
}Authentication
| Key | Description | Where | Example |
|---|---|---|---|
| Authorization | Base64 encoded API key and secret joined by a colon. | Headers | Basic <base64> |
DZ,AZ,BD,BB,BY,BJ,BG,EG,SV,GH,KZ,KG,LA,MV,MM,NG,PH,PK,PS,RU,LK,SD,SY,TJ,AE,UZ,BH,IR,IQ,IL,JO,KW,LB,OM,QA,SA,YE1Number of messages allowed in the 10 minutes time period, after which messages will be blocked.
Example Request
{
"destination_countries": [
"DZ"
],
"block_value": 1
}{
"destination_countries": [
"DZ"
],
"block_value": 1
}abcdef01-2345-6789-abcd-ef0123456789Internal ID, to be used as the ID when updating or deleting a record
List of destination countries
DZ,AZ,BD,BB,BY,BJ,BG,EG,SV,GH,KZ,KG,LA,MV,MM,NG,PH,PK,PS,RU,LK,SD,SY,TJ,AE,UZ,BH,IR,IQ,IL,JO,KW,LB,OM,QA,SA,YE1Number of messages allowed in the 10 minutes time period, after which messages will be blocked.
HAL Links object
A single HAL link object
https://api.vonage.com/v1/resources/abc123The URL for the resource
Indicates if the href is a URI template
application/jsonMedia type hint for the target resource
resource-nameSecondary key for selecting link objects
Resource TitleHuman-readable title for the link
Example Response
{
"id": "abcdef01-2345-6789-abcd-ef0123456789",
"destination_countries": [
"DZ"
],
"block_value": 1,
"_links": {
"self": {
"href": "https://api.nexmo.com/v1/fraud-defender/protection-configuration/absolute-burst/abcdef01-2345-6789-abcd-ef0123456789"
}
}
}Authentication
| Key | Description | Where | Example |
|---|---|---|---|
| Authorization | Base64 encoded API key and secret joined by a colon. | Headers | Basic <base64> |
Authentication
| Key | Description | Where | Example |
|---|---|---|---|
| Authorization | Base64 encoded API key and secret joined by a colon. | Headers | Basic <base64> |
Query Parameters
10Page size in Integer format
12Page number in Integer format
Threshold value in Integer format
Interval value in Integer format it will be presented in minutes
Array of ISO countries codes
10Items per page
12Page Offset
1100Number of pages in the entire result set
100Number of items in the entire result set
GB60100smsvoicesmsabcdef01-2345-6789-abcd-ef0123456789HAL Links object
A single HAL link object
https://api.vonage.com/v1/resources/abc123The URL for the resource
Indicates if the href is a URI template
application/jsonMedia type hint for the target resource
resource-nameSecondary key for selecting link objects
Resource TitleHuman-readable title for the link
HAL Links object
A single HAL link object
https://api.vonage.com/v1/resources/abc123The URL for the resource
Indicates if the href is a URI template
application/jsonMedia type hint for the target resource
resource-nameSecondary key for selecting link objects
Resource TitleHuman-readable title for the link
Example Response
{
"page": {
"page_size": 10,
"page": 2,
"total_pages": 100,
"total_items": 100
},
"_embedded": {
"entries": [
{
"country": "GB",
"interval": 60,
"threshold": 100,
"product": "sms",
"id": "abcdef01-2345-6789-abcd-ef0123456789",
"_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=1&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=1&size=100"
},
"self": {
"href": "https://api.nexmo.com/v1/fraud-defender/configuration/custom-rules/SMS?page=1&size=100"
}
}
}Authentication
| Key | Description | Where | Example |
|---|---|---|---|
| Authorization | Base64 encoded API key and secret joined by a colon. | Headers | Basic <base64> |
smsvoicesmsGBISO country code
360Interval 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
1510153045603607201440100Example Request
{
"product": "sms",
"country": "GB",
"interval": 360,
"threshold": 100
}{
"product": "sms",
"country": "GB",
"interval": 360,
"threshold": 100
}GB60100smsvoicesmsabcdef01-2345-6789-abcd-ef0123456789HAL Links object
A single HAL link object
https://api.vonage.com/v1/resources/abc123The URL for the resource
Indicates if the href is a URI template
application/jsonMedia type hint for the target resource
resource-nameSecondary key for selecting link objects
Resource TitleHuman-readable title for the link
Example Response
{
"country": "GB",
"interval": 60,
"threshold": 100,
"product": "sms",
"id": "abcdef01-2345-6789-abcd-ef0123456789",
"_links": {
"self": {
"href": "https://api.nexmo.com/v1/fraud-defender/configuration/custom-rules/SMS/e21ace94-54fa-4365-a824-38033dc06779"
}
}
}Authentication
| Key | Description | Where | Example |
|---|---|---|---|
| Authorization | Base64 encoded API key and secret joined by a colon. | Headers | Basic <base64> |
smsvoicesmsGBISO country code
360Interval 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
1510153045603607201440100Example Request
{
"product": "sms",
"country": "GB",
"interval": 360,
"threshold": 100
}{
"product": "sms",
"country": "GB",
"interval": 360,
"threshold": 100
}GB60100smsvoicesmsabcdef01-2345-6789-abcd-ef0123456789HAL Links object
A single HAL link object
https://api.vonage.com/v1/resources/abc123The URL for the resource
Indicates if the href is a URI template
application/jsonMedia type hint for the target resource
resource-nameSecondary key for selecting link objects
Resource TitleHuman-readable title for the link
Example Response
{
"country": "GB",
"interval": 60,
"threshold": 100,
"product": "sms",
"id": "abcdef01-2345-6789-abcd-ef0123456789",
"_links": {
"self": {
"href": "https://api.nexmo.com/v1/fraud-defender/configuration/custom-rules/SMS/e21ace94-54fa-4365-a824-38033dc06779"
}
}
}Authentication
| Key | Description | Where | Example |
|---|---|---|---|
| Authorization | Base64 encoded API key and secret joined by a colon. | Headers | Basic <base64> |
GB60100smsvoicesmsabcdef01-2345-6789-abcd-ef0123456789HAL Links object
A single HAL link object
https://api.vonage.com/v1/resources/abc123The URL for the resource
Indicates if the href is a URI template
application/jsonMedia type hint for the target resource
resource-nameSecondary key for selecting link objects
Resource TitleHuman-readable title for the link
Example Response
{
"country": "GB",
"interval": 60,
"threshold": 100,
"product": "sms",
"id": "abcdef01-2345-6789-abcd-ef0123456789",
"_links": {
"self": {
"href": "https://api.nexmo.com/v1/fraud-defender/configuration/custom-rules/SMS/e21ace94-54fa-4365-a824-38033dc06779"
}
}
}Authentication
| Key | Description | Where | Example |
|---|---|---|---|
| Authorization | Base64 encoded API key and secret joined by a colon. | Headers | Basic <base64> |
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.
| Code | Information |
|---|---|
| http:error:conflict | Rule couldn't be added as conflicts with currently existing rules |
| system:error:internal-error | Something went wrong. |
| http:error:validation-fail | There was an issue when validating fields. Please refer to the API specs |
| http:error:bad-request | Bad Request. Please refer to the API specs |