# Create Broadcast — AWeber

> Create a broadcast under the specified account and list. See the documentation.

- Key: `aweber-create-broadcast`
- Type: Action (Write)
- Version: 0.0.2
- App: AWeber (`aweber`) — https://pipedream.com/apps/aweber.md
- This page (HTML): https://pipedream.com/apps/aweber/actions/create-broadcast
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/aweber/actions/create-broadcast/create-broadcast.mjs

## Description

Create a broadcast under the specified account and list. [See the documentation](https://api.aweber.com/#tag/Broadcasts/paths/~1accounts~1%7BaccountId%7D~1lists~1%7BlistId%7D~1broadcasts/post).

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `accountId` | `integer` | Yes | The account ID Options are loaded from the connected account. |
| `listId` | `string` | Yes | The list ID Options are loaded from the connected account. |
| `bodyHTML` | `string` | No | The content of the message in HTML format. If Body Text is not provided, it will be auto-generated. If Body Text is not provided, Body HTML must be provided. |
| `bodyText` | `string` | No | The content of the message in plain text, used when HTML is not supported. If Body HTML is not provided, the broadcast will be sent using only the Body Text. If Body Text is not provided, Body HTML must be provided. |
| `bodyAmp` | `string` | No | The content of the message in AMP format. Read Aweber KB article before using this field |
| `clickTrackingEnabled` | `boolean` | No | Enables links in the email message to be tracked. |
| `excludeLists` | `string[]` | No | List of Lists URLs to exclude in the delivery of this broadcast. e.g. https://api.aweber.com/1.0/accounts/<account_id>/lists/<list_id> Options are loaded from the connected account. |
| `includeLists` | `string[]` | No | List of Lists URLs to include in the delivery of this broadcast. e.g. https://api.aweber.com/1.0/accounts/<account_id>/lists/<list_id> Options are loaded from the connected account. |
| `facebookIntegration` | `string` | No | URL to the Facebook broadcast integration to use for this broadcast. When the broadcast is sent, the subject of the broadcast will be posted to this Facebook integration - e.g. https://api.aweber.com/1.0/accounts/<account_id>/integrations/<integration_id>. Options are loaded from the connected account. |
| `isArchived` | `boolean` | No | Whether the broadcast enabled sharing via an archive URL. |
| `notifyOnSend` | `boolean` | No | If true, notify when stats are available on a sent broadcast message. |
| `segmentLink` | `string` | No | URL to the Segment to send this broadcast to. e.g. https://api.aweber.com/1.0/accounts/<account_id>/lists/<list_id>/segments/<segment_id>. If not specified, the broadcast will be sent to the “Active Subscribers” segment. Options are loaded from the connected account. |
| `subject` | `string` | Yes | The broadcast subject line. Subject must not be empty nor contain only whitespace. |
| `twitterIntegration` | `string` | No | URL to the Twitter broadcast integration to use for this broadcast. When the broadcast is sent, the subject of the broadcast will be tweeted - e.g. https://api.aweber.com/1.0/accounts/<account_id>/integrations/<integration_id>. Options are loaded from the connected account. |

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

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: "aweber-create-broadcast",
  arguments: {
    accountId: 10,
    listId: "List 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: "aweber-create-broadcast",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    aweber: { authProvisionId: "apn_xxxxxxx" },
    accountId: 10,
    listId: "List 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": "aweber-create-broadcast",
    "configured_props": {
      "aweber": { "authProvisionId": "apn_xxxxxxx" },
      "accountId": 10,
      "listId": "List ID"
    }
  }'
```

---

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