# Create Post — Beehiiv

> Create a new post (newsletter draft). Pass HTML content in the content parameter. The post is created as a draft by default — set status: "confirmed" to publish immediately. Use content tags to categorize the post. Use Get Publication Info…

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

## Description

Create a new post (newsletter draft). Pass HTML content in the `content` parameter. The post is created as a draft by default — set `status: "confirmed"` to publish immediately. Use content tags to categorize the post. Use **Get Publication Info** to get the publication ID. [See the documentation](https://developers.beehiiv.com/api-reference/posts/create)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `publicationId` | `string` | Yes | The publication ID. Use Get Publication Info to find this. |
| `title` | `string` | Yes | The title of the post. |
| `subtitle` | `string` | No | The subtitle/preview text of the post. |
| `content` | `string` | Yes | The HTML content of the post body. Example: <p>Hello subscribers!</p>. |
| `slug` | `string` | No | URL slug for the post. Auto-generated from title if omitted. |
| `authors` | `string[]` | No | Author names for the post. |
| `contentTags` | `string[]` | No | Tags to categorize the post. |
| `status` | `string` | No | Post status. draft (default) or confirmed (published). |

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

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: "beehiiv-create-post",
  arguments: {
    publicationId: "Publication ID",
    title: "Title",
  },
})
```

**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: "beehiiv-create-post",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    beehiiv: { authProvisionId: "apn_xxxxxxx" },
    publicationId: "Publication ID",
    title: "Title",
  },
})

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": "beehiiv-create-post",
    "configured_props": {
      "beehiiv": { "authProvisionId": "apn_xxxxxxx" },
      "publicationId": "Publication ID",
      "title": "Title"
    }
  }'
```

---

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