---
title: PaperTube Salesforce API Integration
type: article
created: '2026-04-05'
updated: '2026-04-05'
source_docs:
- raw/2026-02-06-weekly-call-w-120526026.md
tags:
- salesforce
- account-engagement
- pardot
- api
- oauth
- papertube
- abm
- automation
layer: 2
client_source: null
industry_context: null
transferable: true
---

# PaperTube Salesforce API Integration

## Overview

To support programmatic creation of ABM campaigns for PaperTube's ~256 target accounts, a Salesforce Connected App was configured to allow API access to Account Engagement (Pardot). The goal is to automate campaign creation via the Salesforce API rather than manually building hundreds of campaigns in the UI.

The integration was partially completed during a working session between Mark and Karly. The remaining blocker is SSO enablement for Mark's user account in Account Engagement.

---

## Background: Why API-Based Campaign Creation

PaperTube's ABM playbook requires a unique campaign per target company — each with personalized email sequences generated from AI-produced account research reports. Manually creating 256+ campaigns in Account Engagement is not feasible. The Salesforce API allows programmatic campaign creation that can be driven by the research output.

**Key architectural note:** When Connected Campaigns is enabled (the Salesforce-recommended configuration), campaigns must be created via the **Salesforce API** (not the Account Engagement API directly). They then sync automatically into Account Engagement.

See also: [[wiki/clients/papertube/index]] | [[wiki/knowledge/salesforce/abm-campaign-automation]]

---

## Connected App Setup

A Connected App named **"Asymmetric API Integration"** was created in PaperTube's Salesforce org.

### Steps Completed

1. **Enable Connected App creation**
   - Salesforce Setup → search "External Client Apps" → Settings → enable "Allow Creation of Connected Apps"

2. **Create the Connected App**
   - Setup → App Manager → New Connected App
   - Name: `Asymmetric API Integration`
   - Contact Email: Mark's email (`mark.hope@asymmetric.pro`)
   - Enable OAuth Flows: ✅
   - Callback URL: `https://auto.asymmetric.pro`

3. **OAuth Scopes configured**
   - `managed_pardot_services` — required for Account Engagement access
   - `refresh_token` (offline_access) — allows persistent API sessions without re-authentication

4. **Credentials retrieved** (via App Manager → View → Manage Consumer Details)
   - Consumer Key
   - Consumer Secret
   - Staged Consumer Key / Staged Consumer Secret (generated and promoted via Apply)

5. **Business Unit ID retrieved**
   - Marketing Setup → Pardot Account Setup → copy Business Unit ID

### Credentials Storage

All credentials (Consumer Key, Consumer Secret, Business Unit ID) were recorded during the session. Per best practice: always write API credentials to a secure file immediately — Consumer Secret is only shown once and cannot be retrieved later.

---

## Authentication Flow

The integration uses **OAuth 2.0 Username-Password flow** (or JWT Bearer for server-to-server). The security token for Mark's Salesforce user was generated during the session to support authentication.

**Required credentials for API calls:**
| Field | Source |
|---|---|
| Consumer Key | Connected App → Manage Consumer Details |
| Consumer Secret | Connected App → Manage Consumer Details |
| Business Unit ID | Marketing Setup → Pardot Account Setup |
| Username | Mark's Salesforce login |
| Password + Security Token | Mark's user settings |

---

## Current Blocker: SSO Enablement

Mark's Salesforce user account requires **SSO to be enabled for Account Engagement** before the OAuth connection can be completed. Without this, the API authentication flow fails at the Account Engagement authorization step.

**Resolution required:**
- Karly to request the Salesforce admin (or Jess, Salesforce support contact) enable SSO for Mark's user account in Account Engagement.

---

## Next Steps

- [ ] **Karly:** Request Salesforce admin enable SSO for Account Engagement on Mark's user account
- [ ] **Mark:** Test OAuth connection with provided credentials once SSO is enabled
- [ ] **Mark:** Build automation script to programmatically create Salesforce campaigns from ABM research output
- [ ] Determine batch size for initial campaign creation (suggestion: start with 30–50 before scaling to 256)

---

## Related Context

- The campaigns being created will be fed by AI-generated account research reports (Markdown `.md` files, one per target company) produced by an AI agent across 256 unique companies. See [[wiki/knowledge/ai-agents/abm-account-research-automation]].
- Email sequences within each campaign are plain-text (no branded template), which simplifies the campaign structure — no email template creation required.
- The `papertube.pro` sending domain was configured in parallel. See [[wiki/knowledge/salesforce/papertube-email-domain-setup]].

---

## Reference: API Behavior with Connected Campaigns

> When Connected Campaigns is **enabled** (default recommended): create campaigns via the **Salesforce API** → they sync to Account Engagement automatically. Account Engagement API only supports `read` and `query` on campaigns in this mode.
>
> When Connected Campaigns is **disabled**: campaigns can be created directly via the Account Engagement API.

For PaperTube's org, the Salesforce API path is the correct approach.