# List All Contacts — ActiveCampaign

> Retrieve all existing contacts. See the docs here.

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

## Description

Retrieve all existing contacts. See the docs [here](https://developers.activecampaign.com/reference/list-all-contacts).

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `ids` | `string` | No | Filter contacts by ID. Can be repeated for multiple IDs. Example: ids[]=1&ids[]=2&ids[]=42 |
| `email` | `string` | No | Email address of the contact you want to get |
| `emailLike` | `string` | No | Filter contacts that contain the given value in the email address |
| `exclude` | `string` | No | Exclude from the response the contact with the given ID |
| `formid` | `string` | No | Filter contacts associated with the given form |
| `idGreater` | `string` | No | Only include contacts with an ID greater than the given ID |
| `idLess` | `string` | No | Only include contacts with an ID less than the given ID |
| `listid` | `string` | No | Filter contacts associated with the given list |
| `organization` | `string` | No | (Deprecated) Please use Account-Contact end points. Filter contacts associated with the given organization ID |
| `search` | `string` | No | Filter contacts that match the given value in the contact names, organization, phone or email |
| `segmentid` | `string` | No | Return only contacts that match a list segment (this param initially returns segment information, when it is run a second time it will return contacts that match the segment) |
| `seriesid` | `string` | No | Filter contacts associated with the given automation |
| `status` | `string` | No | See available values |
| `tagid` | `string` | No | Filter contacts associated with the given tag |
| `createdBefore` | `string` | No | Filter contacts that were created prior to this date |
| `createdAfter` | `string` | No | Filter contacts that were created after this date |
| `updatedBefore` | `string` | No | Filter contacts that were updated before this date |
| `updatedAfter` | `string` | No | Filter contacts that were updated after this date |
| `waitid` | `string` | No | Filter by contacts in the wait queue of an automation block |
| `orderByCreationDate` | `string` | No | Order contacts by creation date |
| `orderByEmail` | `string` | No | Order contacts by email |
| `orderByFirstName` | `string` | No | Order contacts by first name |
| `orderByLastName` | `string` | No | Order contacts by last name |
| `orderByName` | `string` | No | Order contacts by full name |
| `orderByScore` | `string` | No | Order contacts by score |
| `inGroupLists` | `string` | No | Set this to true in order to return only contacts that the current user has permissions to see. |

## 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": "activecampaign",
      },
    },
  },
)

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: "activecampaign-list-all-contacts",
  arguments: {
    ids: "IDs",
    email: "Email",
  },
})
```

**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: "activecampaign-list-all-contacts",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    activecampaign: { authProvisionId: "apn_xxxxxxx" },
    ids: "IDs",
    email: "Email",
  },
})

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": "activecampaign-list-all-contacts",
    "configured_props": {
      "activecampaign": { "authProvisionId": "apn_xxxxxxx" },
      "ids": "IDs",
      "email": "Email"
    }
  }'
```

---

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