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

# Save Records

> Create, update, or upsert 1–25 Salesforce records of one object, with a preview and confirm step. No delete.

`salesforce_save_records`

Create, update, or upsert **1–25** records of a single object. Field names accept labels or API names. Values are checked against the object schema and picklists. Updates include a before→after diff.

<Warning>
  **Preview first** with `dry_run: true`, show the user the diff, then call again with `confirm: true`. Confirm is required for `update`, `upsert`, and multi-record `create`. Single-record create does not require confirm. There is **no delete**.
</Warning>

Salesforce automation (triggers, flows, assignment rules) may change other fields after the save. Re-read the record with [`salesforce_get_record_overview`](/connectors/Salesforce/get-record-overview) for the final values.

## Parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `action` | `"create"` \| `"update"` \| `"upsert"` | Yes | The write operation. |
| `object` | string | No | Object label or API name. Optional for `update` (inferred from ids). |
| `records` | array (1–25) | Yes | Each item: `fields` (required), plus `record_id` (update), `external_id` (upsert), optional `expected_last_modified`. |
| `records[].fields` | object | Yes | Values keyed by label or API name. Dates `YYYY-MM-DD`, datetimes ISO-8601, multi-select picklists an array, `null` clears a field. |
| `records[].record_id` | string | No | 15/18-character id to update. |
| `records[].external_id` | string | No | External-id value for upsert. |
| `records[].expected_last_modified` | string | No | `LastModifiedDate` you last read (ISO-8601). The update is rejected if the record changed since. |
| `external_id_field` | string | No | For upsert: the external-id (or Id) field to match on. |
| `record_type` | string | No | Record type name, developer name, or id (create). |
| `all_or_none` | boolean | No | Roll back the whole batch if any record fails. Default: `true`. |
| `allow_duplicates` | boolean | No | Save even if duplicate rules match. |
| `dry_run` | boolean | No | Validate and preview only; nothing is written. |
| `confirm` | `true` | Conditional | Required for update, upsert, and multi-record create. |
| `response_format` | `"markdown"` \| `"json"` | No | Default: `"markdown"`. |

## Returns

`status` is one of: `preview`, `created`, `updated`, `no_changes`, `partial`, `failed`.

On `partial`, inspect each row's success / errors. Structured data includes new ids and `web_url` links.

## Example use

> "Preview changing Edge Communications' industry to Manufacturing, then apply it if I approve."

> "Create a Contact Jane Doe under account Edge Communications."
