{
  "openapi": "3.0.1",
  "info": {
    "title": "Instantly Lead Pusher — Push Any Apify Dataset to Campaigns",
    "description": "Push any Apify dataset into an Instantly.ai campaign or lead list — fields auto-mapped, every extra column becomes a {{custom_variable}} merge tag. Dedup + dry run.",
    "version": "0.1",
    "x-build-id": "sGcNc4XwI0f8DSV3j"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/programmx~instantly-lead-pusher/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-programmx-instantly-lead-pusher",
        "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/programmx~instantly-lead-pusher/runs": {
      "post": {
        "operationId": "runs-sync-programmx-instantly-lead-pusher",
        "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/programmx~instantly-lead-pusher/run-sync": {
      "post": {
        "operationId": "run-sync-programmx-instantly-lead-pusher",
        "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",
        "properties": {
          "instantlyApiKey": {
            "title": "Instantly API key",
            "type": "string",
            "description": "Create one in Instantly → Settings → Integrations → API keys (any paid Instantly plan includes API access; scope `leads:create` or broader). Stored encrypted by Apify and never written to the log. The key stays in your Apify account — this actor only sends it to api.instantly.ai. Leave it empty on a dry run and you get a free offline preview: the actor maps your dataset and shows every field and {{merge_tag}} each lead would receive, without contacting Instantly at all."
          },
          "targetType": {
            "title": "Push into",
            "enum": [
              "campaign",
              "list"
            ],
            "type": "string",
            "description": "Where the leads go. A campaign needs every lead to have an email address; a lead list also accepts rows that only have a name. If unsure, push into a lead list first and review before attaching to a campaign.",
            "default": "campaign"
          },
          "campaignId": {
            "title": "Campaign ID",
            "type": "string",
            "description": "The campaign's UUID — copy it from the campaign's URL: app.instantly.ai/app/campaign/<this part>. Only used when 'Push into' is Campaign.",
            "default": ""
          },
          "listId": {
            "title": "Lead list ID",
            "type": "string",
            "description": "The lead list's UUID. Only used when 'Push into' is Lead list. Leave empty and use 'Create list if missing' below to have the actor find or create a list by name instead.",
            "default": ""
          },
          "createListIfMissing": {
            "title": "Create the lead list if it doesn't exist",
            "type": "boolean",
            "description": "Lead-list target only. The actor first searches your workspace for a list whose name exactly matches 'New list name' and reuses it; only if none exists is a new list created. Safe to leave on for scheduled runs — you will not get one new list per run.",
            "default": false
          },
          "newListName": {
            "title": "New list name",
            "type": "string",
            "description": "Required when 'Create the lead list if it doesn't exist' is on and no list ID is given. Tip: name it after the source, e.g. 'eBay UK car parts sellers'.",
            "default": ""
          },
          "datasetId": {
            "title": "Source dataset ID",
            "type": "string",
            "description": "The Apify dataset holding your leads — any dataset in your account works, whichever actor produced it. Leave empty when this actor is attached to another actor as an integration: the finished run's dataset is passed in automatically.",
            "default": ""
          },
          "payload": {
            "title": "Integration payload (filled automatically)",
            "type": "object",
            "description": "Filled by Apify when this actor runs as an integration on another actor's run; carries that run's default dataset ID. Do not set it manually — use 'Source dataset ID' instead."
          },
          "maxLeads": {
            "title": "Max leads",
            "minimum": 0,
            "type": "integer",
            "description": "Hard cap on dataset rows read, 0 = all. With a real run this caps what can be pushed and billed — start small (e.g. 100), check the result in Instantly, then raise it.",
            "default": 0
          },
          "fieldMapping": {
            "title": "Field mapping override",
            "type": "object",
            "description": "Only needed when auto-detection gets a column wrong — the run log and dry-run preview show what was detected. Keys are Instantly fields (email, first_name, last_name, company_name, job_title, phone, website, personalization), values are your dataset's column names. Example: {\"company_name\": \"storeName\", \"website\": \"shopUrl\"}. Your mapping always beats auto-detection.",
            "default": {}
          },
          "customVariableColumns": {
            "title": "Custom variable columns",
            "type": "array",
            "description": "Leave empty (recommended) to turn EVERY column that isn't a standard field into an Instantly custom variable, usable as a {{merge_tag}} in your email copy. List specific column names here to send only those.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "sendCustomVariables": {
            "title": "Send custom variables",
            "type": "boolean",
            "description": "Off = only the standard fields (name, email, company, …) are sent and your extra columns are ignored. Leave on to keep the personalization data — it is the point of pushing from a scraper instead of a CSV.",
            "default": true
          },
          "skipIfInWorkspace": {
            "title": "Skip leads already anywhere in the workspace",
            "type": "boolean",
            "description": "Instantly skips any lead whose email already exists anywhere in your workspace — any campaign or list. Strictest duplicate guard; skipped leads are never billed by this actor.",
            "default": false
          },
          "skipIfInCampaign": {
            "title": "Skip leads already in a campaign",
            "type": "boolean",
            "description": "On (recommended): a lead already present in any campaign is skipped, so nobody gets emailed twice and re-running this actor is always safe. Skipped leads are never billed.",
            "default": true
          },
          "skipIfInList": {
            "title": "Skip leads already in a list",
            "type": "boolean",
            "description": "On (recommended): a lead already present in any lead list is skipped. Makes re-runs and scheduled pushes idempotent. Skipped leads are never billed.",
            "default": true
          },
          "dedupeByEmail": {
            "title": "De-duplicate the dataset by email before pushing",
            "type": "boolean",
            "description": "On (recommended): if the same email appears on several dataset rows, only the first row is pushed. Duplicates are dropped on our side — never sent to Instantly, never billed.",
            "default": true
          },
          "verifyLeadsOnImport": {
            "title": "Verify emails on import (Instantly credits)",
            "type": "boolean",
            "description": "Asks Instantly to run its email verification on the imported leads. Uses your Instantly verification credits — billed by Instantly, not by this actor.",
            "default": false
          },
          "blocklistId": {
            "title": "Blocklist ID",
            "type": "string",
            "description": "Optional. UUID of a specific Instantly blocklist to check leads against. Leave empty to use your workspace's default blocklist. Blocked leads are never billed.",
            "default": ""
          },
          "batchSize": {
            "title": "Batch size",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Leads per API request (Instantly's maximum is 1,000). The default is fine for almost everyone; smaller batches shrink the blast radius of a single failed request on flaky networks.",
            "default": 500
          },
          "dryRun": {
            "title": "Dry run — preview only, push nothing",
            "type": "boolean",
            "description": "Full rehearsal: checks your API key and target (read-only), reads the dataset, maps every field and custom variable, and reports exactly what WOULD be pushed — but sends nothing to Instantly and bills nothing. Recommended for your first run on any new dataset; turn it off to push for real. With no API key given, a dry run still previews the mapping — it just skips the Instantly checks.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}