# List Organizations — Pipedrive

> List organizations in your Pipedrive account. See the documentation

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

## Description

List organizations in your Pipedrive account. [See the documentation](https://developers.pipedrive.com/docs/api/v1/Organizations#getOrganizations)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `filterId` | `integer` | No | The ID of the filter to apply to organizations Options are loaded from the connected account. |
| `organizationIds` | `string[]` | No | The IDs of the organizations to list (up to 100). Filter ID takes precedence over Organization IDs when supplied. Options are loaded from the connected account. |
| `ownerId` | `integer` | No | ID of the user who owns the organization. If omitted, organizations owned by any user are returned. Filter ID takes precedence over Owner ID when supplied. Options are loaded from the connected account. |
| `updatedSince` | `string` | No | If set, only organizations 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 organizations with an update_time earlier than 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 string array of custom field keys to include in the response. |
| `includeOptionLabels` | `boolean` | No | When true, single-option and multi-option custom field values include the option labels alongside their IDs. Defaults to false. |
| `includeLabels` | `boolean` | No | When true, the response includes an array of label objects ({ id, label, color }) for each organization. Defaults to false. |
| `limit` | `integer` | No | For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Maximum allowed value is 500. |
| `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-organizations",
  arguments: {
    filterId: 10,
    organizationIds: ["Organization 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-organizations",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    pipedrive: { authProvisionId: "apn_xxxxxxx" },
    filterId: 10,
    organizationIds: ["Organization 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-organizations",
    "configured_props": {
      "pipedrive": { "authProvisionId": "apn_xxxxxxx" },
      "filterId": 10,
      "organizationIds": ["Organization IDs"]
    }
  }'
```

---

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