{
  "openapi": "3.0.3",
  "info": {
    "title": "Proofy Api",
    "description": "Some text",
    "termsOfService": "https://proofy.io/terms",
    "contact": {
      "email": "support@proofy.io"
    },
    "version": "1.1.0"
  },
  "servers": [
    {
      "url": "https://apis.proofy.io/v1"
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "tags": [
    {
      "name": "Widget",
      "description": "Everything about JS Widget"
    },
    {
      "name": "Single Email",
      "description": "Single email check"
    },
    {
      "name": "Batch Emails",
      "description": "Batch emails check"
    },
    {
      "name": "File upload",
      "description": "Upload a file containing emails"
    }
  ],
  "paths": {
    "/credits": {
      "get": {
        "description": "Check credits left on account",
        "responses": {
          "200": {
            "description": "Successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "credits": { "type": "string" }
                  }
                },
                "example": {
                  "credits": "1000"
                }
              }
            }
          },
          "400": { "$ref": "#/components/responses/HttpErrorResponse400" },
          "401": { "$ref": "#/components/responses/HttpErrorResponse401" },
          "404": { "$ref": "#/components/responses/HttpErrorResponse404" },
          "422": { "$ref": "#/components/responses/HttpErrorResponse422" },
          "429": { "$ref": "#/components/responses/HttpErrorResponse429" },
          "500": { "$ref": "#/components/responses/HttpErrorResponse500" }
        }
      }
    },
    "/verify/single": {
      "get": {
        "tags": ["Single Email"],
        "parameters": [
          {
            "name": "email",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SingleCheckResponse"
                },
                "example": {
                  "status": "valid",
                  "syntax": {
                    "username": "team",
                    "domain": "proofy.io",
                    "valid": true
                  },
                  "free": false,
                  "roleAccount": true,
                  "roleNoReply": false,
                  "disposable": false,
                  "possibleSpamTrap": false,
                  "mx": {
                    "records": [
                      "aspmx.l.google.com.",
                      "alt2.aspmx.l.google.com.",
                      "alt1.aspmx.l.google.com.",
                      "alt4.aspmx.l.google.com.",
                      "alt3.aspmx.l.google.com."
                    ],
                    "acceptsMail": true
                  },
                  "deliverability": {
                    "canConnect": true,
                    "fullInbox": false,
                    "catchAll": false,
                    "deliverable": true,
                    "disabled": false
                  }
                }
              }
            }
          },
          "400": { "$ref": "#/components/responses/HttpErrorResponseNotEnoughCredits400" },
          "401": { "$ref": "#/components/responses/HttpErrorResponse401" },
          "404": { "$ref": "#/components/responses/HttpErrorResponse404" },
          "422": { "$ref": "#/components/responses/HttpErrorResponse422" },
          "429": { "$ref": "#/components/responses/HttpErrorResponse429" },
          "500": { "$ref": "#/components/responses/HttpErrorResponse500" }
        }
      }
    },
    "/verify/batch/create": {
      "post": {
        "tags": ["Batch Emails"],
        "description": "Verify a batch email addresses",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchCreateRequest"
              },
              "example": {
                "emails": ["test@example.com", "hello@domain.com"]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateResponse"
                }
              }
            }
          },
          "400": { "$ref": "#/components/responses/HttpErrorResponseNotEnoughCredits400" },
          "401": { "$ref": "#/components/responses/HttpErrorResponse401" },
          "404": { "$ref": "#/components/responses/HttpErrorResponse404" },
          "422": { "$ref": "#/components/responses/HttpErrorResponse422" },
          "429": { "$ref": "#/components/responses/HttpErrorResponse429" },
          "500": { "$ref": "#/components/responses/HttpErrorResponse500" }
        }
      }
    },
    "/verify/batch/{id}": {
      "get": {
        "description": "Get validation results status",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusResponse"
                },
                "example": {
                  "status": "complete",
                  "total": {
                      "records": 1000,
                      "bad_syntax": 2,
                      "duplicates": 50,
                      "billable": 948,
                      "processed": 948
                    }
                }
              }
            }
          },
          "400": { "$ref": "#/components/responses/HttpErrorResponse400" },
          "401": { "$ref": "#/components/responses/HttpErrorResponse401" },
          "404": { "$ref": "#/components/responses/HttpErrorResponse404" },
          "422": { "$ref": "#/components/responses/HttpErrorResponse422" },
          "429": { "$ref": "#/components/responses/HttpErrorResponse429" },
          "500": { "$ref": "#/components/responses/HttpErrorResponse500" }
        }
      },
      "delete": {
        "tags": ["Batch emails"],
        "description": "Cancel and delete batch",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteResponse"
                },
                "example": {
                  "message": "Batch successfully deleted"
                }
              }
            }
          },
          "400": { "$ref": "#/components/responses/HttpErrorResponse400" },
          "401": { "$ref": "#/components/responses/HttpErrorResponse401" },
          "404": { "$ref": "#/components/responses/HttpErrorResponse404" },
          "422": { "$ref": "#/components/responses/HttpErrorResponse422" },
          "429": { "$ref": "#/components/responses/HttpErrorResponse429" },
          "500": { "$ref": "#/components/responses/HttpErrorResponse500" }
        }
      }
    },
    "/verify/batch/{id}/download": {
      "get": {
        "tags": ["Batch emails"],
        "description": "Get validation results from batch",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchDownloadResponse"
                },
                "example": {
                  "status": "ready",
                  "list": [
                    {
                      "status": "valid",
                      "syntax": {
                        "username": "support",
                        "domain": "proofy.io",
                        "valid": true
                      },
                      "free": false,
                      "roleAccount": true,
                      "roleNoReply": false,
                      "disposable": false,
                      "possibleSpamTrap": false,
                      "mx": {
                        "hasRecords": true,
                        "acceptsMail": true
                      },
                      "deliverability": {
                        "canConnect": true,
                        "fullInbox": false,
                        "catchAll": false,
                        "deliverable": true,
                        "disabled": false
                      }
                    },
                    {
                      "status": "valid",
                      "syntax": {
                        "username": "team",
                        "domain": "proofy.io",
                        "valid": true
                      },
                      "free": false,
                      "roleAccount": true,
                      "roleNoReply": false,
                      "disposable": false,
                      "possibleSpamTrap": false,
                      "mx": {
                        "hasRecords": true,
                        "acceptsMail": true
                      },
                      "deliverability": {
                        "canConnect": true,
                        "fullInbox": false,
                        "catchAll": false,
                        "deliverable": true,
                        "disabled": false
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": { "$ref": "#/components/responses/HttpErrorResponse400" },
          "401": { "$ref": "#/components/responses/HttpErrorResponse401" },
          "404": { "$ref": "#/components/responses/HttpErrorResponse404" },
          "422": { "$ref": "#/components/responses/HttpErrorResponse422" },
          "429": { "$ref": "#/components/responses/HttpErrorResponse429" },
          "500": { "$ref": "#/components/responses/HttpErrorResponse500" }
        }
      }
    },
    "/verify/file/create": {
      "post": {
        "tags": ["Upload file"],
        "description": "Upload file with emails for verification",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FileCreateRequest"
              },
              "example": {
                "file_url": "http://example.com/full/path/to/file.csv",
                "file_name": "Your file name.csv"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateFileResponse"
                }
              }
            }
          },
          "400": { "$ref": "#/components/responses/HttpErrorResponseNotEnoughCredits400" },
          "401": { "$ref": "#/components/responses/HttpErrorResponse401" },
          "404": { "$ref": "#/components/responses/HttpErrorResponse404" },
          "500": { "$ref": "#/components/responses/HttpErrorResponse500" }
        }
      }
    },
    "/verify/file/upload": {
      "post": {
        "tags": ["Upload file from URL"],
        "description": "Upload file with emails for verification",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/FileUploadRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateResponse"
                }
              }
            }
          },
          "400": { "$ref": "#/components/responses/HttpErrorResponseNotEnoughCredits400" },
          "401": { "$ref": "#/components/responses/HttpErrorResponse401" },
          "404": { "$ref": "#/components/responses/HttpErrorResponse404" },
          "500": { "$ref": "#/components/responses/HttpErrorResponse500" }
        }
      }
    },
    "/verify/file/{id}": {
      "get": {
        "tags": ["File"],
        "description": "File Verification Status",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusResponse"
                },
                "example": {
                  "status": "complete",
                  "total": {
                    "records": 1000,
                    "bad_syntax": 2,
                    "duplicates": 50,
                    "billable": 948,
                    "processed": 948
                  }
                }
              }
            }
          },
          "400": { "$ref": "#/components/responses/HttpErrorResponse400" },
          "401": { "$ref": "#/components/responses/HttpErrorResponse401" },
          "404": { "$ref": "#/components/responses/HttpErrorResponse404" },
          "500": { "$ref": "#/components/responses/HttpErrorResponse500" }
        }
      },
      "delete": {
        "tags": ["File"],
        "description": "Cancel and delete file verification",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteResponse"
                },
                "example": {
                  "message": "File successfully deleted"
                }
              }
            }
          },
          "400": { "$ref": "#/components/responses/HttpErrorResponse400" },
          "401": { "$ref": "#/components/responses/HttpErrorResponse401" },
          "404": { "$ref": "#/components/responses/HttpErrorResponse404" },
          "500": { "$ref": "#/components/responses/HttpErrorResponse500" }
        }
      }
    },
    "/verify/file/{id}/download": {
      "get": {
        "tags": ["File"],
        "description": "Get download link for file with results",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileDownloadResponse"
                },
                "example": {
                  "status": "ready",
                  "url": "https://data-exchange-dev-verifier.s3.amazonaws.com/bulks/exports/9f13c66c-51b5-4f28-8470-606a1d4bf099.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAYJMSIKZRYBTA5MPB%2F20240804%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240804T135925Z&X-Amz-Expires=6000&X-Amz-Signature=6336b64a6d33034fc17a930d001f8306a1c9481932f2a262a58e3ddc5c1ce513&X-Amz-SignedHeaders=host"
                }
              }
            }
          },
          "400": { "$ref": "#/components/responses/HttpErrorResponse400" },
          "401": { "$ref": "#/components/responses/HttpErrorResponse401" },
          "404": { "$ref": "#/components/responses/HttpErrorResponse404" },
          "500": { "$ref": "#/components/responses/HttpErrorResponse500" }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "SingleCheckResponse": {
        "type": "object",
        "properties": {
          "result": {
            "type": "object",
            "properties": {
              "status": { "type": "string" },
              "syntax": { "type": "object" },
              "free": { "type": "boolean" },
              "roleAccount": { "type": "boolean" },
              "disposable": { "type": "boolean" },
              "mx": {
                "type": "object",
                "properties": {
                  "records": {
                    "type": "array",
                    "items": { "type": "string" }
                  },
                  "acceptsMail": { "type": "boolean" }
                }
              },
              "deliverability": {
                "type": "object",
                "properties": {
                  "canConnect": { "type": "boolean" },
                  "fullInbox": { "type": "boolean" },
                  "catchAll": { "type": "boolean" },
                  "deliverable": { "type": "boolean" },
                  "disabled": { "type": "boolean" }
                }
              }
            }
          },
          "credits": { "type": "number" }
        }
      },
      "FileCreateRequest": {
        "type": "object",
        "properties": {
          "file_url": {
            "type": "string"
          },
          "file_name": {
            "type": "string"
          }
        }
      },
      "FileUploadRequest": {
        "type": "object",
        "properties": {
          "file": {
            "type": "string",
            "format": "binary",
            "description": "File to upload. The format is of type binary"
          }
        }
      },
      "FileDownloadResponse": {
        "type": "object",
        "properties": {
          "status": { "type": "string" },
          "url": { "type": "string" }
        }
      },
      "BatchCreateRequest": {
        "type": "object",
        "properties": {
          "emails": {
            "type": "array",
            "items": { "type": "string" }
          }
        }
      },
      "BatchDownloadResponse": {
        "type": "object",
        "properties": {
          "status": { "type": "string" },
          "list": { "type": "array" }
        }
      },
      "StatusResponse": {
        "type": "object",
        "properties": {
          "status": { "type": "string" },
          "total": {
            "type": "object",
            "properties": {
              "records": { "type": "number" },
              "bad_syntax": { "type": "number" },
              "duplicates": { "type": "number" },
              "billable": { "type": "number" },
              "processed": { "type": "number" }
            }
          }
        }
      },
      "DeleteResponse": {
        "type": "object",
        "properties": {
          "message": { "type": "string" }
        }
      },
      "CreateResponse": {
        "type": "object",
        "properties": {
          "status": { "type": "string" },
          "id": { "type": "string" }
        },
        "example": {
          "status": "parsing",
          "id": "e29bec0d-c534-493d-9c86-f44b0e2c2617"
        }
      },
      "CreateFileResponse": {
        "type": "object",
        "properties": {
          "status": { "type": "string" },
          "id": { "type": "string" }
        },
        "example": {
          "status": "parsing",
          "id": "9b034ae4-9d28-4c5b-9cca-1b3871a9adc1"
        }
      },
      "UnauthorizedResponse": {
        "properties": {
          "message": { "type": "string" }
        }
      },
      "BadRequestResponse": {
        "properties": {
          "message": { "type": "string" }
        }
      },
      "RateLimitErrorResponse": {
        "properties": {
          "message": { "type": "string" }
        }
      },
      "ValidationErrorResponse": {
        "properties": {
          "message": { "type": "string" }
        }
      },
      "InternalServerErrorResponse": {
        "properties": {
          "message": { "type": "string" }
        }
      },
      "NotFoundResponse": {
        "properties": {
          "message": { "type": "string" }
        }
      }
    },
    "responses": {
      "HttpErrorResponse400": {
        "description": "Http Error Response",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string",
                  "description": "Error message"
                }
              }
            },
            "example": {
              "message": "Bad Request"
            }
          }
        }
      },
      "HttpErrorResponseNotEnoughCredits400": {
        "description": "Http Error Response",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string",
                  "description": "Error message"
                }
              }
            },
            "example": {
              "message": "Not enough credits"
            }
          }
        }
      },
      "HttpErrorResponse401": {
        "description": "Http Error Response",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string",
                  "description": "Error message"
                }
              }
            },
            "example": {
              "message": "Unauthorized"
            }
          }
        }
      },
      "HttpErrorResponse404": {
        "description": "Http Error Response",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string",
                  "description": "Error message"
                }
              }
            },
            "example": {
              "message": "Not Found"
            }
          }
        }
      },
      "HttpErrorResponse422": {
        "description": "Http Error Response",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string",
                  "description": "Error message"
                }
              }
            },
            "example": {
              "message": "Unprocessable Entity"
            }
          }
        }
      },
      "HttpErrorResponse429": {
        "description": "Http Error Response",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string",
                  "description": "Error message"
                }
              }
            },
            "example": {
              "message": "Too Many Requests"
            }
          }
        }
      },
      "HttpErrorResponse500": {
        "description": "Http Error Response",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string",
                  "description": "Error message"
                }
              }
            },
            "example": {
              "message": "Internal Server Error"
            }
          }
        }
      },
      "HttpErrorResponse": {
        "description": "Http Error Response",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "query",
        "name": "api_key"
      }
    }
  }
}
