# List Deals — Pipedrive

> List deals in your Pipedrive account. See the documentation

- Key: `pipedrive-list-deals`
- Type: Action (Read-only)
- Version: 0.0.4
- App: Pipedrive (`pipedrive`) — https://pipedream.com/apps/pipedrive.md
- This page (HTML): https://pipedream.com/apps/pipedrive/actions/list-deals
- Hints: read-only · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/pipedrive/actions/list-deals/list-deals.mjs

## Description

List deals in your Pipedrive account. [See the documentation](https://developers.pipedrive.com/docs/api/v1/Deals#listDeals)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `filterId` | `integer` | No | The ID of the filter to apply to deals Options are loaded from the connected account. |
| `dealIds` | `string[]` | No | The IDs of the deals to list. Filter ID takes precedence over Deal IDs when supplied. Options are loaded from the connected account. |
| `ownerId` | `integer` | No | ID of the user who will be marked as the owner of this deal. If omitted, the authorized user ID will be used. However, Filter ID takes precedence over Owner ID when supplied. Options are loaded from the connected account. |
| `personId` | `integer` | No | If supplied, only deals matching the given person will be returned. However, Filter ID takes precedence over Person ID when supplied. Options are loaded from the connected account. |
| `organizationId` | `integer` | No | If supplied, only deals matching the given organization will be returned. However, Filter ID takes precedence over Organization ID when supplied. Options are loaded from the connected account. |
| `pipelineId` | `integer` | No | If supplied, only deals matching the given pipeline will be returned. However, Filter ID takes precedence over Pipeline ID when supplied. Options are loaded from the connected account. |
| `stageId` | `integer` | No | If supplied, only deals matching the given stage will be returned. However, Filter ID takes precedence over Stage ID when supplied. Options are loaded from the connected account. |
| `status` | `string` | No | Only fetch deals with a specific status |
| `updatedSince` | `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. |
| `updatedUntil` | `string` | No | If set, only deals with an update_time earlier than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. |
| `sortBy` | `string` | No | The field to sort by |
| `sortDirection` | `string` | No | The direction to sort by |
| `includeFields` | `string[]` | No | Additional fields to include in the response |
| `customFields` | `string[]` | No | Optional comma separated string array of custom fields keys to include |
| `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. |
| `cursor` | `string` | No | For pagination, the cursor to the next page of results. If not provided, the first page will be returned. |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "pipedrive",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "pipedrive-list-deals",
  arguments: {
    filterId: 10,
    dealIds: ["Deal IDs"],
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "pipedrive-list-deals",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    pipedrive: { authProvisionId: "apn_xxxxxxx" },
    filterId: 10,
    dealIds: ["Deal IDs"],
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "pipedrive-list-deals",
    "configured_props": {
      "pipedrive": { "authProvisionId": "apn_xxxxxxx" },
      "filterId": 10,
      "dealIds": ["Deal IDs"]
    }
  }'
```

---

- App: https://pipedream.com/apps/pipedrive.md · All apps: https://pipedream.com/apps
