Verified on 2026-08-01.

Why the old guide changed

Metadata, Tooling, and Bulk aren’t interchangeable sizes of one API. They address configuration, developer tooling, and high-volume data. A useful chooser must also include REST, SOAP, Composite, GraphQL, and UI API.

Decision matrix

NeedStart withReason
CRUD/query business recordsREST APIDirect synchronous resource model
Several dependent REST operationsComposite APIFewer round trips and optional transactional grouping
Large asynchronous ingest/extractBulk API 2.0Job-based CSV processing and partial-result handling
Deploy/retrieve configurationMetadata APIMetadata lifecycle and package manifests
Tests, traces, coverage, dev artifactsTooling APIDeveloper-tool objects
Flexible graph-shaped readsGraphQL APIClient-selected related fields
Salesforce-shaped UI dataUI APILayout, metadata, data, and user context
Existing enterprise WSDL contractSOAP APIStrong generated contract and mature integrations

Choose first by resource: records, metadata, tooling, or UI. Then consider volume, latency, transaction boundaries, supported objects, API version, limits, and client capability.

Safe examples

For a small synchronous query, use REST through the authenticated CLI without exposing a token:

1
2
sf data query --target-org integration-test \
  --query "SELECT Id, Name FROM Account ORDER BY CreatedDate DESC LIMIT 10" --json

For a large CSV upsert, use Bulk API 2.0 and reconcile every result category:

1
2
sf data upsert bulk --target-org integration-test \
  --sobject Account --file accounts.csv --external-id External_Id__c --wait 10

Use OAuth with least scopes, an External Client App for new Salesforce OAuth integrations where applicable, TLS, secret rotation, timeouts, idempotency keys or stable external IDs, bounded retries, and structured logs without payloads or credentials.

Tradeoffs

REST is simple but chatty. Composite reduces calls but creates larger failure surfaces. GraphQL avoids over-fetching but isn’t a replacement for every mutation or metadata operation. UI API respects Salesforce UI semantics but couples clients to that model. Bulk API 2.0 scales but is asynchronous and can partially succeed. SOAP provides a rigid contract at the cost of XML and generated-client complexity.

Migration checklist

  1. Inventory endpoints by resource, call volume, latency, and failure semantics.
  2. Remove claims that Bulk API is for reporting or Tooling API is a general refactoring engine.
  3. Move large record jobs to Bulk API 2.0 only when asynchronous partial results are acceptable.
  4. Keep configuration delivery on Metadata API and developer observations on documented Tooling objects.
  5. Pin an API version and test the next version before upgrading.
  6. Add limit, timeout, retry, duplicate, permission, and partial-failure tests.
  7. Verify record counts, metadata component sets, and final business state—not only HTTP success.

Official sources