{
  "openapi": "3.0.1",
  "info": {
    "title": "Salesforce Lead Pusher — Upsert Leads & Contacts",
    "description": "Imports leads from any Apify scraper directly into Salesforce CRM as Leads, Contacts, or Accounts. Email deduplication, 200-record batch upserts, custom field mapping, and free dry-run preview. B2B CRM sync at $0.05 per lead created.",
    "version": "1.0",
    "x-build-id": "XwET8yqVopXxSWvKb"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ryanclinton~salesforce-lead-pusher/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ryanclinton-salesforce-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/ryanclinton~salesforce-lead-pusher/runs": {
      "post": {
        "operationId": "runs-sync-ryanclinton-salesforce-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/ryanclinton~salesforce-lead-pusher/run-sync": {
      "post": {
        "operationId": "run-sync-ryanclinton-salesforce-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": {
          "salesforceUsername": {
            "title": "Salesforce Username",
            "type": "string",
            "description": "Your Salesforce username (email address used to log in). Example: user@mycompany.com"
          },
          "salesforcePassword": {
            "title": "Salesforce Password + Security Token",
            "type": "string",
            "description": "Your Salesforce password concatenated with your security token (no space). Example: MyPassword123TOKEN123. Get your security token at Setup > My Personal Information > Reset Security Token."
          },
          "salesforceClientId": {
            "title": "Connected App Consumer Key",
            "type": "string",
            "description": "Consumer Key from your Salesforce Connected App. Create one at Setup > App Manager > New Connected App. Enable OAuth and add the 'api' scope."
          },
          "salesforceClientSecret": {
            "title": "Connected App Consumer Secret",
            "type": "string",
            "description": "Consumer Secret from your Salesforce Connected App."
          },
          "salesforceLoginUrl": {
            "title": "Salesforce Login URL",
            "type": "string",
            "description": "OAuth token endpoint. Use https://test.salesforce.com for sandbox orgs.",
            "default": "https://login.salesforce.com"
          },
          "leads": {
            "title": "Leads (inline data)",
            "type": "array",
            "description": "Lead records to push to Salesforce. Each item should have at minimum an email (for deduplication) and a company name. Supports output from any Apify scraper or enrichment actor.",
            "default": [
              {
                "name": "Sarah Chen",
                "email": "sarah.chen@acmecorp.com",
                "phone": "+1-415-555-0192",
                "companyName": "Acme Corp",
                "jobTitle": "VP of Engineering",
                "industry": "Technology",
                "website": "https://acmecorp.com",
                "city": "San Francisco",
                "state": "CA",
                "country": "US",
                "description": "Met at SaaStr 2025. Interested in automation tools."
              }
            ]
          },
          "objectType": {
            "title": "Salesforce Object Type",
            "enum": [
              "Lead",
              "Contact",
              "Account"
            ],
            "type": "string",
            "description": "Which Salesforce object to create: Lead (unqualified prospect), Contact (person linked to an Account), or Account (company/organisation).",
            "default": "Lead"
          },
          "skipDuplicates": {
            "title": "Skip duplicates",
            "type": "boolean",
            "description": "Query Salesforce before inserting each batch. Records with a matching Email (for Lead/Contact) or Website/Name (for Account) will be skipped rather than updated.",
            "default": true
          },
          "fieldMapping": {
            "title": "Custom field mapping (optional)",
            "type": "object",
            "description": "Override the default field mapping. Keys are input field names, values are Salesforce API field names. Example: {\"linkedinUrl\": \"LinkedIn_URL__c\"}. Leave empty to use defaults.",
            "default": {}
          },
          "dryRun": {
            "title": "Dry run (preview only)",
            "type": "boolean",
            "description": "Preview the mapped Salesforce records without actually creating or updating anything. Use this to verify your field mapping before committing. Set to false to push live data.",
            "default": true
          },
          "maxLeads": {
            "title": "Max leads to process",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum number of leads to process in a single run. Useful for testing with large datasets.",
            "default": 500
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}