{
  "openapi": "3.0.1",
  "info": {
    "title": "AI Bulk Email Sender & Validator",
    "description": "AI Bulk Email Sender & Validator enables Cold Outreach Automation with personalized AI campaigns and reliable email validation. Send bulk campaigns through SendGrid, AWS SES, SMTP, Resend, or Mailgun with DNS and SMTP verification.",
    "version": "1.0",
    "x-build-id": "ZZ6JDhC2Z4JPJHxEw"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/hlymrk~ai-bulk-email-sender-and-validator/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-hlymrk-ai-bulk-email-sender-and-validator",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/hlymrk~ai-bulk-email-sender-and-validator/runs": {
      "post": {
        "operationId": "runs-sync-hlymrk-ai-bulk-email-sender-and-validator",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/hlymrk~ai-bulk-email-sender-and-validator/run-sync": {
      "post": {
        "operationId": "run-sync-hlymrk-ai-bulk-email-sender-and-validator",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "emailProvider",
          "providerConfig",
          "fromEmail",
          "recipients",
          "validateEmails",
          "validationLevel",
          "batchSize",
          "delayBetweenBatches",
          "dryRun"
        ],
        "properties": {
          "emailProvider": {
            "title": "Email Provider",
            "enum": [
              "smtp",
              "sendgrid",
              "resend",
              "ses",
              "mailgun"
            ],
            "type": "string",
            "description": "Choose your email service provider",
            "default": "smtp"
          },
          "providerConfig": {
            "title": "Provider Configuration",
            "type": "object",
            "description": "Provider-specific configuration. See documentation for setup guides."
          },
          "fromEmail": {
            "title": "From Email",
            "pattern": "^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$",
            "type": "string",
            "description": "Sender email address (must be verified with your provider)"
          },
          "fromName": {
            "title": "From Name",
            "type": "string",
            "description": "Sender display name (optional)"
          },
          "replyTo": {
            "title": "Reply-To Email",
            "pattern": "^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$",
            "type": "string",
            "description": "Optional reply-to email address"
          },
          "recipients": {
            "title": "Recipients",
            "minItems": 1,
            "maxItems": 10000,
            "type": "array",
            "description": "List of email recipients with optional custom fields for personalization"
          },
          "useAiComposer": {
            "title": "Use AI Email Composer",
            "type": "boolean",
            "description": "Enable AI to compose email content based on your prompt and context",
            "default": false
          },
          "aiMode": {
            "title": "AI Configuration Mode",
            "enum": [
              "openrouter",
              "byok"
            ],
            "type": "string",
            "description": "OpenRouter: 200+ models, zero setup. BYOK: Direct API access for cost optimization.",
            "default": "openrouter"
          },
          "openrouterModel": {
            "title": "OpenRouter Model",
            "enum": [
              "openrouter/auto",
              "openai/gpt-4o-mini",
              "openai/gpt-4o",
              "openai/gpt-4-turbo",
              "anthropic/claude-3-5-sonnet",
              "anthropic/claude-3-5-haiku",
              "anthropic/claude-3-opus",
              "google/gemini-pro-1.5",
              "google/gemini-flash-1.5",
              "meta-llama/llama-3.1-8b-instruct",
              "meta-llama/llama-3.1-70b-instruct",
              "mistralai/mistral-7b-instruct",
              "cohere/command-r-plus"
            ],
            "type": "string",
            "description": "Choose from 200+ available models. Popular options listed below.",
            "default": "openai/gpt-4o-mini"
          },
          "aiProvider": {
            "title": "AI Provider (BYOK Mode)",
            "enum": [
              "openai",
              "anthropic"
            ],
            "type": "string",
            "description": "Choose your AI/LLM provider for BYOK mode",
            "default": "openai"
          },
          "aiApiKey": {
            "title": "AI API Key (BYOK Mode)",
            "type": "string",
            "description": "API key for your AI provider (required only for BYOK mode)"
          },
          "aiModel": {
            "title": "AI Model (BYOK Mode)",
            "type": "string",
            "description": "AI model to use for composition in BYOK mode",
            "default": "gpt-4o-mini"
          },
          "aiPrompt": {
            "title": "AI Composition Prompt",
            "type": "string",
            "description": "Instructions for the AI to compose the email (e.g., 'Write a professional follow-up email about our product demo')"
          },
          "aiContext": {
            "title": "AI Context",
            "type": "string",
            "description": "Background information and context for the AI to use when composing emails (company info, product details, etc.)"
          },
          "personalizePerRecipient": {
            "title": "Personalize Per Recipient",
            "type": "boolean",
            "description": "Generate unique email content for each recipient using their custom fields (increases AI costs)",
            "default": false
          },
          "subject": {
            "title": "Email Subject",
            "type": "string",
            "description": "Email subject line (ignored if using AI composer)"
          },
          "htmlBody": {
            "title": "HTML Body",
            "type": "string",
            "description": "HTML email content (ignored if using AI composer)"
          },
          "textBody": {
            "title": "Text Body",
            "type": "string",
            "description": "Plain text email content (ignored if using AI composer)"
          },
          "validateEmails": {
            "title": "Validate Email Addresses",
            "type": "boolean",
            "description": "Validate recipient email addresses before sending (recommended)",
            "default": true
          },
          "validationLevel": {
            "title": "Validation Level",
            "enum": [
              "format",
              "dns",
              "smtp"
            ],
            "type": "string",
            "description": "Level of email validation to perform. DNS recommended for best balance of speed and accuracy.",
            "default": "dns"
          },
          "enableTemplateVariables": {
            "title": "Enable Template Variables",
            "type": "boolean",
            "description": "Replace {{variable}} placeholders with recipient data (e.g., {{name}}, {{company}}, {{email}}). Supports nested properties ({{user.company}}) and defaults ({{name|Guest}}).",
            "default": true
          },
          "validationCacheEnabled": {
            "title": "Enable Validation Cache",
            "type": "boolean",
            "description": "Cache validation results to speed up repeated validations (recommended for recurring campaigns)",
            "default": true
          },
          "validationCacheTTL": {
            "title": "Validation Cache TTL (hours)",
            "minimum": 1,
            "maximum": 168,
            "type": "integer",
            "description": "How long to cache validation results (in hours). Default: 24 hours",
            "default": 24
          },
          "batchSize": {
            "title": "Batch Size",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Number of emails to send per batch (affects rate limiting)",
            "default": 10
          },
          "delayBetweenBatches": {
            "title": "Delay Between Batches (ms)",
            "minimum": 0,
            "maximum": 60000,
            "type": "integer",
            "description": "Delay in milliseconds between batches to respect rate limits",
            "default": 1000
          },
          "dryRun": {
            "title": "Dry Run",
            "type": "boolean",
            "description": "Test mode - validate and compose emails without actually sending them",
            "default": false
          },
          "bcc": {
            "title": "BCC Recipients",
            "type": "array",
            "description": "Optional list of BCC recipients (hidden from main recipients)"
          },
          "cc": {
            "title": "CC Recipients",
            "type": "array",
            "description": "Optional list of CC recipients (visible to all recipients)"
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}