251
All tools

Create a record

Creates a record of any object, such as a Lead, Contact or Opportunity, and returns its new ID.

Updated Sep 29, 2026

create-record.md

Create a record

Creates a record of any object, such as a Lead, Contact or Opportunity, and returns its new ID.

Set up

Use the first option your agent supports.

MCP (official, remote)

Add this server to your agent's MCP settings, then sign in when asked.

{ "mcpServers": { "salesforce": { "url": "https://api.salesforce.com/platform/mcp/v1/platform/sobject-mutations" } } }

Call the MCP tool createSobjectRecord.

Server URL: https://api.salesforce.com/platform/mcp/v1/platform/sobject-mutations

Note: An admin creates an External Client App and activates the server first. It never deletes records.

CLI (official)

Install the command and sign in with it, then confirm it runs.

npm install @salesforce/cli --global
sf --version

Run sf data create record.

Note: Sign in with sf org login web; sf org display then prints the instance URL and API version.

API (official)

Note: {my_domain} is your org's My Domain name, and paths carry the API version as vXX.X; sf org display prints both as Instance Url and Api Version.

Before anything else, confirm access with the cheapest read-only call, like a list or a search. Never send or change anything to test access.

Rules

  • Ask the user before anything that sends messages, costs money, or changes data, and say how many records it touches. One approval covers a batch the user has seen.
  • Never print API keys.

Ways in

RouteSourceCallRequiredDocs
MCPOfficial · remotecreateSobjectRecordOAuthDocs
CLIOfficialsf data create recordOAuthDocs
APIOfficialPOST /services/data/vXX.X/sobjects/{sobject}/OAuthDocs

Workflows using Create a record