# List Users — Gong

> List the Gong users in your company and return an array of user objects. Gong cannot search users by name or email, so to resolve a rep to their user ID, list users and match the returned firstName/lastName/emailAddress fields yourself…

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

## Description

List the Gong users in your company and return an array of user objects. Gong cannot search users by name or email, so to resolve a rep to their user ID, list users and match the returned `firstName`/`lastName`/`emailAddress` fields yourself; that ID is what **Search Calls** needs for **Primary User IDs**. Pass a single value in **User IDs** to fetch one known user. Gong has no teams endpoint: set **Manager ID** to list that manager's direct reports, filtered here rather than by the API. Returns at most **Limit** users. [See the documentation](https://gong.app.gong.io/settings/api/documentation#post-/v2/users/extensive)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `userIds` | `string[]` | No | Return only these users, as a list of Gong user IDs (e.g. ["4011503062935085673"]). Pass a single ID to fetch one user. Options are loaded from the connected account. |
| `managerId` | `string` | No | Return only users whose managerId matches this Gong user ID (the id field of the manager's own user record, e.g. 4011503062935085673), which is how you list a manager's team. Applied here after fetching, not by the Gong API. Options are loaded from the connected account. |
| `createdFromDateTime` | `string` | No | Return only users created on or after this date and time, in ISO-8601 format (e.g. 2026-01-01T00:00:00Z). |
| `createdToDateTime` | `string` | No | Return only users created before this date and time, in ISO-8601 format (e.g. 2026-04-01T00:00:00Z). |
| `includeAvatars` | `boolean` | No | Whether to include avatars, the synthetic users that represent Gong employees accessing your instance. Off by default because they are rarely what you want. |
| `limit` | `integer` | No | Maximum number of users to return. Min 1, max 1000. |

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

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: "gong-list-users",
  arguments: {
    userIds: ["User IDs"],
    managerId: "Manager ID",
  },
})
```

**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: "gong-list-users",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    gong: { authProvisionId: "apn_xxxxxxx" },
    userIds: ["User IDs"],
    managerId: "Manager ID",
  },
})

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": "gong-list-users",
    "configured_props": {
      "gong": { "authProvisionId": "apn_xxxxxxx" },
      "userIds": ["User IDs"],
      "managerId": "Manager ID"
    }
  }'
```

---

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