SCALIX help

← All tools

salesforce_get_record

Salesforce read low risk

Part of the Salesforce Agent.

What it does

Fetches a single Salesforce record by object type and 15/18-char record Id, optionally limited to a named subset of fields. Use to read the current state of a Lead/Contact/Account/Opportunity/Campaign/CampaignMember before updating it, to confirm a write succeeded, or to resolve a Status/StageName/owner before attribution. Key inputs: sobject (API name, e.g. 'Lead'), record_id, optional fields[] (omit to return all readable fields). Returns the full record JSON as data (with attributes.type/url + each field), wrapped as {success:true,data:{record},count:1}. Honors field-level security and sharing — fields the user cannot read are omitted; a record outside the user's sharing scope returns not-found/permission errors rather than partial data.

Inputs

NameTypeRequiredDescription
sobjectstringyesObject API name, e.g. Lead, Contact, Account, Opportunity, Campaign, CampaignMember, or a custom object ending in __c.
record_idstringyesThe 15- or 18-char Salesforce record Id. The 18-char (case-safe) form is preferred; reject obviously malformed Ids client-side.
fieldsarraynoOptional list of field API names to return (passed as ?fields=). Omit to return all fields the user can read. Requesting a no-access field yields a 403.

Safeguards

Policy

Read-only retrieval scoped strictly to the authorizing client's org — never fetch or correlate records across clients. Any LinkedIn member/lead data returned may be used ONLY for this client and ONLY for consented purposes; never enrich/append/verify profiles, never build a prospecting or cross-account/unaffiliated database, never commingle across clients. Do not log returned PII; do not retain member-derived data beyond this request (profile <=24h, social activity <=48h); honor deletion on request.

Reminder

Single-record read within this client's org only; never reuse the returned PII for enrichment, prospecting, or cross-account pooling.

Errors

Error classMeansWhat to doRetry
TOKEN_REVOKEDSession expired/invalid (HTTP 401 INVALID_SESSION_ID).needs_reauth — refresh once and retry; if it fails, prompt reconnect.yes
NOT_FOUNDNo record with that Id, or it is outside the user's sharing scope (HTTP 404 NOT_FOUND).Verify the Id (and that it belongs to this org/object); confirm sharing access. Do not retry unchanged.no
PERMISSION_DENIEDUser lacks read on the object or a requested field (HTTP 403 INSUFFICIENT_ACCESS / 400 INVALID_FIELD).Surface the named object/field; request access or drop the field. Not retryable as-is.no
VALIDATION_ERRORMalformed Id or unknown object type (HTTP 400/404 NOT_FOUND, MALFORMED_ID).Surface the exact message; fix the sobject/record_id. Not retryable.no
RATE_LIMITEDDaily/concurrent API limit exceeded (HTTP 403 REQUEST_LIMIT_EXCEEDED or 503 Retry-After).Backoff, honor Retry-After, report remaining quota from Sforce-Limit-Info.yes
PLATFORM_UNAVAILABLESalesforce 5xx (HTTP 500/502/503).Retry with exponential backoff (1/2/4s, cap 30s); reads are safe to retry.yes

Edge cases

  • 18-char Id is the case-safe canonical form; a 15-char Id is accepted but case-sensitive — prefer 18.
  • fields= subset that includes a no-access field fails the whole request (403) rather than omitting it silently.
  • A record merged/deleted after you cached its Id returns 404 (or ENTITY_IS_DELETED); treat as not-found.
  • CampaignMember rows are polymorphic — only one of LeadId/ContactId is set.
  • Empty/sparse record: fields the user cannot read are simply absent from the JSON — do not treat a missing optional field as an error.
  • Retention/consent: returned member PII is consent-scoped to this client; do not cache profile data beyond 24h or social activity beyond 48h.