> ## 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.

# Salesloft: Opportunities Index

> List opportunities. Salesloft Opportunities Index reference includes SDK V2 and CLI requests, input constraints, response fields, and Deepline cost.

List opportunities.

<Info>
  Tool ID: `salesloft_opportunities_index`
</Info>

## Run this action

Use the TypeScript SDK for a single call. Put `ctx.tools.execute(...)` inside a Play when the call should be durable, scheduled, or run across a CSV.

```ts theme={null}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'salesloft_opportunities_index',
  {
    "ids": [
      123
    ],
    "created_at": {
      "gt": "example",
      "gte": "example",
      "lt": "example"
    },
    "updated_at": {
      "gt": "example",
      "gte": "example",
      "lt": "example"
    }
  },
);

console.log(result.toolResponse.raw);
```

### CLI

```bash theme={null}
deepline tools execute salesloft_opportunities_index --input '{
  "ids": [
    123
  ],
  "created_at": {
    "gt": "example",
    "gte": "example",
    "lt": "example"
  },
  "updated_at": {
    "gt": "example",
    "gte": "example",
    "lt": "example"
  }
}' --json
```

## Example response

The SDK exposes this shape at `result.toolResponse.raw`. Values below are representative.

```json theme={null}
{
  "data": [
    {
      "id": 123,
      "name": "Example",
      "amount": "example"
    }
  ]
}
```

Use `deepline tools get salesloft_opportunities_index --json` for the latest machine-readable contract.

## Input reference

Lists multiple Opportunity records. Returns Opportunity records synced from the CRM and created via API. The records can be filtered, paged, and sorted using the parameters below and external ID parameters. To Create, Update and Delete opportunities, refer to this External Mapping guide [here](https://developer.salesloft.com/docs/platform/guides/import-opportunities/).

| Name                             | Type      | Required | Default | Details                                                                                                                                |
| -------------------------------- | --------- | -------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| `payload.ids`                    | `array`   | No       | —       | IDs of opportunities to fetch. If a record can't be found, that record won't be returned and your request will be successful           |
| `payload.created_at`             | `object`  | No       | —       | Returns all matching records that are greater than the provided iso8601 timestamp. The comparison is done using microsecond precision. |
| `payload.updated_at`             | `object`  | No       | —       | Returns all matching records that are greater than the provided iso8601 timestamp. The comparison is done using microsecond precision. |
| `payload.crm_id`                 | `array`   | No       | —       | CRM IDs of opportunities to fetch. If a record can't be found, that record won't be returned and your request will be successful       |
| `payload.person_id`              | `integer` | No       | —       | Filters to only opportunities associated with the given person                                                                         |
| `payload.tag`                    | `array`   | No       | —       | Filters opportunities by the tags applied to the opportunity. Multiple tags can be applied                                             |
| `payload.tag_id`                 | `array`   | No       | —       | Filters opportunities by the tag id's applied to the opportunity. Multiple tag id's can be applied                                     |
| `payload.account_crm_id`         | `string`  | No       | —       | Filters to only opportunities associated with the given crm account                                                                    |
| `payload.account_id`             | `integer` | No       | —       | Filters to only opportunities associated with the given account for teams without a CRM connected                                      |
| `payload.associated_account_id`  | `integer` | No       | —       | Filters to only opportunities associated with the given associated account for CRM connected teams                                     |
| `payload.owner_crm_id`           | `string`  | No       | —       | Filters to only opportunities associated with the given crm owner                                                                      |
| `payload.opportunity_type`       | `string`  | No       | —       | Filters to only opportunities associated with the opportunity type                                                                     |
| `payload.owner_id`               | `integer` | No       | —       | Filters to only opportunities associated with the given user                                                                           |
| `payload.name`                   | `array`   | No       | —       | Filters to only opportunities associated with the given name                                                                           |
| `payload.stage_name`             | `string`  | No       | —       | Filters to only opportunities associated with the given stage name                                                                     |
| `payload.created_date`           | `object`  | No       | —       | Returns all matching records that are greater than the provided iso8601 timestamp. The comparison is done using microsecond precision. |
| `payload.close_date`             | `object`  | No       | —       | Returns all matching records that are greater than the provided iso8601 timestamp. The comparison is done using microsecond precision. |
| `payload.is_closed`              | `boolean` | No       | —       | Filters to only opportunities that are closed                                                                                          |
| `payload.is_won`                 | `boolean` | No       | —       | Filters to only opportunities that are won                                                                                             |
| `payload.most_recent_cadence_id` | `integer` | No       | —       | Filters to only opportunities associated with the most recent cadence id                                                               |
| `payload.scoped_fields`          | `array`   | No       | —       | Specify explicit scoped fields desired on the Opportunity Resource.                                                                    |
| `payload.sort_by`                | `string`  | No       | —       | Key to sort on, must be one of: created\_at, updated\_at, crm\_last\_updated\_date, close\_date. Defaults to updated\_at               |
| `payload.sort_direction`         | `string`  | No       | —       | Direction to sort in, must be one of: ASC, DESC. Defaults to DESC                                                                      |
| `payload.per_page`               | `integer` | No       | —       | How many records to show per page in the range \[1, 100]. Defaults to 25                                                               |
| `payload.page`                   | `integer` | No       | —       | The current page to fetch results from. Defaults to 1                                                                                  |
| `payload.include_paging_counts`  | `boolean` | No       | —       | Whether to include total\_pages and total\_count in the metadata. Defaults to false                                                    |
| `payload.limit_paging_counts`    | `boolean` | No       | —       | Specifies whether the max limit of 10k records should be applied to pagination counts. Affects the total\_count and total\_pages data  |

<details>
  <summary>Show raw input schema</summary>

  ### Input JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Lists multiple Opportunity records. Returns Opportunity records synced from the CRM and created via API. The records can be filtered, paged, and sorted using the parameters below and external ID parameters. To Create, Update and Delete opportunities, refer to this External Mapping guide [here](https://developer.salesloft.com/docs/platform/guides/import-opportunities/).",
    "properties": {
      "ids": {
        "type": "array",
        "description": "IDs of opportunities to fetch. If a record can't be found, that record won't be returned and your request will be successful",
        "items": {
          "type": "integer"
        }
      },
      "created_at": {
        "type": "object",
        "description": "Returns all matching records that are greater than the provided iso8601 timestamp. The comparison is done using microsecond precision.",
        "properties": {
          "gt": {
            "type": "string",
            "description": "Returns all matching records that are greater than the provided iso8601 timestamp. The comparison is done using microsecond precision."
          },
          "gte": {
            "type": "string",
            "description": "Returns all matching records that are greater than or equal to the provided iso8601 timestamp. The comparison is done using microsecond precision."
          },
          "lt": {
            "type": "string",
            "description": "Returns all matching records that are less than the provided iso8601 timestamp. The comparison is done using microsecond precision."
          },
          "lte": {
            "type": "string",
            "description": "Returns all matching records that are less than or equal to the provided iso8601 timestamp. The comparison is done using microsecond precision."
          }
        },
        "required": [],
        "additionalProperties": false
      },
      "updated_at": {
        "type": "object",
        "description": "Returns all matching records that are greater than the provided iso8601 timestamp. The comparison is done using microsecond precision.",
        "properties": {
          "gt": {
            "type": "string",
            "description": "Returns all matching records that are greater than the provided iso8601 timestamp. The comparison is done using microsecond precision."
          },
          "gte": {
            "type": "string",
            "description": "Returns all matching records that are greater than or equal to the provided iso8601 timestamp. The comparison is done using microsecond precision."
          },
          "lt": {
            "type": "string",
            "description": "Returns all matching records that are less than the provided iso8601 timestamp. The comparison is done using microsecond precision."
          },
          "lte": {
            "type": "string",
            "description": "Returns all matching records that are less than or equal to the provided iso8601 timestamp. The comparison is done using microsecond precision."
          }
        },
        "required": [],
        "additionalProperties": false
      },
      "crm_id": {
        "type": "array",
        "description": "CRM IDs of opportunities to fetch. If a record can't be found, that record won't be returned and your request will be successful",
        "items": {
          "type": "string"
        }
      },
      "person_id": {
        "type": "integer",
        "description": "Filters to only opportunities associated with the given person"
      },
      "tag": {
        "type": "array",
        "description": "Filters opportunities by the tags applied to the opportunity. Multiple tags can be applied",
        "items": {
          "type": "string"
        }
      },
      "tag_id": {
        "type": "array",
        "description": "Filters opportunities by the tag id's applied to the opportunity. Multiple tag id's can be applied",
        "items": {
          "type": "integer"
        }
      },
      "account_crm_id": {
        "type": "string",
        "description": "Filters to only opportunities associated with the given crm account"
      },
      "account_id": {
        "type": "integer",
        "description": "Filters to only opportunities associated with the given account for teams without a CRM connected"
      },
      "associated_account_id": {
        "type": "integer",
        "description": "Filters to only opportunities associated with the given associated account for CRM connected teams"
      },
      "owner_crm_id": {
        "type": "string",
        "description": "Filters to only opportunities associated with the given crm owner"
      },
      "opportunity_type": {
        "type": "string",
        "description": "Filters to only opportunities associated with the opportunity type"
      },
      "owner_id": {
        "type": "integer",
        "description": "Filters to only opportunities associated with the given user"
      },
      "name": {
        "type": "array",
        "description": "Filters to only opportunities associated with the given name",
        "items": {
          "type": "string"
        }
      },
      "stage_name": {
        "type": "string",
        "description": "Filters to only opportunities associated with the given stage name"
      },
      "created_date": {
        "type": "object",
        "description": "Returns all matching records that are greater than the provided iso8601 timestamp. The comparison is done using microsecond precision.",
        "properties": {
          "gt": {
            "type": "string",
            "description": "Returns all matching records that are greater than the provided iso8601 timestamp. The comparison is done using microsecond precision."
          },
          "gte": {
            "type": "string",
            "description": "Returns all matching records that are greater than or equal to the provided iso8601 timestamp. The comparison is done using microsecond precision."
          },
          "lt": {
            "type": "string",
            "description": "Returns all matching records that are less than the provided iso8601 timestamp. The comparison is done using microsecond precision."
          },
          "lte": {
            "type": "string",
            "description": "Returns all matching records that are less than or equal to the provided iso8601 timestamp. The comparison is done using microsecond precision."
          }
        },
        "required": [],
        "additionalProperties": false
      },
      "close_date": {
        "type": "object",
        "description": "Returns all matching records that are greater than the provided iso8601 timestamp. The comparison is done using microsecond precision.",
        "properties": {
          "gt": {
            "type": "string",
            "description": "Returns all matching records that are greater than the provided iso8601 timestamp. The comparison is done using microsecond precision."
          },
          "gte": {
            "type": "string",
            "description": "Returns all matching records that are greater than or equal to the provided iso8601 timestamp. The comparison is done using microsecond precision."
          },
          "lt": {
            "type": "string",
            "description": "Returns all matching records that are less than the provided iso8601 timestamp. The comparison is done using microsecond precision."
          },
          "lte": {
            "type": "string",
            "description": "Returns all matching records that are less than or equal to the provided iso8601 timestamp. The comparison is done using microsecond precision."
          }
        },
        "required": [],
        "additionalProperties": false
      },
      "is_closed": {
        "type": "boolean",
        "description": "Filters to only opportunities that are closed"
      },
      "is_won": {
        "type": "boolean",
        "description": "Filters to only opportunities that are won"
      },
      "most_recent_cadence_id": {
        "type": "integer",
        "description": "Filters to only opportunities associated with the most recent cadence id"
      },
      "scoped_fields": {
        "type": "array",
        "description": "Specify explicit scoped fields desired on the Opportunity Resource.",
        "items": {
          "type": "string"
        }
      },
      "sort_by": {
        "type": "string",
        "description": "Key to sort on, must be one of: created_at, updated_at, crm_last_updated_date, close_date. Defaults to updated_at"
      },
      "sort_direction": {
        "type": "string",
        "description": "Direction to sort in, must be one of: ASC, DESC. Defaults to DESC"
      },
      "per_page": {
        "type": "integer",
        "description": "How many records to show per page in the range [1, 100]. Defaults to 25"
      },
      "page": {
        "type": "integer",
        "description": "The current page to fetch results from. Defaults to 1"
      },
      "include_paging_counts": {
        "type": "boolean",
        "description": "Whether to include total_pages and total_count in the metadata. Defaults to false"
      },
      "limit_paging_counts": {
        "type": "boolean",
        "description": "Specifies whether the max limit of 10k records should be applied to pagination counts. Affects the total_count and total_pages data"
      }
    },
    "required": [],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

Standard tool result payload.

| Name                                           | Type      | Required | Default | Details                                                                                         |
| ---------------------------------------------- | --------- | -------- | ------- | ----------------------------------------------------------------------------------------------- |
| `result.data`                                  | `array`   | Yes      | —       | Provider response payload.                                                                      |
| `result.data[].id`                             | `integer` | No       | —       | ID of Opportunity                                                                               |
| `result.data[].name`                           | `string`  | No       | —       | Opportunity Name                                                                                |
| `result.data[].amount`                         | `string`  | No       | —       | Estimated total sale amount                                                                     |
| `result.data[].stage_name`                     | `string`  | No       | —       | Stage name                                                                                      |
| `result.data[].probability`                    | `string`  | No       | —       | Probability                                                                                     |
| `result.data[].crm_id`                         | `string`  | No       | —       | The identifier for this record in the CRM                                                       |
| `result.data[].crm_type`                       | `string`  | No       | —       | CRM type                                                                                        |
| `result.data[].account_crm_id`                 | `string`  | No       | —       | Account CRM id                                                                                  |
| `result.data[].owner_crm_id`                   | `string`  | No       | —       | Owner CRM id                                                                                    |
| `result.data[].account_name`                   | `string`  | No       | —       | Account Full Name                                                                               |
| `result.data[].created_by_crm_id`              | `string`  | No       | —       | Created By CRM id                                                                               |
| `result.data[].opportunity_type`               | `string`  | No       | —       | Opportunity Type                                                                                |
| `result.data[].owner_crm_name`                 | `string`  | No       | —       | Owner CRM Name                                                                                  |
| `result.data[].crm_last_updated_date`          | `string`  | No       | —       | Datetime of when the Opportunity was most recently updated in CRM Format: `date-time`.          |
| `result.data[].close_date`                     | `string`  | No       | —       | Date when the opportunity is expected to close Format: `date-time`.                             |
| `result.data[].is_closed`                      | `boolean` | No       | —       | Whether the opportunity is closed                                                               |
| `result.data[].is_won`                         | `boolean` | No       | —       | Whether the opportunity is closed won                                                           |
| `result.data[].crm_url`                        | `string`  | No       | —       | CRM url, currently Salesforce.com only                                                          |
| `result.data[].created_at`                     | `string`  | No       | —       | Datetime of when the Opportunity was created Format: `date-time`.                               |
| `result.data[].updated_at`                     | `string`  | No       | —       | Datetime of when the Opportunity was last updated Format: `date-time`.                          |
| `result.data[].created_date`                   | `string`  | No       | —       | Datetime of when the Opportunity was created in CRM Format: `date-time`.                        |
| `result.data[].opportunity_window_person_id`   | `integer` | No       | —       | ID of when the attributed person was created in Salesloft                                       |
| `result.data[].opportunity_window_started_at`  | `string`  | No       | —       | Datetime of when the attributed person was created in Salesloft Format: `date-time`.            |
| `result.data[].custom_fields`                  | `record`  | No       | —       | Custom fields are defined by the user's team. Only fields with values are presented in the API. |
| `result.data[].currency_iso_code`              | `string`  | No       | —       | Currency ISO Code                                                                               |
| `result.data[].tags`                           | `array`   | No       | —       | All tags applied to this Opportunities                                                          |
| `result.data[].most_recent_cadence`            | `object`  | No       | —       | The most recent cadence associated with the Opportunity                                         |
| `result.data[].most_recent_cadence.id`         | `integer` | No       | —       | —                                                                                               |
| `result.data[].most_recent_cadence._href`      | `string`  | No       | —       | —                                                                                               |
| `result.data[].most_recent_step`               | `object`  | No       | —       | The most recent step associated with the Opportunity                                            |
| `result.data[].most_recent_step.id`            | `integer` | No       | —       | —                                                                                               |
| `result.data[].most_recent_step._href`         | `string`  | No       | —       | —                                                                                               |
| `result.data[].most_recent_step_number`        | `integer` | No       | —       | The most recent step number associated with the Opportunity                                     |
| `result.data[].most_recent_step_account`       | `object`  | No       | —       | The most recent step account id associated with the Opportunity                                 |
| `result.data[].most_recent_step_account.id`    | `integer` | No       | —       | —                                                                                               |
| `result.data[].most_recent_step_account._href` | `string`  | No       | —       | —                                                                                               |
| `result.data[].owner`                          | `object`  | No       | —       | The owner associated with the Opportunity                                                       |
| `result.data[].owner.id`                       | `integer` | No       | —       | —                                                                                               |
| `result.data[].owner._href`                    | `string`  | No       | —       | —                                                                                               |
| `result.data[].creator`                        | `object`  | No       | —       | The creator associated with the Opportunity                                                     |
| `result.data[].creator.id`                     | `integer` | No       | —       | —                                                                                               |
| `result.data[].creator._href`                  | `string`  | No       | —       | —                                                                                               |
| `result.data[].account`                        | `object`  | No       | —       | The account that this opportunity is associated to                                              |
| `result.data[].account.id`                     | `integer` | No       | —       | —                                                                                               |
| `result.data[].account._href`                  | `string`  | No       | —       | —                                                                                               |
| `result.meta`                                  | `object`  | No       | —       | Additional response metadata (status, paging).                                                  |

<details>
  <summary>Show raw output schema</summary>

  ### Output JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Standard tool result payload.",
    "properties": {
      "data": {
        "type": "array",
        "description": "Provider response payload.",
        "items": {
          "type": "object",
          "description": "Provider response payload.",
          "properties": {
            "id": {
              "type": "integer",
              "description": "ID of Opportunity"
            },
            "name": {
              "type": "string",
              "description": "Opportunity Name"
            },
            "amount": {
              "type": "string",
              "description": "Estimated total sale amount"
            },
            "stage_name": {
              "type": "string",
              "description": "Stage name"
            },
            "probability": {
              "type": "string",
              "description": "Probability"
            },
            "crm_id": {
              "type": "string",
              "description": "The identifier for this record in the CRM"
            },
            "crm_type": {
              "type": "string",
              "description": "CRM type"
            },
            "account_crm_id": {
              "type": "string",
              "description": "Account CRM id"
            },
            "owner_crm_id": {
              "type": "string",
              "description": "Owner CRM id"
            },
            "account_name": {
              "type": "string",
              "description": "Account Full Name"
            },
            "created_by_crm_id": {
              "type": "string",
              "description": "Created By CRM id"
            },
            "opportunity_type": {
              "type": "string",
              "description": "Opportunity Type"
            },
            "owner_crm_name": {
              "type": "string",
              "description": "Owner CRM Name"
            },
            "crm_last_updated_date": {
              "type": "string",
              "description": "Datetime of when the Opportunity was most recently updated in CRM",
              "format": "date-time"
            },
            "close_date": {
              "type": "string",
              "description": "Date when the opportunity is expected to close",
              "format": "date-time"
            },
            "is_closed": {
              "type": "boolean",
              "description": "Whether the opportunity is closed"
            },
            "is_won": {
              "type": "boolean",
              "description": "Whether the opportunity is closed won"
            },
            "crm_url": {
              "type": "string",
              "description": "CRM url, currently Salesforce.com only"
            },
            "created_at": {
              "type": "string",
              "description": "Datetime of when the Opportunity was created",
              "format": "date-time"
            },
            "updated_at": {
              "type": "string",
              "description": "Datetime of when the Opportunity was last updated",
              "format": "date-time"
            },
            "created_date": {
              "type": "string",
              "description": "Datetime of when the Opportunity was created in CRM",
              "format": "date-time"
            },
            "opportunity_window_person_id": {
              "type": "integer",
              "description": "ID of when the attributed person was created in Salesloft"
            },
            "opportunity_window_started_at": {
              "type": "string",
              "description": "Datetime of when the attributed person was created in Salesloft",
              "format": "date-time"
            },
            "custom_fields": {
              "type": "object",
              "description": "Custom fields are defined by the user's team. Only fields with values are presented in the API."
            },
            "currency_iso_code": {
              "type": "string",
              "description": "Currency ISO Code"
            },
            "tags": {
              "type": "array",
              "description": "All tags applied to this Opportunities",
              "items": {
                "type": "string"
              }
            },
            "most_recent_cadence": {
              "type": "object",
              "description": "The most recent cadence associated with the Opportunity",
              "properties": {
                "id": {
                  "type": "integer"
                },
                "_href": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "most_recent_step": {
              "type": "object",
              "description": "The most recent step associated with the Opportunity",
              "properties": {
                "id": {
                  "type": "integer"
                },
                "_href": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "most_recent_step_number": {
              "type": "integer",
              "description": "The most recent step number associated with the Opportunity"
            },
            "most_recent_step_account": {
              "type": "object",
              "description": "The most recent step account id associated with the Opportunity",
              "properties": {
                "id": {
                  "type": "integer"
                },
                "_href": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "owner": {
              "type": "object",
              "description": "The owner associated with the Opportunity",
              "properties": {
                "id": {
                  "type": "integer"
                },
                "_href": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "creator": {
              "type": "object",
              "description": "The creator associated with the Opportunity",
              "properties": {
                "id": {
                  "type": "integer"
                },
                "_href": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "account": {
              "type": "object",
              "description": "The account that this opportunity is associated to",
              "properties": {
                "id": {
                  "type": "integer"
                },
                "_href": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        }
      },
      "meta": {
        "type": "object",
        "description": "Additional response metadata (status, paging).",
        "additionalProperties": true
      }
    },
    "required": [
      "data"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Deepline cost

* Pricing model: `fixed` (per call).
* Estimated Deepline credits: `0` per pricing unit.
* Provider-native pricing may still exist outside Deepline credit billing.

## Related documentation

* [Salesloft provider guide](/docs/providers/salesloft/guide)
* [SDK V2 quickstart](/docs/sdk-v2/quickstart)
* [SDK reference](/docs/sdk-v2/sdk-reference)
* [Run tools across a CSV](/docs/sdk-v2/batch-csv)
