{
   "openapi": "3.0.3",
   "info": {
      "title": "Fraud Defender API",
      "description": "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](https://developer.vonage.com).",
      "version": "1.1.0",
      "contact": {
         "name": "Nexmo DevRel",
         "email": "devrel@nexmo.com",
         "url": "https://developer.nexmo.com/"
      },
      "license": {
         "name": "Apache 2.0",
         "url": "https://www.apache.org/licenses/LICENSE-2.0.html"
      }
   },
   "servers": [
      {
         "url": "https://api.nexmo.com/v1/fraud-defender",
         "description": "API URL"
      }
   ],
   "security": [
      {
         "basicAuth": []
      }
   ],
   "tags": [
      {
         "name": "Traffic Rules",
         "description": "Operations to manage traffic rules."
      },
      {
         "name": "AIT Protection",
         "description": "Operations to manage AIT Protection."
      },
      {
         "name": "SMS Burst Protection",
         "description": "Operations to manage limits on SMS traffic bursts to prevent fraud."
      },
      {
         "name": "Custom Fraud Alerts",
         "description": "Operations to manage thresholds and intervals for custom fraud detection logic."
      }
   ],
   "paths": {
      "/rules": {
         "post": {
            "operationId": "createRule",
            "tags": [
               "Traffic Rules"
            ],
            "summary": "Create rule",
            "description": "Create a new fraud rule based on phone number prefixes.",
            "requestBody": {
               "$ref": "#/components/requestBodies/CreateRuleRequestBody"
            },
            "responses": {
               "201": {
                  "$ref": "#/components/responses/RuleResponse"
               },
               "400": {
                  "$ref": "#/components/responses/400"
               },
               "401": {
                  "$ref": "#/components/responses/401"
               },
               "409": {
                  "$ref": "#/components/responses/409"
               },
               "429": {
                  "$ref": "#/components/responses/429"
               },
               "500": {
                  "$ref": "#/components/responses/500"
               }
            }
         },
         "get": {
            "operationId": "listRules",
            "summary": "Listing rules",
            "description": "List all existing fraud rules with support for filtering by prefix, action, and status.",
            "tags": [
               "Traffic Rules"
            ],
            "parameters": [
               {
                  "$ref": "#/components/parameters/Product"
               },
               {
                  "$ref": "#/components/parameters/Prefix"
               },
               {
                  "$ref": "#/components/parameters/Reason"
               },
               {
                  "$ref": "#/components/parameters/Action"
               },
               {
                  "$ref": "#/components/parameters/RuleType"
               },
               {
                  "$ref": "#/components/parameters/Status"
               },
               {
                  "$ref": "#/components/parameters/ShowDefaultRules"
               },
               {
                  "$ref": "#/components/parameters/ShowCustomRules"
               },
               {
                  "$ref": "#/components/parameters/PageSizeCustom"
               },
               {
                  "$ref": "#/components/parameters/PageCustom"
               },
               {
                  "$ref": "#/components/parameters/Sort"
               },
               {
                  "$ref": "#/components/parameters/Order"
               }
            ],
            "responses": {
               "200": {
                  "$ref": "#/components/responses/RulesPaginatedResponse"
               },
               "400": {
                  "$ref": "#/components/responses/400"
               },
               "401": {
                  "$ref": "#/components/responses/401"
               },
               "429": {
                  "$ref": "#/components/responses/429"
               },
               "500": {
                  "$ref": "#/components/responses/500"
               }
            }
         }
      },
      "/rules/{id}": {
         "get": {
            "operationId": "getRuleById",
            "summary": "Get rule by id",
            "description": "Retrieve a specific fraud rule by its unique ID.",
            "tags": [
               "Traffic Rules"
            ],
            "parameters": [
               {
                  "$ref": "#/components/parameters/IdPath"
               }
            ],
            "responses": {
               "200": {
                  "$ref": "#/components/responses/RuleResponse"
               },
               "400": {
                  "$ref": "#/components/responses/400"
               },
               "401": {
                  "$ref": "#/components/responses/401"
               },
               "404": {
                  "$ref": "#/components/responses/404"
               },
               "429": {
                  "$ref": "#/components/responses/429"
               },
               "500": {
                  "$ref": "#/components/responses/500"
               }
            }
         },
         "delete": {
            "operationId": "archiveRuleById",
            "summary": "Archive rule by id",
            "description": "Mark a rule as archived. Archived rules are no longer active in the fraud detection flow.",
            "tags": [
               "Traffic Rules"
            ],
            "parameters": [
               {
                  "$ref": "#/components/parameters/IdPath"
               }
            ],
            "responses": {
               "204": {
                  "$ref": "#/components/responses/204"
               },
               "400": {
                  "$ref": "#/components/responses/400"
               },
               "401": {
                  "$ref": "#/components/responses/401"
               },
               "429": {
                  "$ref": "#/components/responses/429"
               },
               "500": {
                  "$ref": "#/components/responses/500"
               }
            }
         },
         "patch": {
            "operationId": "updateRuleById",
            "summary": "Update rule by id",
            "description": "Update specific fields of an existing fraud rule.",
            "tags": [
               "Traffic Rules"
            ],
            "parameters": [
               {
                  "$ref": "#/components/parameters/IdPath"
               }
            ],
            "requestBody": {
               "$ref": "#/components/requestBodies/UpdateRuleRequestBody"
            },
            "responses": {
               "200": {
                  "$ref": "#/components/responses/RuleResponse"
               },
               "400": {
                  "$ref": "#/components/responses/400"
               },
               "401": {
                  "$ref": "#/components/responses/401"
               },
               "429": {
                  "$ref": "#/components/responses/429"
               },
               "500": {
                  "$ref": "#/components/responses/500"
               }
            }
         }
      },
      "/configurations/protections/ait/{product}": {
         "get": {
            "operationId": "getAitConfigById",
            "summary": "Get AIT configuration",
            "description": "Retrieve the current AIT protection configuration for a given product.",
            "tags": [
               "AIT Protection"
            ],
            "parameters": [
               {
                  "$ref": "#/components/parameters/ProductAit"
               }
            ],
            "responses": {
               "200": {
                  "$ref": "#/components/responses/AitProtectionResponse"
               },
               "400": {
                  "$ref": "#/components/responses/400"
               },
               "401": {
                  "$ref": "#/components/responses/401"
               },
               "403": {
                  "$ref": "#/components/responses/403"
               },
               "429": {
                  "$ref": "#/components/responses/429"
               },
               "500": {
                  "$ref": "#/components/responses/500"
               }
            }
         },
         "put": {
            "operationId": "createOrUpdateAitConfig",
            "summary": "Create or update AIT configuration",
            "description": "Enable or modify AIT protection settings globally or per country.",
            "tags": [
               "AIT Protection"
            ],
            "parameters": [
               {
                  "$ref": "#/components/parameters/ProductAit"
               }
            ],
            "requestBody": {
               "$ref": "#/components/requestBodies/AitProtectionRequestBody"
            },
            "responses": {
               "200": {
                  "$ref": "#/components/responses/AitProtectionResponse"
               },
               "400": {
                  "$ref": "#/components/responses/400"
               },
               "401": {
                  "$ref": "#/components/responses/401"
               },
               "403": {
                  "$ref": "#/components/responses/403"
               },
               "429": {
                  "$ref": "#/components/responses/429"
               },
               "500": {
                  "$ref": "#/components/responses/500"
               }
            }
         }
      },
      "/protection-configuration/absolute-burst": {
         "get": {
            "tags": [
               "SMS Burst Protection"
            ],
            "summary": "List SMS Burst Protection entries",
            "description": "Retrieve a paginated list of all SMS Burst Protection configurations.",
            "operationId": "getAbsoluteBurstEntries",
            "parameters": [
               {
                  "$ref": "#/components/parameters/PageCustom"
               },
               {
                  "$ref": "#/components/parameters/PageSizeCustom"
               }
            ],
            "responses": {
               "200": {
                  "$ref": "#/components/responses/AbsoluteBurstPaginatedResponse"
               },
               "400": {
                  "$ref": "#/components/responses/400"
               },
               "401": {
                  "$ref": "#/components/responses/401"
               },
               "403": {
                  "$ref": "#/components/responses/403"
               },
               "404": {
                  "$ref": "#/components/responses/404"
               },
               "429": {
                  "$ref": "#/components/responses/429"
               },
               "500": {
                  "$ref": "#/components/responses/500"
               }
            }
         },
         "post": {
            "tags": [
               "SMS Burst Protection"
            ],
            "summary": "Create new SMS Burst Protection entity",
            "description": "Defines a new burst protection limit for a specific set of destination countries.",
            "operationId": "addAbsoluteBurstEntry",
            "requestBody": {
               "$ref": "#/components/requestBodies/AbsoluteBurstRequestBody"
            },
            "responses": {
               "201": {
                  "$ref": "#/components/responses/AbsoluteBurstEntryResponse"
               },
               "400": {
                  "$ref": "#/components/responses/400"
               },
               "401": {
                  "$ref": "#/components/responses/401"
               },
               "403": {
                  "$ref": "#/components/responses/403"
               },
               "409": {
                  "$ref": "#/components/responses/409"
               },
               "429": {
                  "$ref": "#/components/responses/429"
               },
               "500": {
                  "$ref": "#/components/responses/500"
               }
            }
         }
      },
      "/protection-configuration/absolute-burst/{id}": {
         "get": {
            "tags": [
               "SMS Burst Protection"
            ],
            "summary": "Get SMS Burst Protection rule by ID",
            "description": "Fetch a specific burst protection entry using its unique identifier.",
            "operationId": "getAbsoluteBurstEntry",
            "parameters": [
               {
                  "$ref": "#/components/parameters/IdPath"
               }
            ],
            "responses": {
               "200": {
                  "$ref": "#/components/responses/AbsoluteBurstEntryResponse"
               },
               "400": {
                  "$ref": "#/components/responses/400"
               },
               "401": {
                  "$ref": "#/components/responses/401"
               },
               "403": {
                  "$ref": "#/components/responses/403"
               },
               "404": {
                  "$ref": "#/components/responses/404"
               },
               "429": {
                  "$ref": "#/components/responses/429"
               },
               "500": {
                  "$ref": "#/components/responses/500"
               }
            }
         },
         "put": {
            "tags": [
               "SMS Burst Protection"
            ],
            "summary": "Edit an existing SMS Burst Protection rule",
            "operationId": "modifyAbsoluteBurstEntry",
            "parameters": [
               {
                  "$ref": "#/components/parameters/IdPath"
               }
            ],
            "requestBody": {
               "$ref": "#/components/requestBodies/AbsoluteBurstRequestBody"
            },
            "responses": {
               "200": {
                  "$ref": "#/components/responses/AbsoluteBurstEntryResponse"
               },
               "400": {
                  "$ref": "#/components/responses/400"
               },
               "401": {
                  "$ref": "#/components/responses/401"
               },
               "403": {
                  "$ref": "#/components/responses/403"
               },
               "429": {
                  "$ref": "#/components/responses/429"
               },
               "500": {
                  "$ref": "#/components/responses/500"
               }
            }
         },
         "delete": {
            "tags": [
               "SMS Burst Protection"
            ],
            "summary": "Delete SMS Burst Protection entity by id",
            "description": "Remove an SMS burst protection entry from the system.",
            "operationId": "deleteAbsoluteBurstEntry",
            "parameters": [
               {
                  "$ref": "#/components/parameters/IdPath"
               }
            ],
            "responses": {
               "204": {
                  "$ref": "#/components/responses/204"
               },
               "400": {
                  "$ref": "#/components/responses/400"
               },
               "401": {
                  "$ref": "#/components/responses/401"
               },
               "403": {
                  "$ref": "#/components/responses/403"
               },
               "404": {
                  "$ref": "#/components/responses/404"
               },
               "429": {
                  "$ref": "#/components/responses/429"
               },
               "500": {
                  "$ref": "#/components/responses/500"
               }
            }
         }
      },
      "/configuration/custom-rules/{identifier}": {
         "get": {
            "tags": [
               "Custom Fraud Alerts"
            ],
            "summary": "List custom fraud alerts",
            "operationId": "getRules",
            "parameters": [
               {
                  "name": "identifier",
                  "in": "path",
                  "required": true,
                  "schema": {
                     "type": "string",
                     "enum": [
                        "SMS",
                        "VOICE"
                     ]
                  },
                  "example": "SMS"
               },
               {
                  "$ref": "#/components/parameters/PageSizeCustom"
               },
               {
                  "$ref": "#/components/parameters/PageCustom"
               },
               {
                  "$ref": "#/components/parameters/Threshold"
               },
               {
                  "$ref": "#/components/parameters/Interval"
               },
               {
                  "$ref": "#/components/parameters/Countries"
               }
            ],
            "responses": {
               "200": {
                  "$ref": "#/components/responses/CustomRulePaginatedResponse"
               },
               "400": {
                  "$ref": "#/components/responses/400"
               },
               "401": {
                  "$ref": "#/components/responses/401"
               },
               "403": {
                  "$ref": "#/components/responses/403"
               },
               "404": {
                  "$ref": "#/components/responses/404"
               },
               "429": {
                  "$ref": "#/components/responses/429"
               },
               "500": {
                  "$ref": "#/components/responses/500"
               }
            }
         },
         "put": {
            "tags": [
               "Custom Fraud Alerts"
            ],
            "summary": "Edit custom fraud alert by ID",
            "operationId": "updateRule",
            "parameters": [
               {
                  "name": "identifier",
                  "in": "path",
                  "required": true,
                  "schema": {
                     "type": "string"
                  },
                  "example": "abcdef01-2345-6789-abcd-ef0123456789"
               }
            ],
            "requestBody": {
               "$ref": "#/components/requestBodies/CustomRuleRequestBody"
            },
            "responses": {
               "200": {
                  "$ref": "#/components/responses/CustomRuleResponse"
               },
               "400": {
                  "$ref": "#/components/responses/400"
               },
               "401": {
                  "$ref": "#/components/responses/401"
               },
               "403": {
                  "$ref": "#/components/responses/403"
               },
               "404": {
                  "$ref": "#/components/responses/404"
               },
               "429": {
                  "$ref": "#/components/responses/429"
               },
               "500": {
                  "$ref": "#/components/responses/500"
               }
            }
         }
      },
      "/configuration/custom-rules": {
         "post": {
            "tags": [
               "Custom Fraud Alerts"
            ],
            "summary": "Create custom fraud alert",
            "operationId": "addRule",
            "requestBody": {
               "$ref": "#/components/requestBodies/CustomRuleRequestBody"
            },
            "responses": {
               "201": {
                  "$ref": "#/components/responses/CustomRuleResponse"
               },
               "400": {
                  "$ref": "#/components/responses/400"
               },
               "401": {
                  "$ref": "#/components/responses/401"
               },
               "403": {
                  "$ref": "#/components/responses/403"
               },
               "429": {
                  "$ref": "#/components/responses/429"
               },
               "500": {
                  "$ref": "#/components/responses/500"
               }
            }
         }
      },
      "/configuration/custom-rules/{product}/{id}": {
         "get": {
            "tags": [
               "Custom Fraud Alerts"
            ],
            "summary": "Get custom fraud alert by product and id",
            "operationId": "getRule",
            "parameters": [
               {
                  "$ref": "#/components/parameters/ProductPath"
               },
               {
                  "$ref": "#/components/parameters/IdPath"
               }
            ],
            "responses": {
               "200": {
                  "$ref": "#/components/responses/CustomRuleResponse"
               },
               "400": {
                  "$ref": "#/components/responses/400"
               },
               "401": {
                  "$ref": "#/components/responses/401"
               },
               "403": {
                  "$ref": "#/components/responses/403"
               },
               "404": {
                  "$ref": "#/components/responses/404"
               },
               "429": {
                  "$ref": "#/components/responses/429"
               },
               "500": {
                  "$ref": "#/components/responses/500"
               }
            }
         },
         "delete": {
            "tags": [
               "Custom Fraud Alerts"
            ],
            "operationId": "deleteRule",
            "summary": "Delete custom fraud alert by ID",
            "parameters": [
               {
                  "$ref": "#/components/parameters/ProductPath"
               },
               {
                  "$ref": "#/components/parameters/IdPath"
               }
            ],
            "responses": {
               "204": {
                  "$ref": "#/components/responses/204"
               },
               "400": {
                  "$ref": "#/components/responses/400"
               },
               "401": {
                  "$ref": "#/components/responses/401"
               },
               "403": {
                  "$ref": "#/components/responses/403"
               },
               "404": {
                  "$ref": "#/components/responses/404"
               },
               "429": {
                  "$ref": "#/components/responses/429"
               },
               "500": {
                  "$ref": "#/components/responses/500"
               }
            }
         }
      }
   },
   "components": {
      "securitySchemes": {
         "basicAuth": {
            "type": "http",
            "scheme": "basic"
         }
      },
      "parameters": {
         "IdPath": {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Rule ID in UUID format",
            "schema": {
               "type": "string",
               "example": "abcdef01-2345-6789-abcd-ef0123456789"
            }
         },
         "ProductAit": {
            "name": "product",
            "in": "path",
            "description": "product type",
            "required": true,
            "schema": {
               "type": "string",
               "enum": [
                  "sms"
               ],
               "default": "sms"
            }
         },
         "Product": {
            "name": "product",
            "in": "query",
            "description": "if passed, lists rules for that product. if not, gives such for all product types",
            "required": false,
            "schema": {
               "$ref": "#/components/schemas/Product"
            }
         },
         "ProductPath": {
            "name": "product",
            "in": "path",
            "required": true,
            "schema": {
               "$ref": "#/components/schemas/Product"
            }
         },
         "Prefix": {
            "name": "prefix",
            "in": "query",
            "description": "phone prefix filter",
            "schema": {
               "$ref": "#/components/schemas/Prefix"
            },
            "required": false
         },
         "Reason": {
            "name": "reason",
            "in": "query",
            "description": "reason filter",
            "schema": {
               "$ref": "#/components/schemas/Reason"
            },
            "required": false
         },
         "Action": {
            "name": "action",
            "in": "query",
            "description": "action filter",
            "schema": {
               "$ref": "#/components/schemas/Action"
            },
            "required": false
         },
         "RuleType": {
            "name": "rule_type",
            "in": "query",
            "description": "rule type filter (allow, block)",
            "schema": {
               "type": "string",
               "enum": [
                  "allow",
                  "block"
               ]
            },
            "example": "block",
            "required": false
         },
         "Status": {
            "name": "status",
            "in": "query",
            "description": "filter rules by status (active, archived, all)",
            "required": false,
            "schema": {
               "$ref": "#/components/schemas/Status"
            }
         },
         "ShowDefaultRules": {
            "name": "show_default_rules",
            "in": "query",
            "description": "defines whether to display default rules or not",
            "schema": {
               "type": "boolean",
               "default": true
            },
            "example": false,
            "required": false
         },
         "ShowCustomRules": {
            "name": "show_custom_rules",
            "in": "query",
            "description": "show custom rules flag",
            "schema": {
               "type": "boolean",
               "default": true
            },
            "example": false,
            "required": false
         },
         "Sort": {
            "name": "sort",
            "in": "query",
            "description": "sort by product, prefix or traffic and it's case-insensitive",
            "schema": {
               "type": "string",
               "enum": [
                  "product",
                  "prefix",
                  "traffic"
               ]
            },
            "required": false
         },
         "Order": {
            "name": "order",
            "in": "query",
            "description": "sort order either asc or desc and it's case-insensitive",
            "schema": {
               "type": "string",
               "enum": [
                  "asc",
                  "desc"
               ],
               "default": "desc"
            },
            "example": "asc",
            "required": false
         },
         "PageSizeCustom": {
            "name": "page_size",
            "description": "Page size in Integer format",
            "in": "query",
            "required": false,
            "schema": {
               "$ref": "#/components/schemas/PageSize"
            },
            "example": 100
         },
         "PageCustom": {
            "name": "page",
            "description": "Page number in Integer format",
            "in": "query",
            "required": false,
            "schema": {
               "$ref": "#/components/schemas/Page"
            },
            "example": 1
         },
         "Threshold": {
            "name": "threshold",
            "description": "Threshold value in Integer format",
            "in": "query",
            "required": false,
            "schema": {
               "type": "integer",
               "format": "int32"
            },
            "example": 100
         },
         "Interval": {
            "name": "interval",
            "description": "Interval value in Integer format it will be presented in minutes",
            "in": "query",
            "required": false,
            "schema": {
               "type": "integer",
               "format": "int32"
            },
            "example": 60
         },
         "Countries": {
            "name": "countries",
            "description": "Array of ISO countries codes",
            "in": "query",
            "required": false,
            "schema": {
               "type": "array",
               "items": {
                  "type": "string"
               }
            },
            "example": [
               "GB",
               "US"
            ]
         }
      },
      "requestBodies": {
         "AitProtectionRequestBody": {
            "content": {
               "application/json": {
                  "schema": {
                     "type": "object",
                     "properties": {
                        "data": {
                           "$ref": "#/components/schemas/ProtectionConfiguration"
                        }
                     }
                  }
               }
            },
            "required": true
         },
         "CreateRuleRequestBody": {
            "content": {
               "application/json": {
                  "schema": {
                     "type": "object",
                     "properties": {
                        "product": {
                           "$ref": "#/components/schemas/Product"
                        },
                        "prefix": {
                           "$ref": "#/components/schemas/Prefix"
                        },
                        "reason": {
                           "$ref": "#/components/schemas/Reason"
                        },
                        "action": {
                           "$ref": "#/components/schemas/Action"
                        },
                        "status": {
                           "$ref": "#/components/schemas/Status"
                        }
                     },
                     "required": [
                        "product",
                        "prefix",
                        "reason",
                        "action"
                     ]
                  }
               }
            }
         },
         "UpdateRuleRequestBody": {
            "content": {
               "application/json": {
                  "schema": {
                     "type": "object",
                     "required": [
                        "reason"
                     ],
                     "properties": {
                        "reason": {
                           "$ref": "#/components/schemas/Reason"
                        }
                     }
                  }
               }
            }
         },
         "AbsoluteBurstRequestBody": {
            "content": {
               "application/json": {
                  "schema": {
                     "required": [
                        "destination_countries",
                        "block_value"
                     ],
                     "type": "object",
                     "properties": {
                        "destination_countries": {
                           "type": "array",
                           "items": {
                              "$ref": "#/components/schemas/AbsoluteBurstSupportedCountry"
                           }
                        },
                        "block_value": {
                           "type": "integer",
                           "description": "Number of messages allowed in the 10 minutes time period, after which messages will be blocked.",
                           "example": 1
                        }
                     }
                  }
               }
            },
            "required": true
         },
         "CustomRuleRequestBody": {
            "content": {
               "application/json": {
                  "schema": {
                     "type": "object",
                     "properties": {
                        "product": {
                           "$ref": "#/components/schemas/Product"
                        },
                        "country": {
                           "description": "ISO country code",
                           "type": "string",
                           "example": "GB"
                        },
                        "interval": {
                           "type": "integer",
                           "format": "int32",
                           "description": "Interval in minutes. Supported values:\n- 1 min: 1\n- 5 min: 5\n- 10 min: 10\n- 15 min: 15\n- 30 min: 30\n- 45 min: 45\n- 1 hour: 60\n- 6 hour: 360\n- 12 hour: 720\n- One day: 1440\n",
                           "enum": [
                              1,
                              5,
                              10,
                              15,
                              30,
                              45,
                              60,
                              360,
                              720,
                              1440
                           ],
                           "example": 360
                        },
                        "threshold": {
                           "type": "integer",
                           "format": "int32",
                           "example": 100
                        }
                     }
                  }
               }
            },
            "required": true
         }
      },
      "responses": {
         "204": {
            "description": "No Content - Resource successfully deleted",
            "headers": {
               "X-Request-Id": {
                  "$ref": "#/components/headers/X-Request-Id"
               }
            }
         },
         "400": {
            "description": "Bad Request",
            "headers": {
               "X-Request-Id": {
                  "$ref": "#/components/headers/X-Request-Id"
               }
            },
            "content": {
               "application/problem+json": {
                  "schema": {
                     "$ref": "#/components/schemas/ErrorResponseWithInvalidParameters"
                  }
               }
            }
         },
         "401": {
            "description": "Authentication failure",
            "headers": {
               "X-Request-Id": {
                  "$ref": "#/components/headers/X-Request-Id"
               }
            },
            "content": {
               "application/problem+json": {
                  "schema": {
                     "oneOf": [
                        {
                           "description": "Missing or Invalid Credentials",
                           "type": "object",
                           "required": [
                              "type",
                              "title",
                              "instance"
                           ],
                           "properties": {
                              "type": {
                                 "type": "string",
                                 "description": "Link to error / remediation options",
                                 "example": "https://developer.vonage.com/api-errors/#unathorized"
                              },
                              "title": {
                                 "type": "string",
                                 "description": "Generic error message",
                                 "example": "You did not provide correct credentials."
                              },
                              "detail": {
                                 "type": "string",
                                 "description": "Additional information about the error",
                                 "example": "Check that you're using the correct credentials, and that your account has this feature enabled"
                              },
                              "instance": {
                                 "type": "string",
                                 "description": "Internal Trace ID",
                                 "example": "bf0ca0bf927b3b52e3cb03217e1a1ddf"
                              }
                           }
                        },
                        {
                           "description": "Invalid Application Type",
                           "type": "object",
                           "required": [
                              "type",
                              "title",
                              "instance"
                           ],
                           "properties": {
                              "type": {
                                 "type": "string",
                                 "description": "Link to error / remediation options",
                                 "example": "https://developer.vonage.com/api-errors/#unprovisioned"
                              },
                              "title": {
                                 "type": "string",
                                 "description": "Generic error message",
                                 "example": "The crendentials provided do not have access to the requested product"
                              },
                              "detail": {
                                 "type": "string",
                                 "description": "Additional information about the error",
                                 "example": "Check your API key is correct and has been whitelisted"
                              },
                              "instance": {
                                 "type": "string",
                                 "description": "Internal Trace ID",
                                 "example": "bf0ca0bf927b3b52e3cb03217e1a1ddf"
                              }
                           }
                        }
                     ]
                  }
               }
            }
         },
         "403": {
            "description": "Forbidden",
            "headers": {
               "X-Request-Id": {
                  "$ref": "#/components/headers/X-Request-Id"
               }
            },
            "content": {
               "application/problem+json": {
                  "schema": {
                     "$ref": "#/components/schemas/ErrorResponse"
                  }
               }
            }
         },
         "404": {
            "description": "Not Found",
            "headers": {
               "X-Request-Id": {
                  "$ref": "#/components/headers/X-Request-Id"
               }
            },
            "content": {
               "application/problem+json": {
                  "schema": {
                     "$ref": "#/components/schemas/ErrorResponse"
                  }
               }
            }
         },
         "409": {
            "description": "Conflict",
            "headers": {
               "X-Request-Id": {
                  "$ref": "#/components/headers/X-Request-Id"
               }
            },
            "content": {
               "application/problem+json": {
                  "schema": {
                     "$ref": "#/components/schemas/ErrorResponse"
                  }
               }
            }
         },
         "429": {
            "description": "Too Many Requests",
            "headers": {
               "X-Request-Id": {
                  "$ref": "#/components/headers/X-Request-Id"
               },
               "X-RateLimit-Limit": {
                  "$ref": "#/components/headers/X-RateLimit-Limit"
               },
               "X-RateLimit-Remaining": {
                  "$ref": "#/components/headers/X-RateLimit-Remaining"
               },
               "X-RateLimit-Reset": {
                  "$ref": "#/components/headers/X-RateLimit-Reset"
               },
               "Retry-After": {
                  "$ref": "#/components/headers/Retry-After"
               }
            },
            "content": {
               "application/problem+json": {
                  "schema": {
                     "$ref": "#/components/schemas/ErrorResponse"
                  }
               }
            }
         },
         "500": {
            "description": "Internal error",
            "headers": {
               "X-Request-Id": {
                  "$ref": "#/components/headers/X-Request-Id"
               }
            },
            "content": {
               "application/problem+json": {
                  "schema": {
                     "$ref": "#/components/schemas/ErrorResponse"
                  }
               }
            }
         },
         "AitProtectionResponse": {
            "description": "AIT protection config response",
            "headers": {
               "X-Request-Id": {
                  "$ref": "#/components/headers/X-Request-Id"
               }
            },
            "content": {
               "application/json": {
                  "schema": {
                     "type": "object",
                     "properties": {
                        "data": {
                           "allOf": [
                              {
                                 "$ref": "#/components/schemas/ProtectionConfiguration"
                              },
                              {
                                 "type": "object",
                                 "properties": {
                                    "_links": {
                                       "allOf": [
                                          {
                                             "$ref": "#/components/schemas/_links"
                                          }
                                       ],
                                       "example": {
                                          "self": {
                                             "href": "https://api.nexmo.com/v1/fraud-defender/configurations/protections/ait/SMS"
                                          }
                                       }
                                    }
                                 }
                              }
                           ]
                        }
                     }
                  }
               }
            }
         },
         "RuleResponse": {
            "description": "rule operation success",
            "headers": {
               "X-Request-Id": {
                  "$ref": "#/components/headers/X-Request-Id"
               }
            },
            "content": {
               "application/json": {
                  "schema": {
                     "$ref": "#/components/schemas/TrafficRule"
                  }
               }
            }
         },
         "RulesPaginatedResponse": {
            "description": "rule listing success",
            "headers": {
               "X-Request-Id": {
                  "$ref": "#/components/headers/X-Request-Id"
               }
            },
            "content": {
               "application/json": {
                  "schema": {
                     "type": "object",
                     "properties": {
                        "links": {
                           "allOf": [
                              {
                                 "$ref": "#/components/schemas/_links"
                              }
                           ],
                           "example": {
                              "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": {
                           "$ref": "#/components/schemas/PagedResponse"
                        },
                        "_embedded": {
                           "type": "object",
                           "properties": {
                              "rules": {
                                 "type": "array",
                                 "items": {
                                    "$ref": "#/components/schemas/TrafficRule"
                                 }
                              }
                           }
                        }
                     }
                  }
               }
            }
         },
         "AbsoluteBurstPaginatedResponse": {
            "description": "Successful operation",
            "headers": {
               "X-Request-Id": {
                  "$ref": "#/components/headers/X-Request-Id"
               }
            },
            "content": {
               "application/json": {
                  "schema": {
                     "type": "object",
                     "properties": {
                        "page": {
                           "$ref": "#/components/schemas/PagedResponse"
                        },
                        "_embedded": {
                           "type": "object",
                           "properties": {
                              "entries": {
                                 "type": "array",
                                 "items": {
                                    "$ref": "#/components/schemas/AbsoluteBurstEntry"
                                 }
                              }
                           }
                        },
                        "links": {
                           "allOf": [
                              {
                                 "$ref": "#/components/schemas/_links"
                              }
                           ],
                           "example": {
                              "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"
                              }
                           }
                        }
                     }
                  }
               }
            }
         },
         "AbsoluteBurstEntryResponse": {
            "description": "Successful operation",
            "headers": {
               "X-Request-Id": {
                  "$ref": "#/components/headers/X-Request-Id"
               }
            },
            "content": {
               "application/json": {
                  "schema": {
                     "$ref": "#/components/schemas/AbsoluteBurstEntry"
                  }
               }
            }
         },
         "CustomRulePaginatedResponse": {
            "description": "OK",
            "headers": {
               "X-Request-Id": {
                  "$ref": "#/components/headers/X-Request-Id"
               }
            },
            "content": {
               "application/json": {
                  "schema": {
                     "type": "object",
                     "properties": {
                        "page": {
                           "$ref": "#/components/schemas/PagedResponse"
                        },
                        "_embedded": {
                           "type": "object",
                           "properties": {
                              "entries": {
                                 "type": "array",
                                 "items": {
                                    "$ref": "#/components/schemas/CustomRule"
                                 }
                              }
                           }
                        },
                        "links": {
                           "allOf": [
                              {
                                 "$ref": "#/components/schemas/_links"
                              }
                           ],
                           "example": {
                              "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"
                              }
                           }
                        }
                     }
                  }
               }
            }
         },
         "CustomRuleResponse": {
            "description": "OK",
            "headers": {
               "X-Request-Id": {
                  "$ref": "#/components/headers/X-Request-Id"
               }
            },
            "content": {
               "application/json": {
                  "schema": {
                     "$ref": "#/components/schemas/CustomRule"
                  }
               }
            }
         }
      },
      "schemas": {
         "AitProtectionConfigurationPerCountryData": {
            "type": "object",
            "required": [
               "country",
               "protection_level"
            ],
            "properties": {
               "country": {
                  "type": "string",
                  "description": "country code in ISO 3166-1 Alpha-2 standard",
                  "example": "US",
                  "pattern": "[A-Z]{2}"
               },
               "protection_level": {
                  "type": "string",
                  "description": "AIT protection level",
                  "example": "high",
                  "enum": [
                     "high",
                     "standard",
                     "none"
                  ]
               }
            }
         },
         "TrafficRule": {
            "type": "object",
            "properties": {
               "id": {
                  "type": "string",
                  "example": "test-id"
               },
               "product": {
                  "$ref": "#/components/schemas/Product"
               },
               "prefix": {
                  "$ref": "#/components/schemas/Prefix"
               },
               "direction": {
                  "type": "string",
                  "enum": [
                     "from",
                     "to"
                  ],
                  "example": "from"
               },
               "traffic_direction": {
                  "type": "string",
                  "example": "outbound",
                  "description": "Outbound rules apply to traffic generated from you API Key. Inbound rules apply to traffic sent to your phone numbers.",
                  "default": "outbound"
               },
               "action": {
                  "$ref": "#/components/schemas/Action"
               },
               "reason": {
                  "$ref": "#/components/schemas/Reason"
               },
               "permission": {
                  "type": "string",
                  "enum": [
                     "view",
                     "edit"
                  ],
                  "example": "edit"
               },
               "status": {
                  "$ref": "#/components/schemas/Status"
               },
               "created_timestamp": {
                  "type": "string",
                  "example": "2022-12-09T18:19:26"
               },
               "updated_timestamp": {
                  "type": "string",
                  "example": "2022-11-09T18:19:26"
               },
               "archived_timestamp": {
                  "type": "string",
                  "example": "2022-10-09T18:19:26"
               },
               "_links": {
                  "allOf": [
                     {
                        "$ref": "#/components/schemas/_links"
                     }
                  ],
                  "example": {
                     "self": {
                        "href": "https://api.nexmo.com/v1/fraud-defender/rules/test-id"
                     }
                  }
               }
            }
         },
         "AbsoluteBurstEntry": {
            "type": "object",
            "properties": {
               "id": {
                  "type": "string",
                  "description": "Internal ID, to be used as the ID when updating or deleting a record",
                  "example": "abcdef01-2345-6789-abcd-ef0123456789"
               },
               "destination_countries": {
                  "type": "array",
                  "description": "List of destination countries",
                  "items": {
                     "$ref": "#/components/schemas/AbsoluteBurstSupportedCountry"
                  }
               },
               "block_value": {
                  "type": "integer",
                  "description": "Number of messages allowed in the 10 minutes time period, after which messages will be blocked.",
                  "example": 1
               },
               "_links": {
                  "allOf": [
                     {
                        "$ref": "#/components/schemas/_links"
                     }
                  ],
                  "example": {
                     "self": {
                        "href": "https://api.nexmo.com/v1/fraud-defender/protection-configuration/absolute-burst/abcdef01-2345-6789-abcd-ef0123456789"
                     }
                  }
               }
            }
         },
         "AbsoluteBurstSupportedCountry": {
            "type": "string",
            "description": "2-letter country code",
            "example": "DZ",
            "enum": [
               "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",
               "YE"
            ]
         },
         "Product": {
            "type": "string",
            "enum": [
               "voice",
               "sms"
            ],
            "example": "sms"
         },
         "Prefix": {
            "type": "string",
            "maxLength": 15,
            "example": "44",
            "description": "The 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."
         },
         "Reason": {
            "type": "string",
            "example": "My custom prefix rule",
            "description": "Human readable reason"
         },
         "Action": {
            "type": "string",
            "example": "block",
            "enum": [
               "block",
               "allow"
            ]
         },
         "Status": {
            "type": "string",
            "example": "active",
            "enum": [
               "active",
               "archived",
               "all"
            ]
         },
         "ProtectionConfiguration": {
            "type": "object",
            "properties": {
               "protection_enabled": {
                  "type": "boolean",
                  "description": "used to turn on/off AIT protection",
                  "example": true
               },
               "default_protection_level": {
                  "type": "string",
                  "description": "Required if protection_enabled is set to true. Default AIT protection level will be used for countries where no specific per-country configuration exists.",
                  "example": "standard",
                  "enum": [
                     "high",
                     "standard",
                     "none"
                  ]
               },
               "protection_level_per_country": {
                  "type": "array",
                  "items": {
                     "$ref": "#/components/schemas/AitProtectionConfigurationPerCountryData"
                  },
                  "description": "array of specific per-country AIT protection level configurations"
               }
            }
         },
         "CustomRule": {
            "type": "object",
            "properties": {
               "country": {
                  "type": "string",
                  "example": "GB"
               },
               "interval": {
                  "type": "integer",
                  "format": "int32",
                  "example": 60
               },
               "threshold": {
                  "type": "integer",
                  "format": "int32",
                  "example": 100
               },
               "product": {
                  "$ref": "#/components/schemas/Product"
               },
               "id": {
                  "type": "string",
                  "example": "abcdef01-2345-6789-abcd-ef0123456789"
               },
               "_links": {
                  "allOf": [
                     {
                        "$ref": "#/components/schemas/_links"
                     }
                  ],
                  "example": {
                     "self": {
                        "href": "https://api.nexmo.com/v1/fraud-defender/configuration/custom-rules/SMS/e21ace94-54fa-4365-a824-38033dc06779"
                     }
                  }
               }
            }
         },
         "PageSize": {
            "description": "Items per page",
            "example": 10,
            "type": "integer",
            "minimum": 0
         },
         "Page": {
            "description": "Page Offset",
            "example": 2,
            "type": "integer",
            "minimum": 1
         },
         "HalLink": {
            "type": "object",
            "description": "A single HAL link object",
            "required": [
               "href"
            ],
            "properties": {
               "href": {
                  "type": "string",
                  "description": "The URL for the resource",
                  "example": "https://api.vonage.com/v1/resources/abc123"
               },
               "templated": {
                  "type": "boolean",
                  "description": "Indicates if the href is a URI template",
                  "example": false
               },
               "type": {
                  "type": "string",
                  "description": "Media type hint for the target resource",
                  "example": "application/json"
               },
               "name": {
                  "type": "string",
                  "description": "Secondary key for selecting link objects",
                  "example": "resource-name"
               },
               "title": {
                  "type": "string",
                  "description": "Human-readable title for the link",
                  "example": "Resource Title"
               }
            }
         },
         "SelfLink": {
            "type": "object",
            "description": "Link to the current resource (always required in HAL)",
            "required": [
               "self"
            ],
            "properties": {
               "self": {
                  "$ref": "#/components/schemas/HalLink"
               }
            }
         },
         "_links": {
            "type": "object",
            "description": "HAL Links object",
            "allOf": [
               {
                  "$ref": "#/components/schemas/SelfLink"
               }
            ]
         },
         "TotalPages": {
            "description": "Number of pages in the entire result set",
            "example": 100,
            "type": "integer",
            "minimum": 1
         },
         "TotalItems": {
            "description": "Number of items in the entire result set",
            "example": 100,
            "type": "integer",
            "minimum": 0
         },
         "PagedResponse": {
            "type": "object",
            "properties": {
               "page_size": {
                  "$ref": "#/components/schemas/PageSize"
               },
               "page": {
                  "$ref": "#/components/schemas/Page"
               },
               "total_pages": {
                  "$ref": "#/components/schemas/TotalPages"
               },
               "total_items": {
                  "$ref": "#/components/schemas/TotalItems"
               }
            }
         },
         "ErrorResponse": {
            "type": "object",
            "description": "Base error response following RFC 7807",
            "required": [
               "type",
               "title",
               "instance"
            ],
            "properties": {
               "type": {
                  "type": "string",
                  "description": "Link to error / remediation options",
                  "example": "https://developer.vonage.com/api-errors"
               },
               "title": {
                  "type": "string",
                  "description": "Generic error message",
                  "example": "An error occurred"
               },
               "detail": {
                  "type": "string",
                  "description": "Additional information about the error",
                  "example": "More details about what went wrong"
               },
               "instance": {
                  "type": "string",
                  "description": "Internal Trace ID",
                  "example": "bf0ca0bf927b3b52e3cb03217e1a1ddf"
               }
            }
         },
         "ErrorResponseWithInvalidParameters": {
            "allOf": [
               {
                  "$ref": "#/components/schemas/ErrorResponse"
               },
               {
                  "type": "object",
                  "required": [
                     "detail"
                  ],
                  "properties": {
                     "invalid_parameters": {
                        "type": "array",
                        "description": "List of invalid parameters",
                        "items": {
                           "type": "object",
                           "required": [
                              "name",
                              "reason"
                           ],
                           "properties": {
                              "name": {
                                 "type": "string",
                                 "description": "Name of the invalid parameter",
                                 "example": "name"
                              },
                              "reason": {
                                 "type": "string",
                                 "description": "Reason why the parameter is invalid",
                                 "example": "Must not be empty"
                              }
                           }
                        }
                     }
                  }
               }
            ]
         }
      },
      "headers": {
         "X-Request-Id": {
            "description": "A unique identifier for the request, used for tracking and debugging",
            "schema": {
               "type": "string",
               "format": "uuid",
               "example": "f94b4e56-604e-07e5-e5ad-5a7228618f81"
            }
         },
         "X-RateLimit-Limit": {
            "description": "Request limit per hour",
            "schema": {
               "type": "integer",
               "example": 30
            }
         },
         "X-RateLimit-Remaining": {
            "description": "Remaining requests",
            "schema": {
               "type": "integer",
               "example": 5
            }
         },
         "X-RateLimit-Reset": {
            "description": "Unix timestamp when limit resets",
            "schema": {
               "type": "integer",
               "example": 1769182705723
            }
         },
         "Retry-After": {
            "description": "Seconds until next request allowed",
            "schema": {
               "type": "integer",
               "example": 15
            }
         }
      }
   },
   "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."
      },
      "http:error:validation-fail": {
         "description": "There was an issue when validating fields. Please refer to the API specs"
      },
      "http:error:bad-request": {
         "description": "Bad Request. Please refer to the API specs"
      }
   }
}