{
  "openapi": "3.0.1",
  "info": {
    "title": "PhoneValidation",
    "version": "v1"
  },
  "paths": {
    "/PhoneValidation/IsValidSimple.json": {
      "post": {
        "tags": [
          "PhoneValidation"
        ],
        "summary": "Checks if a telephone number is valid",
        "requestBody": {
          "description": "The telephone number to check",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IsValidSimpleRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/IsValidSimpleRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/IsValidSimpleRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InternationalTelephoneValidationOutput"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternationalTelephoneValidationOutput"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternationalTelephoneValidationOutput"
                }
              }
            }
          }
        }
      }
    },
    "/PhoneValidation/IsValid.json": {
      "post": {
        "tags": [
          "PhoneValidation"
        ],
        "summary": "Checks if a telephone number is valid",
        "requestBody": {
          "description": "The telephone number to check",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IsValidRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/IsValidRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/IsValidRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/InternationalTelephoneValidationOutput"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternationalTelephoneValidationOutput"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternationalTelephoneValidationOutput"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "InternationalTelephoneValidationOutput": {
        "type": "object",
        "properties": {
          "Status": {
            "$ref": "#/components/schemas/Status"
          },
          "Result": {
            "$ref": "#/components/schemas/TelephoneNumberDetails"
          }
        },
        "additionalProperties": false
      },
      "IsValidRequest": {
        "type": "object",
        "properties": {
          "username": {
            "type": "string",
            "description": "The username to authenticate with",
            "nullable": true
          },
          "password": {
            "type": "string",
            "description": "The password to authenticate with",
            "nullable": true
          },
          "telephoneNumber": {
            "type": "string",
            "description": "The telephone number to validate",
            "nullable": true
          },
          "defaultCountry": {
            "type": "string",
            "description": "The country code (e.g. \"44\" or \"GB\") the telephone number should be assumed to be from if it does not include an international dialling code",
            "nullable": true
          },
          "options": {
            "type": "object",
            "description": "Any custom options to control how the details should be validated. See the API documentation website for a list of currently supported option.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "IsValidSimpleRequest": {
        "type": "object",
        "properties": {
          "username": {
            "type": "string",
            "description": "The username to authenticate with",
            "nullable": true
          },
          "password": {
            "type": "string",
            "description": "The password to authenticate with",
            "nullable": true
          },
          "telephoneNumber": {
            "type": "string",
            "description": "The telephone number to validate",
            "nullable": true
          },
          "defaultCountry": {
            "type": "string",
            "description": "The country code (e.g. \"44\" or \"GB\") the telephone number should be assumed to be from if it does not include an international dialling code",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "NumberType": {
        "enum": [
          "Unknown",
          "Landline",
          "Mobile",
          "NonGeographic",
          "Special"
        ],
        "type": "string"
      },
      "Option": {
        "type": "object",
        "properties": {
          "Name": {
            "type": "string",
            "description": "The name of the option. For an option to have any effect, the name must be one that the service expects.\r\nAny other options that are supplied should be ignored",
            "nullable": true
          },
          "Value": {
            "type": "string",
            "description": "The value for the option. Although this is supplied as a string, it may be converted to other formats. If\r\nthe string is not in the expected format an error may be thrown.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Represents an option that the caller can use to control how a request is executed"
      },
      "Status": {
        "type": "object",
        "properties": {
          "Success": {
            "type": "boolean"
          },
          "ErrorMessage": {
            "type": "string",
            "nullable": true
          },
          "CreditsRemaining": {
            "type": "number",
            "format": "float"
          }
        },
        "additionalProperties": false
      },
      "TelephoneNumberDetails": {
        "type": "object",
        "properties": {
          "TelephoneNumber": {
            "type": "string",
            "nullable": true
          },
          "ValidationResult": {
            "$ref": "#/components/schemas/ValidationResult"
          },
          "ValidationLevel": {
            "$ref": "#/components/schemas/ValidationLevel"
          },
          "NumberType": {
            "$ref": "#/components/schemas/NumberType"
          },
          "Location": {
            "type": "string",
            "nullable": true
          },
          "Provider": {
            "type": "string",
            "nullable": true
          },
          "CountryCode": {
            "type": "string",
            "nullable": true
          },
          "CountryName": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ValidationLevel": {
        "enum": [
          "None",
          "STDCode",
          "Exchange",
          "FullNumber"
        ],
        "type": "string"
      },
      "ValidationResult": {
        "enum": [
          "Valid",
          "Invalid",
          "NoCoverage",
          "Unavailable",
          "Ambiguous"
        ],
        "type": "string"
      }
    },
    "securitySchemes": {
      "UserPass": {
        "type": "http",
        "scheme": "basic"
      },
      "ApiKey": {
        "type": "apiKey",
        "name": "key",
        "in": "query"
      },
      "JWT": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  },
  "security": [
    {
      "UserPass": [ ],
      "ApiKey": [ ],
      "JWT": [ ]
    }
  ]
}