Which Marketing-Related REST Endpoints Are Available in Salesforce

According to the Salesforce REST API Resource List, key marketing endpoints include:

Campaign Management: /services/data/vXX.0/sobjects/Campaign — Create, read, update, delete Campaign records.

Campaign Members: /services/data/vXX.0/sobjects/CampaignMember — Manage Campaign membership and status.

Lead Management: /services/data/vXX.0/sobjects/Lead — CRUD operations on Lead records.

Contact Management: /services/data/vXX.0/sobjects/Contact — Manage Contact records for marketing.

Email Send: /services/data/vXX.0/actions/standard/emailSimple — Send simple emails via REST.

How to Create and Query Email Campaigns Using REST API Endpoints

Manage email campaigns via REST. As documented in the Campaign Object Reference:

Create Campaign:


POST /services/data/vXX.0/sobjects/Campaign
{
  "Name": "Q1 Email Campaign",
  "Type": "Email",
  "Status": "Planned",
  "StartDate": "2025-01-01",
  "EndDate": "2025-03-31"
}

Query Campaigns:


GET /services/data/vXX.0/query?q=SELECT+Id,Name,Status,NumberOfLeads,
NumberOfContacts+FROM+Campaign+WHERE+Type='Email'

How to Add and Manage Campaign Members Through REST API Calls

Add and manage campaign members:

Add Lead to Campaign:


POST /services/data/vXX.0/sobjects/CampaignMember
{
  "CampaignId": "7010000000000001",
  "LeadId": "00Q0000000000001",
  "Status": "Sent"
}

Add Contact to Campaign:


POST /services/data/vXX.0/sobjects/CampaignMember
{
  "CampaignId": "7010000000000001",
  "ContactId": "0030000000000001",
  "Status": "Sent"
}

Update Member Status:


PATCH /services/data/vXX.0/sobjects/CampaignMember/{id}
{
  "Status": "Responded"
}

How to Build and Query Contact Lists for Marketing Campaigns via REST

Build and manage contact lists:

Query Contacts:


GET /services/data/vXX.0/query?q=SELECT+Id,Email,FirstName,LastName
+FROM+Contact+WHERE+HasOptedOutOfEmail=false+AND+Email!=null

Query Leads:


GET /services/data/vXX.0/query?q=SELECT+Id,Email,FirstName,LastName
+FROM+Lead+WHERE+HasOptedOutOfEmail=false+AND+IsConverted=false

Bulk Query: Use /services/data/vXX.0/jobs/query for large datasets exceeding 2,000 records.

How to Send Emails Through Salesforce REST API Endpoints

Send emails using REST endpoints:

Simple Email Send:


POST /services/data/vXX.0/actions/standard/emailSimple
{
  "inputs": [{
    "emailAddresses": "recipient@example.com",
    "emailSubject": "Your Order Confirmation",
    "emailBody": "Thank you for your order.",
    "senderType": "CurrentUser"
  }]
}

Note: REST email sending is subject to Salesforce email limits (5,000/day).

How to Manage Email Opt-Out and Unsubscribe Preferences via REST API

Respect opt-out and unsubscribe preferences:

Check Opt-Out Status:


GET /services/data/vXX.0/sobjects/Contact/{id}?fields=HasOptedOutOfEmail

Update Opt-Out:


PATCH /services/data/vXX.0/sobjects/Contact/{id}
{
  "HasOptedOutOfEmail": true
}

How to Track Marketing Email Engagement and Campaign Statistics via REST

Track marketing engagement via REST:

Query Tasks (Emails Logged):

GET /services/data/vXX.0/query?q=SELECT+Id,Subject,WhoId,ActivityDate

+FROM+Task+WHERE+Type='Email'

Query Email Messages:

GET /services/data/vXX.0/query?q=SELECT+Id,Subject,ToAddress,Status

+FROM+EmailMessage

Campaign Statistics:

GET /services/data/vXX.0/query?q=SELECT+Id,Name,NumberSent,

NumberOfResponses+FROM+Campaign

Which Authentication Methods Support REST API Marketing Integrations

Authenticate REST API calls as described in the Trailhead REST API Basics module: OAuth 2.0: Standard authentication for external applications. Use Web Server or JWT Bearer flows. Session ID: From Apex UserInfo.getSessionId() for internal calls. Named Credentials: Securely store authentication for external callouts. Authorization Header: Bearer {access_token} for all API calls.

How Bulk API Handles Large-Volume Marketing Data Operations

Handle large marketing data volumes using the Bulk API 2.0: Bulk Query: Query millions of Contacts/Leads for segmentation. Bulk Insert: Import large Lead lists from marketing events. Bulk Update: Update Campaign Member statuses in batches. Async Processing: Submit job, poll for completion, retrieve results.

What Rate and Volume Limits Apply to Marketing REST API Operations

Key limits for marketing integrations: Daily API Calls: Varies by edition—typically 100,000+ for Enterprise. Concurrent Calls: 25 long-running calls per user. Query Results: 2,000 records per query batch (use queryMore for pagination). Bulk API: 10,000 batches per 24 hours.

Which Integration Patterns Connect Salesforce REST API with Marketing Platforms

Common marketing integration patterns: Marketing Automation Sync: Bi-directional sync of Leads/Contacts with platforms like HubSpot, Marketo. Email Platform Integration: Sync subscribers and engagement data with ESPs. Event Platform Sync: Import event registrations as Leads with Campaign association. Analytics Integration: Push email metrics to BI tools for reporting.

What Marketing Automation Use Cases REST API Enables in Salesforce

REST API enables marketing automation: Drip Campaigns: Build drip campaigns with scheduled API calls. Sequences: Implement email sequences and follow-up sequences. Triggered Sends: API calls from webhooks for triggered emails. Lead Scoring: Update Lead scores based on engagement data from external systems.

REST API Best Practices for Efficient Marketing Data Operations

Use Bulk API: For operations exceeding 200 records, use Bulk API instead of multiple REST calls. Paginate Results: Use queryMore for large result sets to avoid timeouts. Handle Rate Limits: Implement exponential backoff when hitting API limits. Cache Where Possible: Cache static data like templates to reduce API calls. Monitor Usage: Track API consumption to avoid hitting daily limits.

Enhanced Marketing Email Capabilities That Scale Beyond REST API Limits

For organizations needing enhanced marketing email beyond REST API capabilities, MassMailer operates 100% native to Salesforce. Unlimited mass email without API constraints. Complete email capabilities with email analytics, email tracking, and email automation. Use the email builder for superior email deliverability.

Key Takeaways

  • REST API provides endpoints for Campaigns, Leads, Contacts, and email operations
  • Use Bulk API for large-volume marketing data operations
  • Email sending via REST is subject to 5,000/day limits
  • Native solutions provide enhanced marketing capabilities beyond API constraints

Ready to move beyond API constraints for your Salesforce marketing email? Schedule a free strategy session to see how MassMailer delivers unlimited native Salesforce campaigns with full template support, built-in engagement tracking, and zero API call overhead. Explore best-in-class capabilities for Salesforce marketing teams →