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

# Salesforce

> Connect Salesforce to your Atako agents — 14 read and 4 write actions.

Let your agents read and write your Salesforce records — run SOQL and SOSL queries, inspect object metadata, and create, update, upsert or delete accounts, contacts, leads, opportunities, cases and tasks.

## Connection

* **Authentication**: OAuth 2.0 — you authorize Atako via Salesforce's consent screen; no key to copy.
* **Scopes requested**:
  * `api`
  * `refresh_token`

<Note>
  Nothing to paste: click Connect and approve Atako in your Salesforce org. Prerequisite on the Atako side — an administrator declares a Salesforce Connected App (Setup → App Manager → New Connected App → Enable OAuth Settings) with the callback URL \$\{API\_URL}/integrations/oauth/callback, the OAuth scopes "Manage user data via APIs (api)" and "Perform requests at any time (refresh\_token, offline\_access)", and puts its consumer key and secret in INTEGRATION\_OAUTH\_SALESFORCE\_CLIENT\_ID / \_CLIENT\_SECRET. Your org's instance URL is captured automatically when you connect.

  See [Salesforce's documentation](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/).
</Note>

## Read actions (14)

| Action                      | Description                                                                                                                                                                                                                                                                                                                                 |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `describe_sobject`          | Full metadata for one sObject: every field with its API name, type, whether it is required, picklist values, and relationships. Use it before writing to know the exact field names.                                                                                                                                                        |
| `get_limits`                | Read the org limits and how much of each is consumed (daily API requests, storage, bulk jobs…).                                                                                                                                                                                                                                             |
| `get_record`                | Fetch one record by its Salesforce id. Without `fields`, every accessible field is returned.                                                                                                                                                                                                                                                |
| `get_record_by_external_id` | Fetch one record by the value of an external-id field, when you hold the id from your own system rather than the Salesforce one.                                                                                                                                                                                                            |
| `get_sobject_info`          | Basic metadata for one sObject plus the recently-used records of that type — lighter than a full describe.                                                                                                                                                                                                                                  |
| `list_api_versions`         | List the REST API versions this org serves (label, version, url). This connector calls v62.0; use it to check what the org supports.                                                                                                                                                                                                        |
| `list_deleted`              | List the ids of records of one type deleted between two instants (max 30 days apart), with their deletion date.                                                                                                                                                                                                                             |
| `list_recent`               | List the records the connected user viewed most recently (id, name, type).                                                                                                                                                                                                                                                                  |
| `list_sobjects`             | List every sObject available in the org with its API name, label and capabilities (createable, queryable, custom…). Start here to discover object names.                                                                                                                                                                                    |
| `list_updated`              | List the ids of records of one type created or updated between two instants (max 30 days apart) — for incremental syncs.                                                                                                                                                                                                                    |
| `query`                     | Run a SOQL query. Examples: "SELECT Id, Name, Industry FROM Account WHERE Industry = 'Energy' ORDER BY Name LIMIT 50" — "SELECT Id, Name, Amount, StageName, CloseDate FROM Opportunity WHERE CloseDate = THIS\_QUARTER AND IsClosed = false". Returns records plus, when the result is truncated, a nextRecordsUrl to pass to query\_more. |
| `query_all`                 | Run a SOQL query that ALSO returns deleted and archived records (IsDeleted = true rows in the Recycle Bin, archived Tasks and Events). Same syntax and same pagination as query.                                                                                                                                                            |
| `query_more`                | Fetch the next page of a query / query\_all result. Pass the nextRecordsUrl exactly as the previous response returned it — any other value is refused.                                                                                                                                                                                      |
| `search`                    | Run a SOSL full-text search across several objects at once. Examples: "FIND \{Acme} IN ALL FIELDS RETURNING Account(Id, Name), Contact(Id, Name, Email)" — "FIND \{[jane@example.com](mailto:jane@example.com)} IN EMAIL FIELDS RETURNING Contact(Id, Name), Lead(Id, Name)".                                                               |

## Write actions (4)

| Action          | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `create_record` | Create one record. Arguments — sobject: the object API name as a string ("Account", "Contact", "Lead", "Opportunity", "Case", "Task", "Event"…); fields: a flat JSON object of field API name → value, sent as the request body (\{"Name": "Acme SA", "Industry": "Energy"} for an Account; \{"LastName": "Dupont", "Company": "Acme SA"} for a Lead). Dates are "YYYY-MM-DD", date-times ISO 8601, lookups the 18-character id of the related record, checkboxes true/false, numbers bare numbers — never strings. Run describe\_sobject first to get the required fields. Returns \{id, success, errors}. |
| `delete_record` | Delete one record — it goes to the org Recycle Bin. Arguments — sobject: the object API name as a string; id: the 15- or 18-character Salesforce record id as a string. Irreversible from this connector: nothing here restores a deleted record. Salesforce answers 204 with an empty body on success.                                                                                                                                                                                                                                                                                                     |
| `update_record` | Update one existing record. Arguments — sobject: the object API name as a string; id: the 15- or 18-character Salesforce record id as a string; fields: a flat JSON object of field API name → value, sent as the request body, containing ONLY the fields to change (send null to clear one). Same value formats as create\_record. Salesforce answers 204 with an empty body on success.                                                                                                                                                                                                                  |
| `upsert_record` | Create or update one record, keyed on an external-id field. Arguments — sobject: the object API name as a string; external\_id\_field: the API name of an External Id field as a string (it must already exist on the object, e.g. "ERP\_Ref\_\_c"); external\_id: the value of that field as a string; fields: a flat JSON object of field API name → value, sent as the request body, WITHOUT the external-id field itself. Salesforce answers 201 when it created the record and 204 when it updated one.                                                                                                |

## Permissions

Every action above must be explicitly granted to an agent before it can be used. See [Permissions](/integrations/permissions) for the grant model and [Security](/integrations/security) for how credentials are protected.
