Skip to main content

DocsREST API and MCP server

Salesforce Records API

Endpoints, auth and live samples for Audience Builder, Connect Data and CRM sync.

Base URLhttps://us-farmvision-new-api.onrender.com

Salesforce Records

Query Salesforce Records

Lists one page of records of one object, newest first, with totalSize as the count of all matches. With an API key or MCP token only object=Contact is allowed (403 otherwise, including when object is left at its Account default); a signed-in web session can read every supported object.

GEThttps://us-farmvision-new-api.onrender.com/api/v1/salesforce/records?object=Contact&search=acme&limit=25&offset=0Try it

In this section

Authentication

Get API key

Bearer token

Send your GTM Scoop API key (llmcp_…) or a signed-in session token as a Bearer token.

Authorization: Bearer YOUR_API_KEY

Query parameters

FieldTypeDescription
objectquerystringAccount, Contact, Lead, Opportunity, Case or ContentVersion. Default Account; anything else returns 400.
searchquerystringContains-match on Name (Subject for Case, Title for ContentVersion). Trimmed and cut to 100 characters.
limitqueryintegerRecords per page, 1 to 200. Default 50.
offsetqueryintegerRecords to skip, 0 to 1,900. Default 0.

Mounted at

/api/v1/salesforce

Reads and writes records in the connected Salesforce org: Account, Contact, Lead, Opportunity, Case and ContentVersion (Files). Every call returns 401 with disconnected: true when there is no connection or its token can no longer be refreshed; other Salesforce errors come back as 502.

Try it in the playground

Signed out: 10 free tries a day with names hidden. Log in for live data.

Open playground

Related endpoints

All 9 endpoints in this section

Bearer token plus an active Salesforce connection; edits, deletes, exports, uploads and lead write-back need a signed-in web session.

MethodPathWhat it does
GET/api/v1/salesforce/records

Query Salesforce Records

Lists one page of records of one object, newest first, with totalSize as the count of all matches. With an API key or MCP token only object=Contact is allowed (403 otherwise, including when object is left at its Account default); a signed-in web session can read every supported object.

4 parameters
  • object (string) Account, Contact, Lead, Opportunity, Case or ContentVersion. Default Account; anything else returns 400.
  • search (string) Contains-match on Name (Subject for Case, Title for ContentVersion). Trimmed and cut to 100 characters.
  • limit (integer) Records per page, 1 to 200. Default 50.
  • offset (integer) Records to skip, 0 to 1,900. Default 0.
Try Query Salesforce Records in the Playground
GET/api/v1/salesforce/record

Get Salesforce Record

Reads one record with Id plus the fields it can be edited with, to pre-fill an edit form. ContentVersion has no editable fields (400), the same Contact-only rule applies to API keys and MCP tokens as on Query Salesforce Records, and 404 means the record does not exist.

2 parameters
  • object (string, required) Account, Contact, Lead, Opportunity or Case.
  • id (string, required) The record Id, 15 to 18 letters and digits.
Try Get Salesforce Record in the Playground
PATCH/api/v1/salesforce/update

Update Salesforce Record

Updates fields on one record. Only the object's editable fields are applied; other names, empty strings and nulls are dropped, so this cannot clear a field. 400 when no field is left to update or the Id is not a valid Salesforce Id.

3 parameters
  • object (string, required) Account, Contact, Lead, Opportunity or Case.
  • id (string, required) The record Id, 15 to 18 letters and digits.
  • fields (object, required) Field name to new value. Editable fields: Account: Name, Industry, Phone, Website, BillingCity, BillingState. Contact: LastName, FirstName, Email, Phone, MailingStreet, MailingCity, MailingState, MailingPostalCode, Description, Title, Department. Lead: LastName, FirstName, Company, Email, Phone, Street, City, State, PostalCode, Website, Description, Status, LeadSource. Opportunity: Name, StageName, CloseDate, Amount. Case: Subject, Status, Priority, Origin.
POST/api/v1/salesforce/records/delete-all

Delete All Salesforce Records

Permanently deletes every record of one object that matches search, through a Salesforce bulk delete job; with no search it deletes every record of that object in the org. object is required here (there is no default), and the request waits for the job, up to 15 minutes, before reporting the counts.

2 parameters
  • object (string, required) Account, Contact, Lead, Opportunity, Case or ContentVersion.
  • search (string) Delete only records whose Name (Subject for Case, Title for ContentVersion) contains this text. Max 100 characters.
GET/api/v1/salesforce/records/export

Export Salesforce Records (CSV)

Downloads every matching record of one object (all pages) as a CSV file with the same columns as Query Salesforce Records; pass ids to export only chosen records. Cells starting with =, +, - or @ get a leading apostrophe, and Id, phone and ZIP cells are quoted with a leading tab so spreadsheets keep them as text. The file starts with a UTF-8 byte-order mark.

3 parameters
  • object (string) Account, Contact, Lead, Opportunity, Case or ContentVersion. Default Account.
  • search (string) Contains-match on Name (Subject for Case, Title for ContentVersion). Trimmed and cut to 100 characters.
  • ids (string) Comma-separated record Ids to export. Invalid Ids are dropped; at most 500 are used.
POST/api/v1/salesforce/upload

Create Salesforce Records

Creates one record per row, for up to 200 rows (extra rows are ignored). Each row is reported on its own, so the call returns 200 even when rows fail; disconnected: true means the connection dropped part-way and the remaining rows were not tried. Contact and Lead rows also accept common column names (first_name, last_name, email, phone, city, state, zip), and a Contact row's company and website are added to its Description.

2 parameters
  • object (string, required) Account, Contact, Lead, Opportunity or Case.
  • rows (array, required) Objects of field name to value; the first 200 are used, and unknown fields and empty values are dropped. Required: Account Name; Contact LastName; Lead LastName and Company; Opportunity Name, StageName and CloseDate; Case Subject. Field names as in Update Salesforce Record.
POST/api/v1/salesforce/upload/file

Upload File to Salesforce

Uploads one file, up to 10 MB, as a Salesforce File (ContentVersion). Send multipart/form-data with the file in a field named file, plus targetRecordId to attach it to a record. 400 if no file is sent.

2 parameters
  • file (file, required) The file, as a multipart/form-data part. Max 10 MB.
  • targetRecordId (string) Id of the record to attach the file to, such as an Account or Contact. Omit to upload it unattached.
POST/api/v1/salesforce/enrich-sync

Sync Salesforce Contacts for Enrichment

Copies Salesforce Contacts into a new Connect Data upload, ready to map and enrich, named "Salesforce Contacts" (then "Salesforce Contacts (2)" and so on). Mode all takes the 5,000 newest contacts, optionally filtered by search; mode selected takes the given Ids. The upload has the columns First Name, Last Name, Company Name, Email, Phone, Title, Address, City, State and ZIP (a blank mailing address is filled from the contact's other address or its account); 400 when no contacts are found, and GTM Scoop accounts can run 20 CRM syncs per hour.

4 parameters
  • mode (string) "all" (default; any other value counts as all) or "selected".
  • ids (array) Required for selected mode: Contact Ids (15 to 18 letters and digits; invalid Ids are dropped), at most 5,000. Selected mode with no valid Id fails.
  • search (string) All mode only: only Contacts whose Name contains this text. Max 100 characters.
  • businessContext (object) Context stored with the upload for later AI analysis: { companyName, website, businessContext, updatedAt }, all strings. At most 4,000 characters in total; a larger value is refused.
POST/api/v1/salesforce/writeback-leads

Write Matched Rows to Salesforce as Leads

Creates a Salesforce Lead for each matched row of an analysis run, up to 10,000 rows; above 1,000 rows a Salesforce bulk job is used and the call waits up to 2 minutes for it (processing: true and a jobId mean it was still running). Rows come from savedListId, else runId, else uploadId; when the run has no matched rows it falls back to its other results and then to the upload's own rows. Each Lead gets the org's default Lead Status (else its first active, non-converted one) and Lead Source "Other" when that value is active; 400 if there is nothing to write.

4 parameters
  • runId (string) The analysis run whose rows to write. Send runId, uploadId or savedListId.
  • mode (string) "ai" (default; any other value counts as ai) or "data": which of the run's results to try first. Used with runId.
  • uploadId (string) An upload: its run is written when runId is not sent, and its own rows are the last fallback.
  • savedListId (string) A saved results list to write instead of a run (404 if it is not this account's).

Cookies on GTM Scoop

Essential cookies keep you signed in and the site secure, and are always on. Optional cookies (Google Analytics) help us understand how the site is used. They are on by default, except in the EU/EEA, the UK and Switzerland, where they stay off until you choose Accept All Cookies; choose Essential Cookies Only to turn them off. We do not use advertising cookies and we do not sell or share your personal information. The site works the same whichever you choose. We keep a record of your choice with the date, your IP address and the page you were on. Cookie Policy · Privacy Policy