{
  "openapi": "3.0.1",
  "info": {
    "title": "Pipedrive Lead Pusher — Sync Leads to CRM",
    "description": "Syncs scraped leads into Pipedrive CRM as organizations, persons, and deals. Duplicate detection, ICP score filtering, dry-run preview, and dataset chaining from any Apify actor. $0.05/lead.",
    "version": "1.0",
    "x-build-id": "9EkwMCnfHvLqtEgNV"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ryanclinton~pipedrive-lead-pusher/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ryanclinton-pipedrive-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~pipedrive-lead-pusher/runs": {
      "post": {
        "operationId": "runs-sync-ryanclinton-pipedrive-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~pipedrive-lead-pusher/run-sync": {
      "post": {
        "operationId": "run-sync-ryanclinton-pipedrive-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",
        "required": [
          "pipedriveCompanyDomain"
        ],
        "properties": {
          "pipedriveApiToken": {
            "title": "Pipedrive API Token",
            "type": "string",
            "description": "Your Pipedrive personal API token. Find it at: Settings > Personal preferences > API. Leave empty for dry-run preview mode."
          },
          "pipedriveCompanyDomain": {
            "title": "Pipedrive Company Domain",
            "type": "string",
            "description": "Your Pipedrive subdomain (e.g. 'acme' for acme.pipedrive.com). Required.",
            "default": "yourcompany"
          },
          "leads": {
            "title": "Leads (inline data)",
            "type": "array",
            "description": "Lead objects to push to Pipedrive. Each should have at least a companyName or domain. Supports output from B2B Lead Gen Suite, Lead Scoring Engine, or custom data.",
            "default": [
              {
                "domain": "growthagency.io",
                "companyName": "Growth Agency",
                "city": "Austin",
                "state": "TX",
                "country": "United States",
                "industry": "Marketing & Advertising",
                "emails": [
                  "hello@growthagency.io"
                ],
                "contacts": [
                  {
                    "name": "Sarah Chen",
                    "title": "Founder",
                    "email": "sarah@growthagency.io",
                    "phone": "+1-512-555-0192"
                  }
                ],
                "icpScore": 82,
                "icpGrade": "A"
              }
            ]
          },
          "datasetId": {
            "title": "Apify Dataset ID",
            "type": "string",
            "description": "Apify dataset ID to pull leads from (alternative to inline leads). Use this to chain with B2B Lead Gen Suite, Lead Scoring Engine, or other pipeline actors."
          },
          "createOrganizations": {
            "title": "Create organizations",
            "type": "boolean",
            "description": "Create Pipedrive organization records from lead company names and domains.",
            "default": true
          },
          "createPersons": {
            "title": "Create persons",
            "type": "boolean",
            "description": "Create Pipedrive person records from lead contacts and emails, linked to their organization.",
            "default": true
          },
          "createDeals": {
            "title": "Create deals",
            "type": "boolean",
            "description": "Create a Pipedrive deal for each lead, linked to the organization and first person.",
            "default": false
          },
          "skipDuplicateOrgs": {
            "title": "Skip duplicate organizations",
            "type": "boolean",
            "description": "Search Pipedrive for an existing organization with the same name before creating a new one. Prevents duplicates. Recommended.",
            "default": true
          },
          "dealTitle": {
            "title": "Deal title template",
            "type": "string",
            "description": "Template for deal titles. Use {{companyName}}, {{domain}}, {{icpScore}}, {{icpGrade}}, {{city}}, {{country}}, {{industry}} as placeholders.",
            "default": "New Lead: {{companyName}}"
          },
          "dealStageId": {
            "title": "Deal stage ID",
            "type": "integer",
            "description": "Pipedrive stage ID to assign new deals to. Find stage IDs at: Settings > Pipeline. Leave empty to use default stage."
          },
          "minIcpScore": {
            "title": "Minimum ICP score filter",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Only push leads with an icpScore (or score) at or above this threshold. Set to 0 or leave empty to push all leads."
          },
          "dryRun": {
            "title": "Dry run (preview only)",
            "type": "boolean",
            "description": "Preview mapped Pipedrive data without actually pushing records. Use this to verify field mapping before committing. Automatically enabled when no API token is provided.",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}