Connect to AI
CRM & Sales OAuth 2.0

Salesforce REST API

CRM & Sales Cloud REST API Reference

The Salesforce REST API provides programmatic access to Salesforce CRM data and functionality. Query records, manage leads, create opportunities, and automate sales workflows. Supports both SOQL queries and standard CRUD operations on any Salesforce object.

Base URL https://yourInstance.salesforce.com/services/data/v60.0

API Endpoints

MethodEndpointDescription
GET/sobjectsList all available SObjects (Account, Contact, Lead, etc.)
GET/sobjects/AccountGet Account object metadata and field definitions
GET/sobjects/Account/{id}Retrieve a specific Account record by ID, returning all accessible fields for that record.
POST/sobjects/AccountCreate a new Account record with fields in the request body; returns the created record ID.
PATCH/sobjects/Account/{id}Update an existing Account record by ID; provide only the fields to modify in the request body.
DELETE/sobjects/Account/{id}Delete an Account record by ID; the record is moved to the Recycle Bin for recovery.
GET/query?q={soql}Execute a SOQL query (e.g., SELECT Id, Name FROM Account)
GET/sobjects/LeadGet Lead object metadata including field definitions, picklist values, and record types.
POST/sobjects/LeadCreate a new Lead record with required fields (LastName, Company); returns the created Lead ID.
GET/sobjects/OpportunityGet Opportunity object metadata including field definitions, stage picklist values, and relationships.
POST/sobjects/OpportunityCreate a new Opportunity record; requires Name, StageName, and CloseDate fields in the request body.
GET/search?q={sosl}Full-text search across all objects using SOSL

Code Examples

# Authenticate and get access token
curl -X POST https://login.salesforce.com/services/oauth2/token \
  -d "grant_type=password" \
  -d "client_id=YOUR_CLIENT_ID" \
  -d "client_secret=YOUR_CLIENT_SECRET" \
  -d "username=YOUR_USERNAME" \
  -d "password=YOUR_PASSWORD"

# Query accounts
curl https://yourInstance.salesforce.com/services/data/v60.0/query \
  -G --data-urlencode "q=SELECT Id, Name, Industry FROM Account LIMIT 10" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

# Create a new lead
curl -X POST https://yourInstance.salesforce.com/services/data/v60.0/sobjects/Lead \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"FirstName":"John","LastName":"Doe","Company":"Acme Corp"}'

Use Salesforce from Claude / Cursor / ChatGPT

Get a hosted MCP endpoint for Salesforce. Paste your Salesforce API key, copy back one URL, drop it into Claude Desktop, Cursor, or any AI client that supports remote MCP. Your AI calls Salesforce directly with your credentials — no local install, works on mobile.

query_salesforce Execute a SOQL query and return results
create_lead Create a new lead with name, company, and email
update_opportunity Update opportunity stage, amount, or close date
search_contacts Full-text search across all contacts
get_account Retrieve account details by ID or name

Connect in 60 seconds

Paste your Salesforce key → get an MCP URL → paste into Claude/Cursor. Hosted by IOX, encrypted at rest.

Connect Salesforce to your AI →

Related APIs