{
   "openapi": "3.0.3",
   "info": {
      "title": "Number Deactivation - API",
      "description": "API for Number Deactivation\n",
      "version": "0.1.0"
   },
   "servers": [
      {
         "url": "https://api.nexmo.com",
         "description": "Public"
      }
   ],
   "security": [
      {
         "basicAuth": []
      },
      {
         "bearerAuth": []
      }
   ],
   "components": {
      "securitySchemes": {
         "basicAuth": {
            "type": "http",
            "scheme": "basic"
         },
         "bearerAuth": {
            "type": "http",
            "scheme": "bearer"
         }
      },
      "schemas": {
         "AuthenticationErrorResponse": {
            "type": "object",
            "required": [
               "type",
               "title",
               "detail",
               "instance"
            ],
            "properties": {
               "type": {
                  "description": "is both the identifier for the specific error (URI) and a link to human readable documentation about the problem.",
                  "type": "string",
                  "example": "https://developer.vonage.com/api-errors#unauthorized"
               },
               "title": {
                  "description": "is a short indication of what went wrong",
                  "type": "string",
                  "example": "Invalid credentials supplied"
               },
               "detail": {
                  "description": "provides more information about the error",
                  "type": "string",
                  "example": "The credentials supplied are not valid"
               },
               "instance": {
                  "description": "is the request trace ID",
                  "type": "string",
                  "example": "00000000-0000-0000-0000-000000000000"
               }
            }
         },
         "ClientErrorResponse": {
            "type": "object",
            "required": [
               "type",
               "title",
               "detail",
               "instance"
            ],
            "properties": {
               "type": {
                  "description": "is both the identifier for the specific error (URI) and a link to human readable documentation about the problem.",
                  "type": "string",
                  "example": "https://developer.vonage.com/api-errors#invalid-parameter"
               },
               "title": {
                  "description": "is a short indication of what went wrong",
                  "type": "string",
                  "example": "Date too old"
               },
               "detail": {
                  "description": "provides more information about the error",
                  "type": "string",
                  "example": "The date introduced is older than 30 Days."
               },
               "instance": {
                  "description": "is the request trace ID (previously returned as a header)",
                  "type": "string",
                  "example": "00000000-0000-0000-0000-000000000000"
               }
            }
         },
         "ConflictErrorResponse": {
            "type": "object",
            "required": [
               "type",
               "title",
               "detail",
               "instance"
            ],
            "properties": {
               "type": {
                  "description": "is both the identifier for the specific error (URI) and a link to human readable documentation about the problem.",
                  "type": "string",
                  "example": "https://developer.vonage.com/api-errors#conflict"
               },
               "title": {
                  "description": "is a short indication of what went wrong",
                  "type": "string",
                  "example": "Resource conflict"
               },
               "detail": {
                  "description": "provides more information about the error",
                  "type": "string",
                  "example": "Duplicate resource"
               },
               "instance": {
                  "description": "is the request trace ID (previously returned as a header)",
                  "type": "string",
                  "example": "00000000-0000-0000-0000-000000000000"
               }
            }
         },
         "ForbiddenErrorResponse": {
            "type": "object",
            "required": [
               "type",
               "title",
               "detail",
               "instance"
            ],
            "properties": {
               "type": {
                  "description": "is both the identifier for the specific error (URI) and a link to human readable documentation about the problem.",
                  "type": "string",
                  "example": "https://developer.vonage.com/en/api-errors#forbidden"
               },
               "title": {
                  "description": "is a short indication of what went wrong",
                  "type": "string",
                  "example": "Operation not allowed"
               },
               "detail": {
                  "description": "provides more information about the error",
                  "type": "string",
                  "example": "The operation is not allowed with the supplied credentials."
               },
               "instance": {
                  "description": "is the request trace ID (previously returned as a header)",
                  "type": "string",
                  "example": "00000000-0000-0000-0000-000000000000"
               }
            }
         },
         "InternalServerErrorResponse": {
            "type": "object",
            "required": [
               "type",
               "title",
               "detail",
               "instance"
            ],
            "properties": {
               "type": {
                  "description": "is both the identifier for the specific error (URI) and a link to human readable documentation about the problem.",
                  "type": "string",
                  "example": "https://developer.vonage.com/en/api-errors#internal-error"
               },
               "title": {
                  "description": "is a short indication of what went wrong",
                  "type": "string",
                  "example": "Internal server error"
               },
               "detail": {
                  "description": "provides more information about the error",
                  "type": "string",
                  "example": "The server failed to process the request"
               },
               "instance": {
                  "description": "is the request trace ID (previously returned as a header)",
                  "type": "string",
                  "example": "00000000-0000-0000-0000-000000000000"
               }
            }
         },
         "NotFoundErrorResponse": {
            "type": "object",
            "required": [
               "type",
               "title",
               "detail",
               "instance"
            ],
            "properties": {
               "type": {
                  "description": "is both the identifier for the specific error (URI) and a link to human readable documentation about the problem.",
                  "type": "string",
                  "example": "https://developer.vonage.com/en/api-errors#not-found"
               },
               "title": {
                  "description": "is a short indication of what went wrong",
                  "type": "string",
                  "example": "Resource not found"
               },
               "detail": {
                  "description": "provides more information about the error",
                  "type": "string",
                  "example": "The resource could not be found on the server."
               },
               "instance": {
                  "description": "is the request trace ID (previously returned as a header)",
                  "type": "string",
                  "example": "00000000-0000-0000-0000-000000000000"
               }
            }
         },
         "ValidationErrorItem": {
            "type": "object",
            "required": [
               "name",
               "reason"
            ],
            "properties": {
               "name": {
                  "type": "string",
                  "example": "date"
               },
               "reason": {
                  "type": "string",
                  "example": "date is not valid"
               }
            }
         },
         "ValidationErrorResponse": {
            "type": "object",
            "required": [
               "type",
               "title",
               "detail",
               "instance"
            ],
            "properties": {
               "type": {
                  "description": "is both the identifier for the specific error (URI) and a link to human readable documentation about the problem.",
                  "type": "string",
                  "example": "https://developer.vonage.com/en/api-errors#invalid-request"
               },
               "title": {
                  "description": "is a short indication of what went wrong",
                  "type": "string",
                  "example": "Invalid request"
               },
               "detail": {
                  "description": "provides more information about the error",
                  "type": "string",
                  "example": "The request contains invalid data"
               },
               "instance": {
                  "description": "is the request trace ID (previously returned as a header)",
                  "type": "string",
                  "example": "00000000-0000-0000-0000-000000000000"
               },
               "invalid_parameters": {
                  "description": "Used for validation errors to provide more information about the failure",
                  "type": "array",
                  "items": {
                     "$ref": "#/components/schemas/ValidationErrorItem"
                  }
               }
            }
         }
      },
      "responses": {
         "200": {
            "description": "Successful response"
         },
         "401": {
            "description": "Authentication error",
            "content": {
               "application/problem+json": {
                  "schema": {
                     "allOf": [
                        {
                           "$ref": "#/components/schemas/AuthenticationErrorResponse"
                        }
                     ]
                  }
               }
            }
         },
         "403": {
            "description": "Forbidden request",
            "content": {
               "application/problem+json": {
                  "schema": {
                     "allOf": [
                        {
                           "$ref": "#/components/schemas/ForbiddenErrorResponse"
                        }
                     ]
                  }
               }
            }
         },
         "404": {
            "description": "Resource not found",
            "content": {
               "application/problem+json": {
                  "schema": {
                     "allOf": [
                        {
                           "$ref": "#/components/schemas/NotFoundErrorResponse"
                        }
                     ]
                  }
               }
            }
         },
         "409": {
            "description": "Resource conflict",
            "content": {
               "application/problem+json": {
                  "schema": {
                     "allOf": [
                        {
                           "$ref": "#/components/schemas/ConflictErrorResponse"
                        }
                     ]
                  }
               }
            }
         },
         "500": {
            "description": "Internal server error",
            "content": {
               "application/problem+json": {
                  "schema": {
                     "allOf": [
                        {
                           "$ref": "#/components/schemas/InternalServerErrorResponse"
                        }
                     ]
                  }
               }
            }
         }
      },
      "parameters": {
         "Date": {
            "name": "date",
            "description": "Date of the deactivations. Must be within the last 31 days. Files only become available the next day after 2am UTC.",
            "in": "query",
            "required": true,
            "schema": {
               "type": "string",
               "example": "2025-02-28"
            }
         }
      }
   },
   "paths": {
      "/v1/numbers/deactivations": {
         "get": {
            "description": "Download the specified date's deactivations file.",
            "parameters": [
               {
                  "$ref": "#/components/parameters/Date"
               }
            ],
            "responses": {
               "200": {
                  "description": "Successful response",
                  "content": {
                     "application/zip": {
                        "schema": {
                           "type": "string",
                           "format": "binary"
                        }
                     }
                  }
               },
               "401": {
                  "$ref": "#/components/responses/401"
               },
               "403": {
                  "$ref": "#/components/responses/403"
               },
               "404": {
                  "$ref": "#/components/responses/404"
               },
               "422": {
                  "description": "Request validation failed",
                  "content": {
                     "application/problem+json": {
                        "schema": {
                           "allOf": [
                              {
                                 "$ref": "#/components/schemas/ValidationErrorResponse"
                              }
                           ]
                        }
                     }
                  }
               },
               "500": {
                  "$ref": "#/components/responses/500"
               }
            }
         }
      }
   }
}