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

# Pipedrive: Get Deals

> Get all deals. Pipedrive Get Deals reference includes SDK V2 and CLI requests, input constraints, response fields, and Deepline cost.

Get all deals.

<Info>
  Tool ID: `pipedrive_get_deals`
</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(
  'pipedrive_get_deals',
  {
    "filter_id": 123,
    "ids": "example",
    "owner_id": 123
  },
);

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

### CLI

```bash theme={null}
deepline tools execute pipedrive_get_deals --input '{
  "filter_id": 123,
  "ids": "example",
  "owner_id": 123
}' --json
```

## Example response

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

```json theme={null}
{
  "data": {
    "success": true,
    "data": [
      {
        "id": 123,
        "title": "VP of Engineering",
        "owner_id": 123
      }
    ],
    "additional_data": {
      "next_cursor": "cursor_123"
    }
  }
}
```

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

## Input reference

Returns data about all not archived deals.

| Name                            | Type                                                                                                                                                                                                                                                                                                                                                                         | Required | Default | Details                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `payload.filter_id`             | `integer`                                                                                                                                                                                                                                                                                                                                                                    | No       | —       | If supplied, only deals matching the specified filter are returned                                                                                                                                                                                                                                                                                                                                                           |
| `payload.ids`                   | `string`                                                                                                                                                                                                                                                                                                                                                                     | No       | —       | Optional comma separated string array of up to 100 entity ids to fetch. If filter\_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response.                                                                                                                                                                                                 |
| `payload.owner_id`              | `integer`                                                                                                                                                                                                                                                                                                                                                                    | No       | —       | If supplied, only deals owned by the specified user are returned. If filter\_id is provided, this is ignored.                                                                                                                                                                                                                                                                                                                |
| `payload.person_id`             | `integer`                                                                                                                                                                                                                                                                                                                                                                    | No       | —       | If supplied, only deals linked to the specified person are returned. If filter\_id is provided, this is ignored.                                                                                                                                                                                                                                                                                                             |
| `payload.org_id`                | `integer`                                                                                                                                                                                                                                                                                                                                                                    | No       | —       | If supplied, only deals linked to the specified organization are returned. If filter\_id is provided, this is ignored.                                                                                                                                                                                                                                                                                                       |
| `payload.pipeline_id`           | `integer`                                                                                                                                                                                                                                                                                                                                                                    | No       | —       | If supplied, only deals in the specified pipeline are returned. If filter\_id is provided, this is ignored.                                                                                                                                                                                                                                                                                                                  |
| `payload.stage_id`              | `integer`                                                                                                                                                                                                                                                                                                                                                                    | No       | —       | If supplied, only deals in the specified stage are returned. If filter\_id is provided, this is ignored.                                                                                                                                                                                                                                                                                                                     |
| `payload.status`                | `"open" \| "won" \| "lost" \| "deleted"`                                                                                                                                                                                                                                                                                                                                     | No       | —       | Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. Multiple statuses can be included as a comma separated array. If filter\_id is provided, this is ignored. Allowed: `open`, `won`, `lost`, `deleted`.                                                                                            |
| `payload.updated_since`         | `string`                                                                                                                                                                                                                                                                                                                                                                     | No       | —       | If set, only deals with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.                                                                                                                                                                                                                                                                                        |
| `payload.updated_until`         | `string`                                                                                                                                                                                                                                                                                                                                                                     | No       | —       | If set, only deals with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.                                                                                                                                                                                                                                                                                                  |
| `payload.sort_by`               | `"id" \| "update_time" \| "add_time"`                                                                                                                                                                                                                                                                                                                                        | No       | `"id"`  | The field to sort by. Supported fields: `id`, `update_time`, `add_time`. Allowed: `id`, `update_time`, `add_time`.                                                                                                                                                                                                                                                                                                           |
| `payload.sort_direction`        | `"asc" \| "desc"`                                                                                                                                                                                                                                                                                                                                                            | No       | `"asc"` | The sorting direction. Supported values: `asc`, `desc`. Allowed: `asc`, `desc`.                                                                                                                                                                                                                                                                                                                                              |
| `payload.include_fields`        | `"next_activity_id" \| "last_activity_id" \| "first_won_time" \| "products_count" \| "files_count" \| "notes_count" \| "followers_count" \| "email_messages_count" \| "activities_count" \| "done_activities_count" \| "undone_activities_count" \| "participants_count" \| "last_incoming_mail_time" \| "last_outgoing_mail_time" \| "smart_bcc_email" \| "source_lead_id"` | No       | —       | Optional comma separated string array of additional fields to include Allowed: `next_activity_id`, `last_activity_id`, `first_won_time`, `products_count`, `files_count`, `notes_count`, `followers_count`, `email_messages_count`, `activities_count`, `done_activities_count`, `undone_activities_count`, `participants_count`, `last_incoming_mail_time`, `last_outgoing_mail_time`, `smart_bcc_email`, `source_lead_id`. |
| `payload.custom_fields`         | `string`                                                                                                                                                                                                                                                                                                                                                                     | No       | —       | Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response. A maximum of 15 keys is allowed.                                                                                                                                                                                 |
| `payload.include_option_labels` | `boolean`                                                                                                                                                                                                                                                                                                                                                                    | No       | —       | When provided with a 'true' value, single option and multiple option custom fields values contain objects in the form of '\{ id: number, label: string }' instead of plain id                                                                                                                                                                                                                                                |
| `payload.include_labels`        | `boolean`                                                                                                                                                                                                                                                                                                                                                                    | No       | —       | When provided with 'true' value, response will include an array of label objects in the form of '\{ id: number, label: string }'                                                                                                                                                                                                                                                                                             |
| `payload.limit`                 | `integer`                                                                                                                                                                                                                                                                                                                                                                    | No       | —       | For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.                                                                                                                                                                                                                                                                        |
| `payload.cursor`                | `string`                                                                                                                                                                                                                                                                                                                                                                     | No       | —       | For pagination, the marker (an opaque string value) representing the first item on the next page                                                                                                                                                                                                                                                                                                                             |

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

  ### Input JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Returns data about all not archived deals.",
    "properties": {
      "filter_id": {
        "type": "integer",
        "description": "If supplied, only deals matching the specified filter are returned"
      },
      "ids": {
        "type": "string",
        "description": "Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response."
      },
      "owner_id": {
        "type": "integer",
        "description": "If supplied, only deals owned by the specified user are returned. If filter_id is provided, this is ignored."
      },
      "person_id": {
        "type": "integer",
        "description": "If supplied, only deals linked to the specified person are returned. If filter_id is provided, this is ignored."
      },
      "org_id": {
        "type": "integer",
        "description": "If supplied, only deals linked to the specified organization are returned. If filter_id is provided, this is ignored."
      },
      "pipeline_id": {
        "type": "integer",
        "description": "If supplied, only deals in the specified pipeline are returned. If filter_id is provided, this is ignored."
      },
      "stage_id": {
        "type": "integer",
        "description": "If supplied, only deals in the specified stage are returned. If filter_id is provided, this is ignored."
      },
      "status": {
        "type": "string",
        "description": "Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. Multiple statuses can be included as a comma separated array. If filter_id is provided, this is ignored.",
        "enum": [
          "open",
          "won",
          "lost",
          "deleted"
        ]
      },
      "updated_since": {
        "type": "string",
        "description": "If set, only deals with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z."
      },
      "updated_until": {
        "type": "string",
        "description": "If set, only deals with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z."
      },
      "sort_by": {
        "type": "string",
        "description": "The field to sort by. Supported fields: `id`, `update_time`, `add_time`.",
        "default": "id",
        "enum": [
          "id",
          "update_time",
          "add_time"
        ]
      },
      "sort_direction": {
        "type": "string",
        "description": "The sorting direction. Supported values: `asc`, `desc`.",
        "default": "asc",
        "enum": [
          "asc",
          "desc"
        ]
      },
      "include_fields": {
        "type": "string",
        "description": "Optional comma separated string array of additional fields to include",
        "enum": [
          "next_activity_id",
          "last_activity_id",
          "first_won_time",
          "products_count",
          "files_count",
          "notes_count",
          "followers_count",
          "email_messages_count",
          "activities_count",
          "done_activities_count",
          "undone_activities_count",
          "participants_count",
          "last_incoming_mail_time",
          "last_outgoing_mail_time",
          "smart_bcc_email",
          "source_lead_id"
        ]
      },
      "custom_fields": {
        "type": "string",
        "description": "Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response. A maximum of 15 keys is allowed."
      },
      "include_option_labels": {
        "type": "boolean",
        "description": "When provided with a 'true' value, single option and multiple option custom fields values contain objects in the form of '{ id: number, label: string }' instead of plain id"
      },
      "include_labels": {
        "type": "boolean",
        "description": "When provided with 'true' value, response will include an array of label objects in the form of '{ id: number, label: string }'"
      },
      "limit": {
        "type": "integer",
        "description": "For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed."
      },
      "cursor": {
        "type": "string",
        "description": "For pagination, the marker (an opaque string value) representing the first item on the next page"
      }
    },
    "required": [],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

Standard tool result payload.

| Name                                      | Type              | Required | Default | Details                                                                                                                                                                                                                                                                                                                                              |
| ----------------------------------------- | ----------------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `result.data`                             | `object`          | Yes      | —       | Provider response payload.                                                                                                                                                                                                                                                                                                                           |
| `result.data.success`                     | `boolean`         | No       | —       | If the response is successful or not                                                                                                                                                                                                                                                                                                                 |
| `result.data.data`                        | `array`           | No       | —       | Deals array                                                                                                                                                                                                                                                                                                                                          |
| `result.data.data[].id`                   | `integer`         | No       | —       | The ID of the deal                                                                                                                                                                                                                                                                                                                                   |
| `result.data.data[].title`                | `string`          | No       | —       | The title of the deal                                                                                                                                                                                                                                                                                                                                |
| `result.data.data[].owner_id`             | `integer`         | No       | —       | The ID of the user who owns the deal                                                                                                                                                                                                                                                                                                                 |
| `result.data.data[].person_id`            | `integer`         | No       | —       | The ID of the person linked to the deal                                                                                                                                                                                                                                                                                                              |
| `result.data.data[].org_id`               | `integer`         | No       | —       | The ID of the organization linked to the deal                                                                                                                                                                                                                                                                                                        |
| `result.data.data[].pipeline_id`          | `integer`         | No       | —       | The ID of the pipeline associated with the deal                                                                                                                                                                                                                                                                                                      |
| `result.data.data[].stage_id`             | `integer`         | No       | —       | The ID of the deal stage                                                                                                                                                                                                                                                                                                                             |
| `result.data.data[].value`                | `number`          | No       | —       | The value of the deal                                                                                                                                                                                                                                                                                                                                |
| `result.data.data[].currency`             | `string`          | No       | —       | The currency associated with the deal                                                                                                                                                                                                                                                                                                                |
| `result.data.data[].add_time`             | `string`          | No       | —       | The creation date and time of the deal                                                                                                                                                                                                                                                                                                               |
| `result.data.data[].update_time`          | `string`          | No       | —       | The last updated date and time of the deal                                                                                                                                                                                                                                                                                                           |
| `result.data.data[].stage_change_time`    | `string`          | No       | —       | The last updated date and time of the deal stage                                                                                                                                                                                                                                                                                                     |
| `result.data.data[].is_deleted`           | `boolean`         | No       | —       | Whether the deal is deleted or not                                                                                                                                                                                                                                                                                                                   |
| `result.data.data[].is_archived`          | `boolean`         | No       | —       | Whether the deal is archived or not                                                                                                                                                                                                                                                                                                                  |
| `result.data.data[].status`               | `string`          | No       | —       | The status of the deal                                                                                                                                                                                                                                                                                                                               |
| `result.data.data[].probability`          | `number \| null`  | No       | —       | The success probability percentage of the deal                                                                                                                                                                                                                                                                                                       |
| `result.data.data[].lost_reason`          | `string \| null`  | No       | —       | The reason for losing the deal                                                                                                                                                                                                                                                                                                                       |
| `result.data.data[].visible_to`           | `integer`         | No       | —       | The visibility of the deal                                                                                                                                                                                                                                                                                                                           |
| `result.data.data[].close_time`           | `string \| null`  | No       | —       | The date and time of closing the deal                                                                                                                                                                                                                                                                                                                |
| `result.data.data[].won_time`             | `string`          | No       | —       | The date and time of changing the deal status as won                                                                                                                                                                                                                                                                                                 |
| `result.data.data[].lost_time`            | `string`          | No       | —       | The date and time of changing the deal status as lost                                                                                                                                                                                                                                                                                                |
| `result.data.data[].expected_close_date`  | `string`          | No       | —       | The expected close date of the deal Format: `date`.                                                                                                                                                                                                                                                                                                  |
| `result.data.data[].label_ids`            | `array`           | No       | —       | The IDs of labels assigned to the deal                                                                                                                                                                                                                                                                                                               |
| `result.data.data[].origin`               | `string`          | No       | —       | The way this Deal was created. `origin` field is set by Pipedrive when Deal is created and cannot be changed.                                                                                                                                                                                                                                        |
| `result.data.data[].origin_id`            | `string \| null`  | No       | —       | The optional ID to further distinguish the origin of the deal - e.g. Which API integration created this Deal.                                                                                                                                                                                                                                        |
| `result.data.data[].channel`              | `integer \| null` | No       | —       | The ID of your Marketing channel this Deal was created from. Recognized Marketing channels can be configured in your Company settings .                                                                                                                                                                                                              |
| `result.data.data[].channel_id`           | `string \| null`  | No       | —       | The optional ID to further distinguish the Marketing channel.                                                                                                                                                                                                                                                                                        |
| `result.data.data[].source_lead_id`       | `string \| null`  | No       | —       | The ID of the lead if the deal was converted from a lead. Only included when requested via include\_fields parameter. Format: `uuid`.                                                                                                                                                                                                                |
| `result.data.data[].arr`                  | `number \| null`  | No       | —       | Only available in Growth and above plans The Annual Recurring Revenue of the deal Null if there are no products attached to the deal                                                                                                                                                                                                                 |
| `result.data.data[].mrr`                  | `number \| null`  | No       | —       | Only available in Growth and above plans The Monthly Recurring Revenue of the deal Null if there are no products attached to the deal                                                                                                                                                                                                                |
| `result.data.data[].acv`                  | `number \| null`  | No       | —       | Only available in Growth and above plans The Annual Contract Value of the deal Null if there are no products attached to the deal                                                                                                                                                                                                                    |
| `result.data.data[].custom_fields`        | `record`          | No       | —       | An object where each key represents a custom field. All custom fields are referenced as randomly generated 40-character hashes. To clear a custom field value, set it to `null`. For multi-option fields (field type `set`), use `null` to clear the selection — sending an empty array `[]` is not supported and will result in a validation error. |
| `result.data.additional_data`             | `object`          | No       | —       | The additional data of the list                                                                                                                                                                                                                                                                                                                      |
| `result.data.additional_data.next_cursor` | `string`          | No       | —       | The first item on the next page. The value of the `next_cursor` field will be `null` if you have reached the end of the dataset and there’s no more pages to be returned.                                                                                                                                                                            |
| `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": "object",
        "description": "Provider response payload.",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "If the response is successful or not"
          },
          "data": {
            "type": "array",
            "description": "Deals array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "description": "The ID of the deal"
                },
                "title": {
                  "type": "string",
                  "description": "The title of the deal"
                },
                "owner_id": {
                  "type": "integer",
                  "description": "The ID of the user who owns the deal"
                },
                "person_id": {
                  "type": "integer",
                  "description": "The ID of the person linked to the deal"
                },
                "org_id": {
                  "type": "integer",
                  "description": "The ID of the organization linked to the deal"
                },
                "pipeline_id": {
                  "type": "integer",
                  "description": "The ID of the pipeline associated with the deal"
                },
                "stage_id": {
                  "type": "integer",
                  "description": "The ID of the deal stage"
                },
                "value": {
                  "type": "number",
                  "description": "The value of the deal"
                },
                "currency": {
                  "type": "string",
                  "description": "The currency associated with the deal"
                },
                "add_time": {
                  "type": "string",
                  "description": "The creation date and time of the deal"
                },
                "update_time": {
                  "type": "string",
                  "description": "The last updated date and time of the deal"
                },
                "stage_change_time": {
                  "type": "string",
                  "description": "The last updated date and time of the deal stage"
                },
                "is_deleted": {
                  "type": "boolean",
                  "description": "Whether the deal is deleted or not"
                },
                "is_archived": {
                  "type": "boolean",
                  "description": "Whether the deal is archived or not"
                },
                "status": {
                  "type": "string",
                  "description": "The status of the deal"
                },
                "probability": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "description": "The success probability percentage of the deal"
                },
                "lost_reason": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The reason for losing the deal"
                },
                "visible_to": {
                  "type": "integer",
                  "description": "The visibility of the deal"
                },
                "close_time": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The date and time of closing the deal"
                },
                "won_time": {
                  "type": "string",
                  "description": "The date and time of changing the deal status as won"
                },
                "lost_time": {
                  "type": "string",
                  "description": "The date and time of changing the deal status as lost"
                },
                "expected_close_date": {
                  "type": "string",
                  "description": "The expected close date of the deal",
                  "format": "date"
                },
                "label_ids": {
                  "type": "array",
                  "description": "The IDs of labels assigned to the deal",
                  "items": {
                    "type": "integer"
                  }
                },
                "origin": {
                  "type": "string",
                  "description": "The way this Deal was created. `origin` field is set by Pipedrive when Deal is created and cannot be changed."
                },
                "origin_id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The optional ID to further distinguish the origin of the deal - e.g. Which API integration created this Deal."
                },
                "channel": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "description": "The ID of your Marketing channel this Deal was created from. Recognized Marketing channels can be configured in your Company settings ."
                },
                "channel_id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The optional ID to further distinguish the Marketing channel."
                },
                "source_lead_id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The ID of the lead if the deal was converted from a lead. Only included when requested via include_fields parameter.",
                  "format": "uuid"
                },
                "arr": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "description": "Only available in Growth and above plans The Annual Recurring Revenue of the deal Null if there are no products attached to the deal"
                },
                "mrr": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "description": "Only available in Growth and above plans The Monthly Recurring Revenue of the deal Null if there are no products attached to the deal"
                },
                "acv": {
                  "type": [
                    "number",
                    "null"
                  ],
                  "description": "Only available in Growth and above plans The Annual Contract Value of the deal Null if there are no products attached to the deal"
                },
                "custom_fields": {
                  "type": "object",
                  "description": "An object where each key represents a custom field. All custom fields are referenced as randomly generated 40-character hashes. To clear a custom field value, set it to `null`. For multi-option fields (field type `set`), use `null` to clear the selection — sending an empty array `[]` is not supported and will result in a validation error.",
                  "additionalProperties": true
                }
              },
              "additionalProperties": false
            }
          },
          "additional_data": {
            "type": "object",
            "description": "The additional data of the list",
            "properties": {
              "next_cursor": {
                "type": "string",
                "description": "The first item on the next page. The value of the `next_cursor` field will be `null` if you have reached the end of the dataset and there’s no more pages to be returned."
              }
            },
            "additionalProperties": false
          }
        },
        "required": [],
        "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

* [Pipedrive provider guide](/docs/providers/pipedrive/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)
