> ## Documentation Index
> Fetch the complete documentation index at: https://deepline.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Use Salesforce in Deepline

> Use field inspection before custom writes, object-specific create/update/delete tools for standard CRM records, and list tools for incremental reads.

[Human guide: work with your agent →](https://deepline.com/docs/human/providers/salesforce/guide.md)
Inspect one Salesforce action before starting provider-backed work. Your first result is a verified input and output contract.

## Provider-specific requirements

Use `salesforce_fetch_fields` before writing custom objects or unknown standard objects so you can confirm exact field API names and validation rules.

Use `salesforce_list_contacts`, `salesforce_list_leads`, and `salesforce_list_accounts` for incremental CRM reads. They accept `modified_after` for recent changes and `next_records_url` for pagination handoff.

Use the object-specific create, update, and delete tools for Accounts, Contacts, Leads, and Opportunities instead of building raw Salesforce payloads yourself. The integration already maps Deepline-friendly field names to Salesforce API names.

For custom field write-back on Accounts, Contacts, Leads, and Opportunities, pass `fields` with official Salesforce API names, for example `{ "id": "001...", "fields": { "Deepline_Score__c": 87, "Deepline_Email_Gate__c": true } }`. Values may be strings, numbers, booleans, or `null` to clear a field. If a friendly field and `fields` both target the same Salesforce API name, the explicit `fields` value wins.

After a write, use `salesforce_get_record` with the object API name, record ID, and exact scalar field API names to verify custom field values, for example `{ "object": "Account", "id": "001...", "fields": ["Name", "Deepline_Score__c"] }`.

Campaign membership records participation in an event, webinar, or program. Find the campaign with `salesforce_list_campaigns`. Filter with `name_contains` and `is_active`. Then call `salesforce_add_campaign_member` with `campaign_id`, exactly one of `lead_id` or `contact_id`, and a member `status`. For example, use `Attended` only if that label is valid for the campaign. Do not use a Lead or Contact custom field for campaign membership. An invalid status returns the valid labels. Retry with one of those labels. Adding an existing member updates its status and returns `created: false`. Use `salesforce_list_campaign_members` to inspect existing membership and status.

Before creating a lead or contact, call `salesforce_search` with the email (and name or phone if you have them) to find existing Leads, Contacts, and Accounts. Update a match instead of creating a duplicate. Search results can lag a few seconds behind record creation.

To log a call, email, or other activity, use `salesforce_create_task` with `who_id` set to the Lead or Contact. Add `what_id` for the Account, Opportunity, or Campaign only when `who_id` is a Contact. Salesforce rejects `what_id` on Lead tasks.

For reads that no list tool covers (Tasks, Events, Users, OpportunityContactRoles, custom objects, filtered or joined queries), use `salesforce_query` with a SOQL `SELECT`. It returns one page per call. pass `next_records_url` with the same `soql` for the next page, and `include_deleted: true` to include deleted records. Escape single quotes in string literals as `\'`.

Use the typed tools first. For other supported REST requests, use `salesforce_api_request`. It sends one authenticated `GET`, `POST`, `PUT`, `PATCH`, or `DELETE` to a relative path. Examples include `/services/data/v60.0/sobjects/Event` and `/services/data/v60.0/sobjects/OpportunityContactRole`. For batch writes of up to 200 records, use `/services/data/v60.0/composite/sobjects`. For reports, use `/services/data/v60.0/analytics/reports/<reportId>`. Lead conversion is not available as a REST resource. Do not simulate it with field updates.

## Find an applicable action

Confirm your effective workspace, then search the live catalog:

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline auth status --json
deepline search "Salesforce" --type tools --json
```

Search returns candidates. Check the returned provider and operation rather than selecting a similar title automatically.

## Inspect the selected contract

Replace `<returned-tool-id>` with the identifier returned by discovery:

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline describe <returned-tool-id> --json
```

These commands do not execute the selected provider action. Read its required inputs, supported access mode, pricing unit, outputs, and limits.

A connection does not establish that every action supports BYOK. Follow the provider-specific requirements above and the live action contract.

## Prepare one reviewed input

Use one authorized record that matches the inspected schema. Preserve its source identity and define the result you will accept.

Open the action reference for its payload and response shape. Provider-backed execution can incur usage or external effects.

For reusable logic, follow [Write Plays](https://deepline.com/docs/sdk-v2/plays.md). For direct-call recovery, use [Tool execution recovery](https://deepline.com/docs/sdk-v2/tool-execution-recovery.md).

> [!TIP]
>
> Continue only when the workspace, provider, required fields, acceptance rule, and applicable price are understood. Keep unavailable access separate from no-result evidence.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.