Skip to content

API Selection: Quick Reference

Every Salesforce API at a glance with rate limits, volume thresholds, and authentication flows. For full details, see Salesforce API Landscape Deep Dive.

API Selection Cheat Sheet

APIProtocolFormatVolumeBest For
REST APIRESTJSONLow-med (1-200 records)Default for CRUD, modern integrations
SOAP APISOAPXMLLow-medLegacy WSDL systems, Partner WSDL
Bulk API 2.0RESTCSV/JSONHigh (2K-100M records/24h)Large data loads, migrations, batch sync
Composite APIRESTJSONLow-med (25 subrequests)Multi-step ops, reducing round trips
sObject CollectionsRESTJSONUp to 200 recordsBulk CRUD on same object type
sObject TreeRESTJSONUp to 200 recordsCreating parent-child record trees
Pub/Sub APIgRPCAvroEvent-basedHigh-throughput event streaming (strategic)
Platform Events APIRESTJSONEvent-basedCustom business events
Change Data CapturePub/SubAvroEvent-basedAutomatic data change notifications
GraphQL APIGraphQLJSONLow-medFlexible queries, mobile optimization
Metadata APISOAP/RESTXML/JSONN/ADeployments, org configuration
Tooling APIREST/SOAPJSON/XMLN/ADev tools, IDE, code analysis
Apex REST/SOAPREST/SOAPJSON/XMLLow-medCustom business logic endpoints

API Decision Flowchart

flowchart TD
    A[What do you need?] --> B{Data or Events<br/>or Metadata?}
    B -->|Metadata| C[Metadata API / Tooling API]
    B -->|Events| D{Data changes<br/>or business events?}
    D -->|Data changes| E[Change Data Capture]
    D -->|Business events| F[Platform Events]
    D -->|External subscriber| G[Pub/Sub API - gRPC]
    B -->|Data CRUD| H{How many records?}
    H -->|"1-200"| I{Multiple related<br/>ops in one call?}
    I -->|Yes| J[Composite API]
    I -->|No| K{Need flexible<br/>query shape?}
    K -->|Yes| L[GraphQL API]
    K -->|No| M[REST API]
    H -->|"200-2K"| N[sObject Collections<br/>or Bulk API 2.0]
    H -->|"2K+"| O[Bulk API 2.0]

    style M fill:#e8f5e9
    style J fill:#e8f5e9
    style O fill:#fff3e0
    style E fill:#e3f2fd
    style F fill:#e3f2fd
    style G fill:#e3f2fd

Rate Limits — The Numbers You Must Know

Daily API Request Limits

EditionBase Allocation (24h)Per-User Addition
Enterprise100,000+1,000 per SF license, +200 per other
Unlimited500,000+1,000 per SF license, +200 per other
Performance500,000+1,000 per SF license, +200 per other

API limit math at the board

Always show the math. Example: “With 500 Salesforce licenses on Unlimited, we have 500,000 base + 500,000 user = 1,000,000 daily calls. Our integration uses 200,000/day, leaving 80% headroom.” If the math does not work, redesign with Bulk API, Composite, or event-driven patterns.

Critical Limits Table

LimitValueWhy It Matters
Daily API calls100K-500K base (by edition)Exceeding = production outage
Concurrent long-running calls25 (5 for dev org)Calls > 20s count; most overlooked limit
Apex callout timeout120s max per callout (10s default, configurable via setTimeout), 120s cumulative per transactionRequest-Reply default is 10s — increase with setTimeout when needed
Composite subrequests25 per requestUse to consolidate 25 calls into 1
sObject Collections200 records per requestQuick bulk CRUD without Bulk API overhead
Bulk API daily batches15,000Rarely hit but plan for high-frequency jobs
Bulk API max file size150 MB per uploadSplit large files if needed
Bulk API max records/24h100 millionPartition very large migrations across days
Bulk Query result size15 GB per jobLarge exports may need multiple queries
Streaming/Pub/Sub concurrent clients2,000Scale subscriber architecture accordingly
Platform Events per hourVaries by entitlementEnterprise Plus: 500K+ daily
Platform Event retention24h standard / 72h high-volume (standard-volume being retired; new events are high-volume by default)Events gone after retention window
CDC retention3 daysSubscriber down > 3 days = events lost
API request timeout120 secondsLong-running sync calls risk this limit

Volume Decision Thresholds

Records per TransactionRecommended API
1-25REST API (individual calls or Composite)
25-200sObject Collections or Composite Batch
200-2,000Bulk API 2.0 (serial) or sObject Collections
2,000-100,000Bulk API 2.0 (serial mode)
100,000-10MBulk API 2.0 (parallel mode)
10M+Bulk API 2.0 + partitioned jobs + off-peak

Serial vs Parallel Bulk API

Use serial mode when loading parent-child data or when records share lock contention (e.g., all Contacts under the same Account). Parallel mode causes “UNABLE_TO_LOCK_ROW” errors. This is a frequent CTA scenario trap.

Event Technology Comparison

FeaturePlatform EventsCDCPub/Sub APIStreaming (Legacy)
SchemaCustom-definedMirrors objectSubscribes to PE/CDCSOQL-based
PublishApex, Flow, APIAutomatic on DMLgRPCAutomatic
SubscribeApex Trigger, Flow, LWC, APISame as PEgRPC (external)CometD
Retention24h / 72h (HV)3 daysPer event typeNone
DeliveryAt-least-onceAt-least-onceAt-least-onceAt-most-once
StatusStrategicStrategicStrategicMaintenance mode
External publish?YesNoYesNo
Field change tracking?ManualAutomaticVia CDC channelSOQL-defined

Quick rule: CDC vs Platform Events

CDC = “What data changed on this record?” (automatic, field-level tracking) Platform Events = “Something business-meaningful happened” (custom semantics like OrderSubmitted, PaymentFailed) They are not mutually exclusive — use both when the scenario calls for it.

Authentication Flows — Quick Pick

ScenarioOAuth FlowUser Context?
Server-to-server (default for integrations)JWT BearerService user
User-facing web appWeb Server (Auth Code)Yes
Machine-to-machine, no user contextClient CredentialsNo
Input-constrained device (IoT, TV)Device FlowYes (out-of-band)
Legacy scripts (avoid in new designs)Username-Password (deprecated)No (insecure)

Named Credentials — always

Always recommend Named Credentials for Salesforce-initiated callouts. They handle token management, refresh, and secure storage. Hardcoding credentials or storing tokens in Custom Settings is an anti-pattern the board will challenge. For the new model, use External Credentials with Named Credentials for multi-protocol auth support.

Integration Security

ConcernWhat to Know
mTLS / Certificate AuthMutual TLS — both sides present certificates. Required in banking, healthcare, and government integrations. Configure via Salesforce certificate management.
External CredentialsNew model replacing legacy Named Credentials. Separates authentication (External Credential) from endpoint (Named Credential). Supports OAuth, JWT, custom headers, and AWS Signature.
IP AllowlistingLock Connected Apps to specific IP ranges. Combine with OAuth scopes for defense-in-depth.
Shield Encrypted FieldsEncrypted fields return masked values in API responses unless the caller has the “View Encrypted Data” permission. Plan for this in integration design — downstream systems may receive masked data unexpectedly.

External Credentials at the board

If the scenario mentions Named Credentials, clarify whether it is the legacy model (single object) or the new model (External Credential + Named Credential). The new model is the strategic direction and supports per-user or per-named-principal authentication. Always recommend the new model for greenfield designs.

Reverse-Engineered Use Cases

Scenario 1: E-Commerce Order Sync

Situation: Shopify processes 50,000 orders/day. Each order needs to create an Account, Contact, Order, and 3 Order Items in Salesforce. Real-time not required — hourly sync is acceptable.

What you’d present:

  • API: Bulk API 2.0 (50K records/day is well above REST threshold)
  • Mode: Serial (parent-child: Account —> Contact —> Order —> Order Items)
  • API budget: 4 Bulk API jobs/hour x 24h = 96 daily batches (well under 15K limit)
  • Auth: JWT Bearer flow, dedicated integration user
  • Error handling: Partial failure handling — success records commit, failed records retry next cycle

Scenario 2: Real-Time Credit Check

Situation: Loan officers need instant credit scores when creating Opportunity. External credit bureau responds in 600ms. 200 checks/day.

What you’d present:

  • API: REST callout from Apex (Request-Reply pattern)
  • Timeout: 600ms well within 10s limit
  • API budget: 200 calls/day is negligible vs. allocation
  • Auth: Named Credentials with External Credential (OAuth to credit bureau)
  • Fallback: Circuit breaker in Platform Cache; if bureau down, show “credit check pending” and queue for retry

Scenario 3: Customer Portal with Live Updates

Situation: Customer portal must show case status changes within 10 seconds. 5,000 active portal users, approximately 2,000 case updates/hour.

What you’d present:

  • Event tech: Change Data Capture on Case object (automatic, field-level tracking)
  • Subscriber: Pub/Sub API (gRPC) for high-throughput external consumption
  • Why not polling: 5,000 users polling every 10s = 1.8M API calls/hour (impossible)
  • Why CDC over PE: Case status is a data change, not a custom business event
  • Recovery: If subscriber down > 3 days, run batch reconciliation job via Bulk API 2.0

Composite API Variants — Quick Pick

VariantMax Records/SubrequestsDependencies?Use Case
Composite25 subrequestsYes (reference results)Create Account, then Contact referencing Account ID
Composite Batch25 subrequestsNo (all independent)Multiple independent operations
sObject Tree200 recordsParent-childCreate Account with child Contacts/Opps in one call
sObject Collections200 recordsNoBulk update 200 records of same type

Sources