CONNECT APP
Build with Beehiiv
Marketing
- API key
MCP
Give your agent Beehiiv tools
Every Beehiiv action is exposed as an MCP tool on Pipedream's remote server. Point a client at it with your end user's ID and Connect resolves that user's Beehiiv account for each tool call — you store no tokens.
// accessToken: mint a short-lived token with the Connect SDK — see the MCP guide
const transport = new StreamableHTTPClientTransport(
new URL("https://remote.mcp.pipedream.net/v3"),
{
requestInit: {
headers: {
Authorization: `Bearer ${accessToken}`,
"x-pd-project-id": "{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()
// e.g. run Add Subscriber:
const result = await mcp.callTool({
name: "beehiiv-add-subscriber",
arguments: {
publicationId: "Publication ID",
email: "Email",
},
})# access_token: mint a short-lived token with the Connect SDK — see the MCP guide
headers = {
"Authorization": f"Bearer {access_token}",
"x-pd-project-id": "{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",
}
async with streamablehttp_client("https://remote.mcp.pipedream.net/v3", headers=headers) as (read, write, _):
async with ClientSession(read, write) as session:
await session.initialize()
tools = await session.list_tools()
# e.g. run Add Subscriber:
result = await session.call_tool("beehiiv-add-subscriber", {
"publicationId": "Publication ID",
"email": "Email",
})API PROXY
Call the Beehiiv API directly
For an endpoint with no pre-built tool, the Connect proxy forwards your request to the Beehiiv API with the connected user's credentials attached. You store no tokens and write no refresh logic.
const resp = await pd.proxy.get({
externalUserId: "{external_user_id}", // any stable ID for this user in your system
accountId: "apn_xxxxxxx",
url: "https://api.beehiiv.com/v2/publications",
})
// Any allowed Beehiiv endpoint works here. Pipedream attaches the
// connected account's credentials to the outgoing request.# The path segment is the target URL, URL-safe base64 encoded:
# https://api.beehiiv.com/v2/publications
curl "https://api.pipedream.com/v1/connect/{project_id}/proxy/aHR0cHM6Ly9hcGkuYmVlaGlpdi5jb20vdjIvcHVibGljYXRpb25z?external_user_id={external_user_id}&account_id=apn_xxxxxxx" \
-H "Authorization: Bearer {access_token}" \
-H "x-pd-environment: production"SDK
Run Beehiiv actions from your backend
Connect a user's Beehiiv account once, then run Add Subscriber on their behalf from your own code — TypeScript, Python, or plain HTTP.
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-add-subscriber",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
beehiiv: { authProvisionId: "apn_xxxxxxx" },
publicationId: "Publication ID",
email: "Email",
},
})from pipedream import Pipedream
pd = Pipedream(
client_id="{oauth_client_id}",
client_secret="{oauth_client_secret}",
project_id="{project_id}",
project_environment="production",
)
result = pd.actions.run(
id="beehiiv-add-subscriber",
external_user_id="{external_user_id}", # any stable ID for this user in your system
configured_props={
"beehiiv": {"authProvisionId": "apn_xxxxxxx"},
"publicationId": "Publication ID",
"email": "Email",
},
)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-add-subscriber",
"configured_props": {
"beehiiv": { "authProvisionId": "apn_xxxxxxx" },
"publicationId": "Publication ID",
"email": "Email"
}
}'TOOLS
Beehiiv actions
On-demand operations your product or agent can configure and run on behalf of a connected user.
-
Add Subscriber
actionCreate a new subscriber for a publication. Use List Custom Fields to discover available custom field names before passingcustomFields. Use Get Publication Info to get the publication ID. SetreactivateExisting: trueto re-subscribe someone who previously unsubscribed. See the documentationWritev0.0.2 -
Create Post
actionCreate a new post (newsletter draft). Pass HTML content in thecontentparameter. The post is created as a draft by default — setstatus: "confirmed"to publish immediately. Use content tags to categorize the post. Use Get Publication Info to get the publication ID. See the documentationWritev0.0.2 -
Create Subscriber
actionCreate a new subscriber. See docsWritev0.0.5 -
Get Post Analytics
actionGet aggregated analytics across all posts — open rates, click rates, unsubscribes, etc. Filter by audience (free/premium), platform (web/email), or content tags. Returns metrics: recipients, delivered, opens, unique_opens, open_rate, clicks, unique_clicks, click_rate, unsubscribes, spam_reports. Use List Posts to see individual post details. Use Get Publication Info to get the publication ID. See the documentationRead-onlyv0.0.2 -
Get Publication Info
actionGet details about the current beehiiv publication, including name, URL, and subscriber stats. Call this first to get thepublicationIdneeded by all other tools. If you have multiple publications, pass thepublicationId— otherwise the first publication is returned. Returns the publication name, description, URL, creation date, and subscriber count. See the documentationRead-onlyv0.0.2 -
Get Subscriber
actionGet full details for a single subscriber by ID or email. Useexpandto include stats (open/click rates), custom field values, or referral data. EithersubscriptionIdoremailmust be provided. Use Search Subscribers to find subscriber IDs. Use Get Publication Info to get the publication ID. See the documentationRead-onlyv0.0.2 -
List All Publications
actionGet a list of all your publications. See docsRead-onlyv0.0.5 -
List Custom Fields
actionSchema discovery — list all custom fields defined for subscribers in a publication. Use this before Create Subscriber or Update Subscriber to know what custom fields are available and their expected types. Use Get Publication Info to get the publication ID. See the documentationRead-onlyv0.0.2 -
List Posts
actionList posts (newsletter issues) for a publication. Filter by status, audience, platform, or content tags. Returns post titles, dates, status, and URLs. Use Get Publication Info to get the publication ID. Use Get Post Analytics for aggregate performance metrics across posts. See the documentationRead-onlyv0.0.2 -
List Segments
actionList subscriber segments for a publication. Segments are pre-defined subscriber groups (dynamic rules, static lists, or manual selections). Use this for discovery — to understand how subscribers are organized. Use Get Publication Info to get the publication ID. See the documentationRead-onlyv0.0.2 -
Search Subscribers
actionSearch and filter subscribers for a publication. Useemailfor exact email lookup, or combinestatusandtierfilters to narrow results. Use Get Publication Info to get the publication ID. For full details on a single subscriber (with stats, custom fields, referrals), use Get Subscriber instead. Use List Custom Fields to discover available custom field names. See the documentationRead-onlyv0.0.2 -
Update Subscriber
actionUpdate an existing subscriber's fields or unsubscribe them. Use Search Subscribers or Get Subscriber to find the subscription ID first. Use List Custom Fields to discover available custom field names. Setunsubscribe: trueto unsubscribe the subscriber. Use Get Publication Info to get the publication ID. See the documentationWritev0.0.2
EVENTS
Beehiiv triggers
Event sources your backend can deploy for users and receive through a webhook.
No Beehiiv triggers are available yet.
MULTI-APP
Use Beehiiv with other popular apps
Most products don't stop at one integration. Pair Beehiiv with the other apps your users rely on, and ship use cases that span both.
- App slug
- beehiiv
- Authentication
- API key
- Categories
- Marketing
- Actions
- 12
- Triggers
- 0
- API proxy
- Available