{
  "openapi": "3.1.0",
  "info": {
    "title": "Email Finder Verifier API",
    "version": "1.0.0",
    "description": "Customer-safe API reference for finding and verifying work emails."
  },
  "servers": [
    {
      "url": "https://my.emailfinderverifier.com",
      "description": "Production"
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "paths": {
    "/api/v1/find": {
      "get": {
        "summary": "Find a verified work email",
        "description": "Finds a likely email for a person at a company domain. Trial credits are used only when the response returns a high-confidence, non-catch-all found email.",
        "operationId": "findEmail",
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "manasai.co"
            },
            "description": "Company domain, without protocol or path."
          },
          {
            "name": "first_name",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "Reid"
            }
          },
          {
            "name": "last_name",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "Hoffman"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Finder result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FindResponse"
                },
                "examples": {
                  "found": {
                    "summary": "Verified found email",
                    "value": {
                      "email": "reid@manasai.co",
                      "found": true,
                      "domain": "manasai.co",
                      "reason": "OK",
                      "pattern": "firstname",
                      "attempts": 2,
                      "confidence": "high",
                      "is_catchall": false
                    }
                  },
                  "notFound": {
                    "summary": "No verified email found",
                    "value": {
                      "email": null,
                      "found": false,
                      "domain": "manasai.co",
                      "reason": "No verified email found",
                      "pattern": null,
                      "attempts": 12,
                      "confidence": "low",
                      "is_catchall": false
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/AccountBlocked"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/api/v1/verify": {
      "get": {
        "summary": "Verify a single email",
        "description": "Checks whether a mailbox appears valid. Verification does not use a trial found-email credit.",
        "operationId": "verifyEmail",
        "parameters": [
          {
            "name": "email",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "email",
              "example": "reid@manasai.co"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Verification result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerifyResponse"
                },
                "examples": {
                  "valid": {
                    "summary": "Valid email",
                    "value": {
                      "email": "reid@manasai.co",
                      "status": "valid",
                      "reason": "Verified via SMTP",
                      "mx_host": "worker",
                      "smtp_code": 250
                    }
                  },
                  "unknown": {
                    "summary": "Unconfirmed email",
                    "value": {
                      "email": "person@example.com",
                      "status": "unknown",
                      "reason": "Provider could not be verified safely",
                      "mx_host": null,
                      "smtp_code": null
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/AccountBlocked"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      }
    },
    "schemas": {
      "FindResponse": {
        "type": "object",
        "required": [
          "email",
          "found",
          "domain",
          "reason",
          "pattern",
          "attempts",
          "confidence",
          "is_catchall"
        ],
        "properties": {
          "email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email"
          },
          "found": {
            "type": "boolean"
          },
          "domain": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "pattern": {
            "type": [
              "string",
              "null"
            ]
          },
          "attempts": {
            "type": "integer"
          },
          "confidence": {
            "type": "string",
            "enum": [
              "high",
              "low"
            ]
          },
          "is_catchall": {
            "type": "boolean"
          }
        }
      },
      "VerifyResponse": {
        "type": "object",
        "required": [
          "email",
          "status",
          "reason"
        ],
        "properties": {
          "email": {
            "type": "string",
            "format": "email"
          },
          "status": {
            "type": "string",
            "enum": [
              "valid",
              "invalid",
              "unknown",
              "valid-catchall"
            ]
          },
          "reason": {
            "type": "string"
          },
          "mx_host": {
            "type": [
              "string",
              "null"
            ]
          },
          "smtp_code": {
            "type": [
              "integer",
              "null"
            ]
          },
          "source": {
            "type": "string"
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "detail": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string"
              },
              "code": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "responses": {
      "BadRequest": {
        "description": "Invalid or missing request data",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Missing or invalid API key",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "AccountBlocked": {
        "description": "Account is paused, expired, disabled, or out of credits",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "RateLimited": {
        "description": "Short-window safety limit reached",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      }
    }
  }
}
