{
  "openapi": "3.0.1",
  "info": {
    "title": "Klaviyo Campaign Drafter",
    "description": "Turn product URLs into draft Klaviyo email campaigns. Scrapes each product, writes copy with Claude, creates a draft campaign per product via the Klaviyo MCP Connector. Export data, run via API, schedule and monitor runs, or integrate with other tools.",
    "version": "0.1",
    "x-build-id": "zi2LMdOfbANI5j0X8"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/luis.pinto~klaviyo-campaign-drafter/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-luis.pinto-klaviyo-campaign-drafter",
        "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/luis.pinto~klaviyo-campaign-drafter/runs": {
      "post": {
        "operationId": "runs-sync-luis.pinto-klaviyo-campaign-drafter",
        "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/luis.pinto~klaviyo-campaign-drafter/run-sync": {
      "post": {
        "operationId": "run-sync-luis.pinto-klaviyo-campaign-drafter",
        "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": [
          "productUrls",
          "klaviyoConnector",
          "klaviyoListId",
          "fromEmail"
        ],
        "properties": {
          "productUrls": {
            "title": "Product URLs",
            "minItems": 1,
            "maxItems": 20,
            "type": "array",
            "description": "Between 1 and 20 product page URLs. Each URL becomes one Klaviyo draft campaign — the Actor scrapes the title, description, price, and main image, then Claude writes a subject + preview text + email body. Use canonical product pages (NOT category, collection, or search-result pages), otherwise the scraper extracts noisy data. Mixing domains is fine (Shopify, BigCommerce, WooCommerce, Amazon, Walmart, etc.). Example: https://allbirds.com/products/mens-wool-runners. Tip: 5–10 products per run is a good batch size for review in the Klaviyo dashboard.",
            "items": {
              "type": "string"
            }
          },
          "klaviyoConnector": {
            "title": "Klaviyo MCP Connector",
            "type": "string",
            "description": "Your connected Klaviyo MCP Connector. BEFORE running this Actor, create one in Apify Console > Settings > MCP Connectors > Add new connector > paste https://mcp.klaviyo.com/mcp > Authorize. Klaviyo's MCP supports dynamic OAuth client registration so you don't need to register your own Klaviyo developer app — one click and you're connected."
          },
          "klaviyoListId": {
            "title": "Klaviyo list ID",
            "type": "string",
            "description": "The Klaviyo list or segment ID the draft campaigns will be addressed to. Find it in Klaviyo > Audience > Lists & segments > pick a list > copy the 6-character ID from the URL (looks like Yh5K8m). The campaigns are still drafts — they won't send until you click Send in the Klaviyo dashboard."
          },
          "fromEmail": {
            "title": "From email address",
            "type": "string",
            "description": "Sender email address for the draft campaigns. MUST already be verified as a sending identity in your Klaviyo account (Klaviyo > Settings > Domains & sending) — otherwise the campaign can be created as a draft but won't be sendable. Example: hello@yourbrand.com."
          },
          "fromName": {
            "title": "From name",
            "type": "string",
            "description": "The sender name recipients see in their inbox. Defaults to 'New Arrivals'. Keep it short — most inboxes truncate after ~25 characters. Examples: 'Allbirds', 'Casper Team', 'Sarah from Glossier'.",
            "default": "New Arrivals"
          },
          "campaignNamePrefix": {
            "title": "Campaign name prefix (optional)",
            "type": "string",
            "description": "Prefix shown in the Klaviyo Campaigns list before the product name. Defaults to 'Apify MCP Draft – <today's date>' so successive runs never collide. Example: 'Q3 New Arrivals'.",
            "default": ""
          },
          "includeAboutPage": {
            "title": "Use the brand's About page for tone",
            "type": "boolean",
            "description": "When ON, the Actor tries /about, /about-us, and /pages/about on the first product's domain and feeds the page text to Claude as brand-voice context. Best-effort: if no About page responds within 8 seconds, generation proceeds without it (no failure). Useful for Shopify and DTC stores with a strong written brand voice. OFF by default to keep runs fast and predictable.",
            "default": false
          },
          "model": {
            "title": "LLM model",
            "enum": [
              "anthropic/claude-sonnet-4.6",
              "anthropic/claude-opus-4.7"
            ],
            "type": "string",
            "description": "Model used to write the email copy. Routed through Apify's OpenRouter Actor proxy — you don't need a separate API key, your APIFY_TOKEN is used. Claude Sonnet 4.6 is plenty for subject + preview + 800-char body. Switch to Opus 4.7 only if you need deeper brand-voice matching and don't mind ~10x the LLM cost (still cents per run for 20 emails).",
            "default": "anthropic/claude-sonnet-4.6"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}