{
  "openapi": "3.1.0",
  "info": {
    "title": "VerifyAnyEmail API",
    "version": "1.0.0",
    "description": "Real-time and bulk email verification. Authenticate every request with your API key as a Bearer token: `Authorization: Bearer vae_...`. Create a key in the dashboard under API keys. One credit is spent per unique verification. Test mode: any address at `@test.verifyany.email` (e.g. deliverable@, undeliverable@, risky@, unknown@) returns a deterministic result without charging a credit or probing a real mailbox.",
    "contact": {
      "name": "VerifyAnyEmail",
      "url": "https://verifyany.email"
    }
  },
  "servers": [
    {
      "url": "https://api.verifyany.email"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Verification",
      "description": "Verify single addresses."
    },
    {
      "name": "Batch",
      "description": "Verify lists asynchronously."
    },
    {
      "name": "Suppression",
      "description": "Account-level auto-skip list (no probe, no charge)."
    }
  ],
  "paths": {
    "/v1/verify": {
      "post": {
        "tags": [
          "Verification"
        ],
        "summary": "Verify a single email address",
        "description": "Runs syntax → MX → live SMTP probe (for eligible addresses) → catch-all/disposable/role classification. Spends 1 credit. Send `X-VAE-Source` to tag where the verification came from.",
        "operationId": "verifyEmail",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 254,
                    "example": "name@example.com"
                  },
                  "smtpProbe": {
                    "type": "boolean",
                    "default": true,
                    "description": "Set false to skip the live SMTP probe (DNS-only)."
                  },
                  "catchAllDetection": {
                    "type": "boolean",
                    "default": true
                  }
                },
                "required": [
                  "email"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Verification result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "result": {
                      "$ref": "#/components/schemas/VerificationResult"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Insufficient credits",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/verify/batch": {
      "post": {
        "tags": [
          "Batch"
        ],
        "summary": "Submit a batch of addresses",
        "description": "Queues a list for asynchronous verification. Returns immediately with a batch id; poll the status endpoint or receive a signed `batch.completed` webhook. Requires a plan with batch verification.",
        "operationId": "createBatch",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "emails": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "minItems": 1,
                    "example": [
                      "a@example.com",
                      "b@example.com"
                    ]
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 200,
                    "example": "newsletter-2026-07"
                  },
                  "webhookUrl": {
                    "type": "string",
                    "format": "uri",
                    "description": "Optional. Receives a signed batch.completed callback."
                  }
                },
                "required": [
                  "emails"
                ]
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Batch queued",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "batch": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "example": "queued"
                        },
                        "total": {
                          "type": "integer"
                        }
                      }
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Insufficient credits",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Batch verification not on your plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Batch too large for your plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Concurrent batch limit reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/verify/batch/{id}": {
      "get": {
        "tags": [
          "Batch"
        ],
        "summary": "Get batch status & summary",
        "operationId": "getBatch",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Batch status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "batch": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string",
                          "nullable": true
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "queued",
                            "processing",
                            "completed",
                            "failed"
                          ]
                        },
                        "total": {
                          "type": "integer"
                        },
                        "processed": {
                          "type": "integer"
                        },
                        "summary": {
                          "type": "object",
                          "properties": {
                            "deliverable": {
                              "type": "integer"
                            },
                            "undeliverable": {
                              "type": "integer"
                            },
                            "risky": {
                              "type": "integer"
                            },
                            "unknown": {
                              "type": "integer"
                            }
                          }
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "completedAt": {
                          "type": "string",
                          "format": "date-time",
                          "nullable": true
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Batch not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/verify/batch/{id}/results": {
      "get": {
        "tags": [
          "Batch"
        ],
        "summary": "Get batch results (paginated)",
        "operationId": "getBatchResults",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "page": {
                      "type": "integer"
                    },
                    "pageSize": {
                      "type": "integer"
                    },
                    "total": {
                      "type": "integer"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "email": {
                            "type": "string"
                          },
                          "normalized": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "subStatus": {
                            "type": "string",
                            "nullable": true
                          },
                          "score": {
                            "type": "integer"
                          },
                          "suggestion": {
                            "type": "string",
                            "nullable": true
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Batch not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/suppression": {
      "get": {
        "tags": [
          "Suppression"
        ],
        "summary": "List suppression entries (paginated)",
        "operationId": "listSuppression",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Entries",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "page": {
                      "type": "integer"
                    },
                    "pageSize": {
                      "type": "integer"
                    },
                    "total": {
                      "type": "integer"
                    },
                    "entries": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "value": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "reason": {
                            "type": "string",
                            "nullable": true
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Suppression"
        ],
        "summary": "Add emails/domains to the suppression list",
        "description": "Idempotent. `values` accepts a mix of emails and bare domains (send them as a text array).",
        "operationId": "addSuppression",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "values": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "example": [
                      "john@old.com",
                      "spam-trap.example"
                    ]
                  },
                  "reason": {
                    "type": "string",
                    "maxLength": 64,
                    "example": "unsubscribed"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Added",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "added": {
                      "type": "integer"
                    },
                    "skipped": {
                      "type": "integer"
                    },
                    "invalid": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Suppression"
        ],
        "summary": "Remove entries from the suppression list",
        "operationId": "removeSuppression",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "values": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "example": [
                      "john@old.com"
                    ]
                  }
                },
                "required": [
                  "values"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Removed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "removed": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "webhooks": {
    "batch.completed": {
      "post": {
        "summary": "Sent to your webhookUrl when a batch finishes",
        "description": "POST with header `X-VAE-Signature: sha256=<HMAC-SHA256(rawBody, yourWebhookSecret)>`. Verify with a length-safe constant-time comparison. Your webhook secret is shown in dashboard Settings.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "event": {
                    "type": "string",
                    "example": "batch.completed"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "batchId": {
                        "type": "string"
                      },
                      "total": {
                        "type": "integer"
                      },
                      "deliverable": {
                        "type": "integer"
                      },
                      "undeliverable": {
                        "type": "integer"
                      },
                      "risky": {
                        "type": "integer"
                      },
                      "unknown": {
                        "type": "integer"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Return 2xx to acknowledge; non-2xx triggers retries."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "API key: `Authorization: Bearer vae_...`"
      }
    },
    "schemas": {
      "VerificationResult": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "normalized": {
            "type": "string"
          },
          "account": {
            "type": "string"
          },
          "domain": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "deliverable",
              "undeliverable",
              "risky",
              "unknown"
            ]
          },
          "subStatus": {
            "type": "string",
            "nullable": true,
            "description": "valid_mailbox, mailbox_not_found, null_mx, catch_all, role_based, disposable, greylisted, smtp_unavailable, possible_typo, …"
          },
          "score": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "checks": {
            "type": "object",
            "properties": {
              "syntax": {
                "type": "boolean"
              },
              "hasMxRecords": {
                "type": "boolean"
              },
              "nullMx": {
                "type": "boolean",
                "description": "Domain publishes a Null MX (RFC 7505) — accepts no email."
              },
              "smtpConnectable": {
                "type": "boolean",
                "nullable": true
              },
              "mailboxExists": {
                "type": "boolean",
                "nullable": true
              },
              "catchAll": {
                "type": "boolean",
                "nullable": true
              },
              "roleBased": {
                "type": "boolean"
              },
              "disposable": {
                "type": "boolean"
              },
              "freeProvider": {
                "type": "boolean"
              },
              "possibleTypo": {
                "type": "boolean"
              },
              "gibberish": {
                "type": "boolean"
              }
            }
          },
          "suggestion": {
            "type": "string",
            "nullable": true,
            "description": "“Did you mean” domain correction."
          },
          "safeToSend": {
            "type": "boolean"
          },
          "durationMs": {
            "type": "integer"
          },
          "checkedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Checks": {
        "type": "object",
        "properties": {
          "syntax": {
            "type": "boolean"
          },
          "hasMxRecords": {
            "type": "boolean"
          },
          "nullMx": {
            "type": "boolean",
            "description": "Domain publishes a Null MX (RFC 7505) — accepts no email."
          },
          "smtpConnectable": {
            "type": "boolean",
            "nullable": true
          },
          "mailboxExists": {
            "type": "boolean",
            "nullable": true
          },
          "catchAll": {
            "type": "boolean",
            "nullable": true
          },
          "roleBased": {
            "type": "boolean"
          },
          "disposable": {
            "type": "boolean"
          },
          "freeProvider": {
            "type": "boolean"
          },
          "possibleTypo": {
            "type": "boolean"
          },
          "gibberish": {
            "type": "boolean"
          }
        }
      },
      "BatchStatus": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "processing",
              "completed",
              "failed"
            ]
          },
          "total": {
            "type": "integer"
          },
          "processed": {
            "type": "integer"
          },
          "summary": {
            "type": "object",
            "properties": {
              "deliverable": {
                "type": "integer"
              },
              "undeliverable": {
                "type": "integer"
              },
              "risky": {
                "type": "integer"
              },
              "unknown": {
                "type": "integer"
              }
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "completedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        }
      },
      "BatchResultRow": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "normalized": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "subStatus": {
            "type": "string",
            "nullable": true
          },
          "score": {
            "type": "integer"
          },
          "suggestion": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "error"
        ]
      }
    }
  }
}