# Salesforce — CRM API: gotchas

> Canonical URL: https://developers.apideck.com/apis/crm/salesforce/gotchas

## GET /crm/companies

Salesforce imposes a maximum offset limit of 2000. Exceeding this offset will result in an error from Salesforce. For result sets larger than 2000 items, it is necessary to set the pagination limit to 200, as this will enforce the use of batchSize for pagination. Note that setting a limit lower than 200 will not reduce the batchSize due to Salesforce's minimum batch size policy of 200, as detailed in their documentation [here](https://developer.salesforce.com/docs/atlas.en-us.250.0.api_rest.meta/api_rest/headers_queryoptions.htm) and will have no effect.
## GET /crm/contacts

Salesforce imposes a maximum offset limit of 2000. Exceeding this offset will result in an error from Salesforce. For result sets larger than 2000 items, it is necessary to set the pagination limit to 200, as this will enforce the use of batchSize for pagination. Note that setting a limit lower than 200 will not reduce the batchSize due to Salesforce's minimum batch size policy of 200, as detailed in their documentation [here](https://developer.salesforce.com/docs/atlas.en-us.250.0.api_rest.meta/api_rest/headers_queryoptions.htm) and will have no effect.
## GET /crm/opportunities

Salesforce imposes a maximum offset limit of 2000. Exceeding this offset will result in an error from Salesforce. For result sets larger than 2000 items, it is necessary to set the pagination limit to 200, as this will enforce the use of batchSize for pagination. Note that setting a limit lower than 200 will not reduce the batchSize due to Salesforce's minimum batch size policy of 200, as detailed in their documentation [here](https://developer.salesforce.com/docs/atlas.en-us.250.0.api_rest/api_rest/headers_queryoptions.htm) and will have no effect.
## POST /crm/opportunities

The `close_date` and `pipeline_stage_id` are required by Salesforce. If `close_date` is not provided, it defaults to `2021-12-31`.
## GET /crm/leads

Salesforce imposes a maximum offset limit of 2000. Exceeding this offset will result in an error from Salesforce. For result sets larger than 2000 items, it is necessary to set the pagination limit to 200, as this will enforce the use of batchSize for pagination. Note that setting a limit lower than 200 will not reduce the batchSize due to Salesforce's minimum batch size policy of 200, as detailed in their documentation [here](https://developer.salesforce.com/docs/atlas.en-us.250.0.api_rest.meta/api_rest/headers_queryoptions.htm) and will have no effect.
## GET /crm/pipelines

Salesforce imposes a maximum offset limit of 2000. Exceeding this offset will result in an error from Salesforce. For result sets larger than 2000 items, it is necessary to set the pagination limit to 200, as this will enforce the use of batchSize for pagination. Note that setting a limit lower than 200 will not reduce the batchSize due to Salesforce's minimum batch size policy of 200, as detailed in their documentation [here](https://developer.salesforce.com/docs/atlas.en-us.250.0.api_rest.meta/api_rest/headers_queryoptions.htm) and will have no effect.
## GET /crm/lists

Salesforce list views are always dynamic saved filters, so `type` is always `dynamic`. The list operation returns list views for Contact, Account, Opportunity, and Lead objects only; list views for other objects (Case, Campaign, Task, Event, custom objects, etc.) are excluded from the list but remain retrievable by id, with `object_type` normalized for a few well-known SobjectTypes retrieved this way (Case -> `tickets`, Campaign -> `campaigns`, Task -> `tasks`, Event -> `events`) and the raw SobjectType passed through unchanged for anything else (e.g. custom objects). Private "visible only to me" list views are not accessible via the Salesforce API and are not returned. `description`, `record_count`, `visibility`, `folder_id`, `owner_id`, the favorite/default/system flags, `custom_fields`, `filter_criteria`, and `tags` are not available on Salesforce list views.

## GET /crm/lists/{id}

Salesforce list views are always dynamic saved filters, so `type` is always `dynamic`. Private "visible only to me" list views are not accessible via the Salesforce API. The list operation covers Contact, Account, Opportunity, and Lead list views only; other object types are retrievable by id, with `object_type` normalized for a few well-known SobjectTypes (Case -> `tickets`, Campaign -> `campaigns`, Task -> `tasks`, Event -> `events`) and the raw SobjectType passed through unchanged for anything else (e.g. custom objects). `description`, `record_count`, `visibility`, `folder_id`, `owner_id`, the favorite/default/system flags, `custom_fields`, `filter_criteria`, and `tags` are not available on Salesforce list views.

## GET /crm/notes

Salesforce imposes a maximum offset limit of 2000. Exceeding this offset will result in an error from Salesforce. For result sets larger than 2000 items, it is necessary to set the pagination limit to 200, as this will enforce the use of batchSize for pagination. Note that setting a limit lower than 200 will not reduce the batchSize due to Salesforce's minimum batch size policy of 200, as detailed in their documentation [here](https://developer.salesforce.com/docs/atlas.en-us.250.0.api_rest.meta/api_rest/headers_queryoptions.htm) and will have no effect.
## POST /crm/notes

When creating a note in Salesforce, you can only associate it with one resource (such as a lead, company or opportunity) at a time. You cannot combine multiple resources or associate the note with more than one resource in a single API call.
## GET /crm/users

Salesforce imposes a maximum offset limit of 2000. Exceeding this offset will result in an error from Salesforce. For result sets larger than 2000 items, it is necessary to set the pagination limit to 200, as this will enforce the use of batchSize for pagination. Note that setting a limit lower than 200 will not reduce the batchSize due to Salesforce's minimum batch size policy of 200, as detailed in their documentation [here](https://developer.salesforce.com/docs/atlas.en-us.250.0.api_rest.meta/api_rest/headers_queryoptions.htm) and will have no effect.
## GET /crm/activities

Salesforce imposes a maximum offset limit of 2000. Exceeding this offset will result in an error from Salesforce. For result sets larger than 2000 items, it is necessary to set the pagination limit to 200, as this will enforce the use of batchSize for pagination. Note that setting a limit lower than 200 will not reduce the batchSize due to Salesforce's minimum batch size policy of 200, as detailed in their documentation [here](https://developer.salesforce.com/docs/atlas.en-us.250.0.api_rest.meta/api_rest/headers_queryoptions.htm) and will have no effect. In Salesforce, to get list of tasks, calls or emails, please use filter "type": "task" to ensure proper handling.
## POST /crm/activities

Salesforce activities map to the Event object by default. Creating an Event requires a start date/time, so you must send `activity_datetime` (mapped to Salesforce `ActivityDateTime`). Omitting it returns `Required fields are missing: [ActivityDateTime]`. For all-day events, send `activity_date` (mapped to `ActivityDate`) and set `all_day_event: true` instead.
When creating tasks, calls, or emails, please specify `"type": "task"` with the correct `event_sub_type` value in the request body to ensure proper handling. These map to the Salesforce Task object and do not require `activity_datetime`.
Associate the activity with a record using `contact_id` or `lead_id` (mapped to `WhoId`), and `account_id`/`opportunity_id`/etc. (mapped to `WhatId`).
## PATCH /crm/activities/{id}

In Salesforce, when updating tasks, calls, or emails, please specify "type": "task" in the request body to ensure proper handling.
## DELETE /crm/activities/{id}

This endpoint is mapped to Salesforce Events; tasks are not included. As a workaround we recommended using the Proxy API.
## GET /crm/custom-object-schemas

Salesforce imposes a maximum offset limit of 2000. Exceeding this offset will result in an error from Salesforce. For result sets larger than 2000 items, it is necessary to set the pagination limit to 200, as this will enforce the use of batchSize for pagination. Note that setting a limit lower than 200 will not reduce the batchSize due to Salesforce's minimum batch size policy of 200, as detailed in their documentation [here](https://developer.salesforce.com/docs/atlas.en-us.250.0.api_rest.meta/api_rest/headers_queryoptions.htm) and will have no effect.
## GET /crm/custom-objects/{object_id}

Salesforce imposes a maximum offset limit of 2000. Exceeding this offset will result in an error from Salesforce. For result sets larger than 2000 items, it is necessary to set the pagination limit to 200, as this will enforce the use of batchSize for pagination. Note that setting a limit lower than 200 will not reduce the batchSize due to Salesforce's minimum batch size policy of 200, as detailed in their documentation [here](https://developer.salesforce.com/docs/atlas.en-us.250.0.api_rest.meta/api_rest/headers_queryoptions.htm) and will have no effect.

[API reference](https://developers.apideck.com/apis/crm/reference.md) · [Coverage matrix](https://developers.apideck.com/apis/crm/coverage)
