{
  "openapi": "3.1.0",
  "info": {
    "title": "BounceLayer \u2014 Email Verification API",
    "version": "1.0.0",
    "description": "Enterprise-grade real-time email verification API. Direct port 25 SMTP mailbox checking, authoritative DNS MX resolution, disposable domain filtering, and asynchronous high-throughput bulk verification.",
    "contact": {
      "name": "BounceLayer Support",
      "url": "https://bouncelayer.com",
      "email": "support@bouncelayer.com"
    }
  },
  "servers": [
    {
      "url": "https://bouncelayer.com",
      "description": "Production"
    }
  ],
  "paths": {
    "/api/v1/verify/single": {
      "post": {
        "tags": [
          "Verification"
        ],
        "summary": "Verify a single email address",
        "description": "Executes real-time multi-stage verification: RFC syntax checking, DNS MX resolution, and direct SMTP mailbox probing. 1 credit consumed per verification check.",
        "operationId": "verify_single_email",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email",
                    "example": "alex@company.com"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Verification result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "credits_used": {
                      "type": "integer",
                      "example": 1
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "email": {
                          "type": "string",
                          "example": "alex@company.com"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "valid",
                            "invalid",
                            "catch_all",
                            "do_not_mail",
                            "unknown"
                          ],
                          "example": "valid"
                        },
                        "is_valid": {
                          "type": "boolean",
                          "example": true
                        },
                        "syntax_valid": {
                          "type": "boolean",
                          "example": true
                        },
                        "domain": {
                          "type": "string",
                          "example": "company.com"
                        },
                        "domain_valid": {
                          "type": "boolean",
                          "example": true
                        },
                        "has_mx": {
                          "type": "boolean",
                          "example": true
                        },
                        "smtp_checked": {
                          "type": "boolean",
                          "example": true
                        },
                        "smtp_response_code": {
                          "type": "integer",
                          "nullable": true,
                          "example": 250
                        },
                        "is_disposable": {
                          "type": "boolean",
                          "example": false
                        },
                        "is_role_based": {
                          "type": "boolean",
                          "example": false
                        },
                        "is_catch_all": {
                          "type": "boolean",
                          "example": false
                        },
                        "confidence_score": {
                          "type": "integer",
                          "example": 98
                        },
                        "status_reason": {
                          "type": "string",
                          "example": "mailbox_confirmed"
                        },
                        "provider": {
                          "type": "string",
                          "nullable": true,
                          "example": "google"
                        },
                        "verification_time_ms": {
                          "type": "integer",
                          "example": 182
                        },
                        "cached": {
                          "type": "boolean",
                          "example": false
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input format"
          },
          "401": {
            "description": "Invalid or missing X-API-Key"
          },
          "402": {
            "description": "Insufficient credits"
          }
        }
      }
    },
    "/api/v1/verify/bulk": {
      "post": {
        "tags": [
          "Verification"
        ],
        "summary": "Submit bulk verification job",
        "description": "Queues up to 10,000 email addresses for high-concurrency parallel verification. Credits are reserved on submission and settled upon completion.",
        "operationId": "submit_bulk_verification",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "emails"
                ],
                "properties": {
                  "emails": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "example": [
                      "user1@company.com",
                      "user2@startup.io"
                    ]
                  },
                  "webhook_url": {
                    "type": "string",
                    "format": "uri",
                    "example": "https://myapp.com/webhooks/bouncelayer"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Job accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "job_id": {
                      "type": "string",
                      "example": "01923a1f-829d-7b20-91fc-982348a201b9"
                    },
                    "total_emails": {
                      "type": "integer",
                      "example": 500
                    },
                    "status": {
                      "type": "string",
                      "example": "pending"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Verification"
        ],
        "summary": "List bulk verification jobs",
        "operationId": "list_bulk_jobs",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List of bulk jobs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "jobs": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/verify/bulk/{job_id}": {
      "get": {
        "tags": [
          "Verification"
        ],
        "summary": "Get bulk job status and results",
        "operationId": "get_bulk_job",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Job status and breakdown",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "job_id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "processing",
                        "completed",
                        "failed"
                      ]
                    },
                    "total_emails": {
                      "type": "integer"
                    },
                    "processed_emails": {
                      "type": "integer"
                    },
                    "valid_count": {
                      "type": "integer"
                    },
                    "invalid_count": {
                      "type": "integer"
                    },
                    "catch_all_count": {
                      "type": "integer"
                    },
                    "disposable_count": {
                      "type": "integer"
                    },
                    "unknown_count": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Verification"
        ],
        "summary": "Cancel a pending bulk job",
        "operationId": "cancel_bulk_job",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Job canceled and reserved credits refunded",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "canceled": {
                      "type": "boolean"
                    },
                    "refunded_credits": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/verify/bulk/{job_id}/download": {
      "get": {
        "tags": [
          "Verification"
        ],
        "summary": "Download verified bulk job results",
        "operationId": "download_bulk_results",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "csv",
                "json"
              ],
              "default": "csv"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "CSV or JSON export stream"
          }
        }
      }
    },
    "/api/v1/credits": {
      "get": {
        "tags": [
          "Credits"
        ],
        "summary": "Get credit balance and usage",
        "operationId": "get_credits",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Credit balance telemetry",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "balance": {
                      "type": "integer",
                      "example": 25000
                    },
                    "lifetime_used": {
                      "type": "integer",
                      "example": 1420
                    },
                    "plan": {
                      "type": "string",
                      "example": "payg"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/credits/history": {
      "get": {
        "tags": [
          "Credits"
        ],
        "summary": "Get credit transactions history",
        "operationId": "get_credit_history",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Credit ledger entries",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "transactions": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/intelligence/risk": {
      "get": {
        "tags": [
          "Risk Intelligence"
        ],
        "summary": "Check domain or email risk signals",
        "operationId": "get_risk_intelligence",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "email",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Risk profile and signals"
          }
        }
      }
    },
    "/api/demo/verify": {
      "post": {
        "tags": [
          "Free Tools"
        ],
        "summary": "Free instant email check (no API key required)",
        "operationId": "demo_verify",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Public verification verdict"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "Pass your secret API key with prefix `bl_live_`"
      }
    }
  }
}