# HeyGen — Pipedream Connect

> AI-powered video creations at scale

- API slug: `heygen` (use in MCP headers and tool keys)
- Auth: API key (Pipedream-managed)
- Categories: Artificial Intelligence (AI)
- Website: https://www.heygen.com/
- This page (HTML): https://pipedream.com/apps/heygen
- Tools: 5 actions · 3 triggers

## Connect via MCP (recommended)

- Endpoint: `https://remote.mcp.pipedream.net/v3`
- Headers: `Authorization: Bearer <token>` · `x-pd-project-id` · `x-pd-environment` · `x-pd-external-user-id` · `x-pd-app-slug: heygen`

```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": "heygen",
      },
    },
  },
)

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

const { tools } = await mcp.listTools()

// e.g. run List Custom Events Options:
const result = await mcp.callTool({
  name: "heygen-list-custom-events-options",
  arguments: {},
})
```

Docs: [MCP guide](https://pipedream.com/docs/connect/mcp/developers.md)

## API proxy

For a HeyGen endpoint with no pre-built tool, the proxy forwards your request with the connected user's credentials attached.

```bash
# The path segment is the target URL, URL-safe base64 encoded:
# https://api.heygen.com/v2/avatars

curl "https://api.pipedream.com/v1/connect/{project_id}/proxy/aHR0cHM6Ly9hcGkuaGV5Z2VuLmNvbS92Mi9hdmF0YXJz?external_user_id={external_user_id}&account_id=apn_xxxxxxx" \
  -H "Authorization: Bearer {access_token}" \
  -H "x-pd-environment: production"
```

Docs: [API proxy guide](https://pipedream.com/docs/connect/api-proxy.md)

## SDK

```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: "heygen-list-custom-events-options",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    heygen: { authProvisionId: "apn_xxxxxxx" },
  },
})
```

Docs: [Managed auth guide](https://pipedream.com/docs/connect/managed-auth/quickstart.md) · [Tools guide](https://pipedream.com/docs/connect/components.md)

## Actions (5)

### `heygen-list-custom-events-options` — List Custom Events Options (Read-only)

Retrieves available options for the Custom Events field.

Full schema: https://pipedream.com/apps/heygen/actions/list-custom-events-options.md

### `heygen-list-talking-photo-id-options` — List Talking Photo ID Options (Read-only)

Retrieves available options for the Talking Photo ID field.

Full schema: https://pipedream.com/apps/heygen/actions/list-talking-photo-id-options.md

### `heygen-list-template-id-options` — List Template ID Options (Read-only)

Retrieves available options for the Template ID field.

Full schema: https://pipedream.com/apps/heygen/actions/list-template-id-options.md

### `heygen-list-voice-id-options` — List Voice ID Options (Read-only)

Retrieves available options for the Voice ID field.

Full schema: https://pipedream.com/apps/heygen/actions/list-voice-id-options.md

### `heygen-retrieve-video-link` — Retrieve Video Link (Read-only)

Fetches a link for a specific heygen video. See the documentation

Full schema: https://pipedream.com/apps/heygen/actions/retrieve-video-link.md

## Triggers (3)

### `heygen-new-avatar-video-custom-event` — New Avatar Video Custom Event (Instant) (Instant)

Emit new event when a specific avatar video event occurs. The user can define a custom set of event(s) to trigger. See the documentation

Full schema: https://pipedream.com/apps/heygen/triggers/new-avatar-video-custom-event.md

### `heygen-new-avatar-video-failure` — New Avatar Video Failure (Instant) (Instant)

Emit new event when a Heygen video fails during processing. See the documentation

Full schema: https://pipedream.com/apps/heygen/triggers/new-avatar-video-failure.md

### `heygen-new-avatar-video-success` — New Avatar Video Success (Instant) (Instant)

Emit new event when a new avatar video has been successfully generated. See the documentation

Full schema: https://pipedream.com/apps/heygen/triggers/new-avatar-video-success.md

---

- All apps: https://pipedream.com/apps — index: https://pipedream.com/llms.txt
- Pipedream docs for agents: https://pipedream.com/docs/llms.txt
