{
  "openapi": "3.0.1",
  "info": {
    "title": "Cold Email Sequencer — SMTP, SendGrid & Mailgun",
    "description": "Send personalized cold email sequences via SMTP, SendGrid, or Mailgun. Automated day-3 and day-7 follow-ups. Sequence state persisted in KV Store across runs. CAN-SPAM compliant. $0.05/email.",
    "version": "1.0",
    "x-build-id": "o96pLbBdi157ykGOT"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ryanclinton~outreach-sequencer/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ryanclinton-outreach-sequencer",
        "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/ryanclinton~outreach-sequencer/runs": {
      "post": {
        "operationId": "runs-sync-ryanclinton-outreach-sequencer",
        "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/ryanclinton~outreach-sequencer/run-sync": {
      "post": {
        "operationId": "run-sync-ryanclinton-outreach-sequencer",
        "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": [
          "mode",
          "emailProvider",
          "fromName",
          "fromEmail",
          "unsubscribeUrl",
          "emailTemplate",
          "subjectLine",
          "rateLimitPerRun"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "start",
              "advance"
            ],
            "type": "string",
            "description": "start — sends the first email to every lead in the leads array. advance — scans the KV store for sequences where nextFollowUpAt <= now() and sends the next follow-up.",
            "default": "start"
          },
          "leads": {
            "title": "Enriched lead list",
            "type": "array",
            "description": "Array of lead objects. Required in start mode. Each lead: { email, firstName, companyName, servicesOffered[], summarySnippet }."
          },
          "emailProvider": {
            "title": "Email provider",
            "enum": [
              "smtp",
              "sendgrid",
              "mailgun"
            ],
            "type": "string",
            "description": "smtp — works with any provider that supports SMTP. sendgrid — uses the SendGrid HTTP API v3 (requires apiKey). mailgun — uses the Mailgun Messages API (requires apiKey and mailgunDomain).",
            "default": "smtp"
          },
          "smtpHost": {
            "title": "SMTP host",
            "type": "string",
            "description": "Required when emailProvider is smtp. Your provider's SMTP server hostname. Examples: smtp-relay.brevo.com, smtp.sendgrid.net, smtp.mailgun.org, email-smtp.us-east-1.amazonaws.com, smtp.gmail.com."
          },
          "smtpPort": {
            "title": "SMTP port",
            "minimum": 1,
            "maximum": 65535,
            "type": "integer",
            "description": "Required when emailProvider is smtp. 587 for STARTTLS (recommended for most providers), 465 for SSL.",
            "default": 587
          },
          "smtpUser": {
            "title": "SMTP username",
            "type": "string",
            "description": "Required when emailProvider is smtp. Usually the login email address or username for your provider account."
          },
          "smtpPass": {
            "title": "SMTP password or API key",
            "type": "string",
            "description": "Required when emailProvider is smtp. Your SMTP password or SMTP-specific API key. Stored encrypted."
          },
          "apiKey": {
            "title": "REST API key",
            "type": "string",
            "description": "Required when emailProvider is sendgrid or mailgun. SendGrid: API key with 'Mail Send' permission. Mailgun: private API key starting with 'key-'. Stored encrypted."
          },
          "mailgunDomain": {
            "title": "Mailgun sending domain",
            "type": "string",
            "description": "Required when emailProvider is mailgun. Your verified Mailgun sending domain (e.g. mail.yourdomain.com). Must be verified in your Mailgun account."
          },
          "fromName": {
            "title": "Sender display name",
            "type": "string",
            "description": "The name that appears in the From field of every email. Use a real, recognizable name — e.g. 'Jane at Acme Corp'. Required."
          },
          "fromEmail": {
            "title": "Sender email address",
            "type": "string",
            "description": "The email address all emails are sent from. Must be verified and authorized on your email provider. SPF, DKIM, and DMARC records must be configured for good deliverability. Required."
          },
          "unsubscribeUrl": {
            "title": "Unsubscribe URL",
            "type": "string",
            "description": "Your unsubscribe endpoint URL. The actor substitutes {{sequenceId}} and {{email}} before inserting as {{unsubscribeLink}} in every template. Example: https://yourapp.com/unsubscribe?sid={{sequenceId}}&e={{email}}. Required — CAN-SPAM mandates a working opt-out in every commercial email. You own this endpoint and your compliance."
          },
          "rateLimitPerRun": {
            "title": "Max emails per run",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Hard cap on emails sent per actor run. Set conservatively based on your provider's daily limit: Brevo free = 300/day, SendGrid free = 100/day, AWS SES sandbox = 200/day, Mailgun = account-dependent. Leads that hit the cap get status: deferred. Required.",
            "default": 100
          },
          "emailTemplate": {
            "title": "Email body template (step 1)",
            "type": "string",
            "description": "Body template for the initial email. Available variables: {{firstName}}, {{companyName}}, {{topService}}, {{summarySnippet}}, {{unsubscribeLink}}. Plain text only. Required.",
            "default": "Hi {{firstName}},\n\nI came across {{companyName}} and was impressed by your work in {{topService}}.\n\n{{summarySnippet}}\n\nI'd love to explore how we might work together. Would you be open to a quick 15-minute call this week?\n\nBest,\n[Your name]\n\nTo opt out: {{unsubscribeLink}}"
          },
          "subjectLine": {
            "title": "Email subject (step 1)",
            "type": "string",
            "description": "Subject line for the initial email. Supports {{companyName}} and {{firstName}}. Required.",
            "default": "Quick question for {{companyName}}"
          },
          "followUpTemplate3": {
            "title": "Follow-up template (day 3)",
            "type": "string",
            "description": "Body template for the day-3 follow-up email. Same variables available. Leave blank to disable day-3 follow-up.",
            "default": ""
          },
          "followUpTemplate7": {
            "title": "Follow-up template (day 7)",
            "type": "string",
            "description": "Body template for the day-7 follow-up email. Same variables available. Leave blank to disable day-7 follow-up.",
            "default": ""
          },
          "followUpSubject3": {
            "title": "Follow-up subject (day 3)",
            "type": "string",
            "description": "Subject line for the day-3 follow-up. Leave blank to re-use step 1 subject prefixed with 'Re: '.",
            "default": ""
          },
          "followUpSubject7": {
            "title": "Follow-up subject (day 7)",
            "type": "string",
            "description": "Subject line for the day-7 follow-up. Leave blank to re-use step 1 subject prefixed with 'Re: '.",
            "default": ""
          },
          "kvStoreName": {
            "title": "KV store name for sequence state",
            "type": "string",
            "description": "Name of the Apify Key-Value Store used to persist sequence state across runs. Each distinct campaign should use a unique name so sequences don't collide.",
            "default": "outreach-sequences"
          },
          "dryRun": {
            "title": "Dry run (no emails sent)",
            "type": "boolean",
            "description": "When true, templates are rendered and logged but no emails are dispatched and no charges are made. Use to verify template output before going live.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}