Back to blog
CRMGuides & Tutorials

How to get your Salesforce API Keys

Learn how to get your Salesforce API keys step-by-step. Set up a Connected App, configure OAuth 2.0, and manage credentials securely.

Saurabh RaiSaurabh Rai

Saurabh Rai

5 min read
How to get your Salesforce API Keys

What's Salesforce?

Salesforce is the leading CRM in the enterprise world. It holds customer data, sales pipelines, support tickets, and marketing campaigns for companies ranging from startups to Fortune 500s. If you're building anything that touches customer data, you'll eventually need to connect to Salesforce.

Note: Salesforce doesn't use traditional API keys. It uses OAuth 2.0 authentication via Connected Apps, which provides a Consumer Key (Client ID) and Consumer Secret (Client Secret). This guide walks you through setting that up.

What You Can Build with Salesforce APIs

Salesforce APIs let you programmatically access CRM data:

  • Lead Management: Sync leads between marketing tools and Salesforce
  • Contact & Account Sync: Keep customer records consistent across systems
  • Opportunity Tracking: Pull pipeline data into dashboards or analytics tools
  • Custom Objects: Access any custom data structures your org has created
  • Activity Logging: Create notes, events, and tasks programmatically

Prerequisites

Before you start, you'll need:

Getting Your Salesforce API Credentials: Step-by-Step

Step 1: Navigate to App Manager

  1. Log into Salesforce
  2. Click the gear icon → Setup
  3. In the Quick Find box, search App Manager
  4. Click New Connected App (top right)

Step 2: Configure Basic Information Fill in the required fields:

  • Connected App Name: Something descriptive (e.g., MyApp_Integration)
  • API Name: Auto-fills based on app name
  • Contact Email: Use a shared mailbox, not someone who might leave

Step 3: Enable OAuth Settings This is where the actual credentials come from:

  1. Check Enable OAuth Settings
  2. Callback URL: For server-to-server integrations, use a placeholder like https://login.salesforce.com/services/oauth2/callback
  3. Selected OAuth Scopes: Pick what you need:
    • Full access (full) — For complete API access
    • Access and manage your data (api) — Standard API operations
    • Perform requests on your behalf at any time (refresh_token, offline_access) — Required if you need refresh tokens

For server-to-server integrations (no user login), also check Enable Client Credentials Flow.

Step 4: Save and Wait Click Save. Salesforce takes 2-10 minutes to provision your app.

Step 5: Get Your Consumer Key and Secret

  1. Return to App Manager
  2. Find your app in the list
  3. Click the dropdown arrow → View
  4. In the API (Enable OAuth Settings) section, click Manage Consumer Details
  5. Verify your identity (Salesforce sends a verification code to your email)
  6. Copy and store securely:
    • Consumer Key (this is your Client ID)
    • Consumer Secret (this is your Client Secret)

Step 6: Configure Policies (For Client Credentials Flow) If using Client Credentials Flow for server-to-server auth:

  1. In App Manager, find your app → Manage
  2. Click Edit Policies
  3. Under Client Credentials Flow, set:
    • Run As: Select an integration user (create a dedicated one with minimum required permissions)
  4. Save

Step 7: Test Your Connection For Client Credentials Flow, test with cURL:


curl -X POST https://login.salesforce.com/services/oauth2/token \
   -H "Content-Type: application/x-www-form-urlencoded" \
   -d "grant_type=client_credentials" \
   -d "client_id=YOUR_CONSUMER_KEY" \
   -d "client_secret=YOUR_CONSUMER_SECRET"

For production orgs, replace login.salesforce.com with your My Domain: yourcompany.my.salesforce.com. You should receive an access token in the response.

Common Gotchas

  • Token expiry: Salesforce access tokens typically expire in 2 hours. Client Credentials Flow doesn't return refresh tokens — request a new access token when needed.
  • Sandbox vs Production: Different orgs have different credentials. Use test.salesforce.com for sandbox token endpoints.
  • IP Restrictions: If your org has IP restrictions enabled, whitelist your server IPs, or the integration fails silently.
  • Run As User Permissions: Your API access is limited to what the "Run As" user can access. Don't use a sysadmin unless necessary.
  • Rate Limits: Salesforce enforces daily API limits based on your edition. Enterprise gets 1000 calls per user license per 24 hours. Monitor usage.
  • Consumer Secret Rotation: If compromised, regenerate immediately via Manage Consumer Details.

Managing Salesforce API Connectivity with Apideck's Vault

Integrating with Salesforce alongside other CRM systems? Managing OAuth connections across multiple platforms gets complex fast. Apideck's Vault handles this:

  • Automatic token refresh — Vault handles token lifecycle management, so you don't need to implement refresh logic for every integration.
  • Pre-built authentication UI — Embedded Vault components manage OAuth authorization flows without custom UI development. Your users authorize through Vault, not through your app.
  • Centralized connection monitoring — Track connection health, detect credential expiry, and manage all your CRM integrations from one dashboard.
  • Unified API access — Once connected, use Apideck's unified CRM API to access Salesforce data alongside 200+ other integrations through a single interface.

How to connect Salesforce through Apideck:

  1. Access your Apideck dashboard → Connections
  2. Select Salesforce from the CRM connector library
  3. Click Connect — Vault handles the OAuth flow
  4. Authorize access in the Salesforce pop-up
  5. Done. Your Salesforce connection is live, and token refresh is automatic.

Screenshot 2025-11-28 at 11.13.59@2x

Screenshot 2025-11-28 at 11.14.37@2x

For customers building multi-CRM integrations, this eliminates the need to manage OAuth flows, token storage, and refresh logic for each platform independently.

Next Steps

Now that you have API access:

Summary: Vault Benefits for Salesforce Integration

ChallengeWithout VaultWith Apideck Vault
OAuth flow implementationBuild custom authorization code handlingPre-built UI components
Token storageBuild secure credential storageEncrypted vault with automatic management
Token refreshImplement refresh logic per platformAutomatic token refresh
Connection monitoringCustom health checksCentralized dashboard
Multi-CRM supportBuild separate integrationsSingle unified API

Ready to get started?

Scale your integration strategy and deliver the integrations your customers need in record time.

Ready to get started?
Talk to an expert

Trusted by fast-moving product & engineering teams

JobNimbus
Blue Zinc
Drata
Octa
Nmbrs
Apideck Blog

Insights, guides, and updates from Apideck

Discover company news, API insights, and expert blog posts. Explore practical integration guides and tech articles to make the most of Apideck's platform.

How to Get Your Workday API Keys
Unified APIGuides & Tutorials

How to Get Your Workday API Keys

Getting Workday API credentials isn't straightforward. This guide cuts through the complexity and shows you exactly what you need to do.

Saurabh Rai

Saurabh Rai

4 min read
How to Get Your Sage Intacct API Keys
Unified APIGuides & TutorialsAccounting

How to Get Your Sage Intacct API Keys

Step-by-step guide to getting Sage Intacct API credentials for both Web Services (XML) and REST APIs, with setup instructions, authentication details, and common mistakes to avoid.

Saurabh Rai

Saurabh Rai

5 min read