beehiiv
Create subscribers, list publications, and manage your newsletter on beehiiv.
On this page
Connect
Auth type: API key (secret_text). Paste the API key (or token) from the provider's settings into the connect dialog. It is encrypted at rest and only decrypted on the server when an action runs.
- In the editor: Backend panel, Integrations tab, then Connect. This connects it for the project.
- For every project in a workspace: Workspace settings, Integrations.
- Owners and admins choose which integrations members may connect in the admin panel (Integrations tab), and can attach their own OAuth app there.
Call it from a workflow
Pass the action name and its input. The call resolves with { success, output, error? }; a missing connection resolves with success false and the reason. See ctx.integrations.invoke and ctx.integrations.call.
// .workflow.js (native ctx)
export async function run(ctx) {
const res = await ctx.integrations.invoke("beehiiv", "create_subscription", {
"publicationId": "<publicationId>",
"email": "<email>"
});
if (!res.success) throw new Error(res.error);
ctx.log.info("beehiiv answered", { output: res.output });
}// defineWorkflow module (@app/sdk ctx)
import { defineWorkflow } from "@app/sdk";
export default defineWorkflow({
id: "beehiiv-create-subscription",
name: "beehiiv: Create Subscription",
description: "Calls beehiiv when a row is created.",
trigger: { type: "entity_event", entity: "tickets", event: "created" },
async run(ctx, event) {
const res = await ctx.integrations.call("beehiiv", {
"action": "create_subscription",
"publicationId": "<publicationId>",
"email": "<email>"
}) as { success: boolean; error?: string };
if (!res.success) throw new Error(res.error);
},
});curl -X POST "$APP_ORIGIN/__appbricx/connector-proxy/beehiiv/create_subscription" \
-H "Authorization: Bearer $APP_KEY" \
-H "content-type: application/json" \
-d '{"props":{"publicationId":"<publicationId>","email":"<email>"}}'Actions
create_subscriptionin catalog
Create Subscription. Creates a new subscription.
| Input | Type | Description |
|---|---|---|
publicationIdrequired | id (picked from your account) | Publication |
emailrequired | text | The email address of the new subscription. |
reactivate_existingoptional | boolean | Whether to reactivate the subscription if they have already unsubscribed. Use only if the subscription is knowingly resubscribing. |
send_welcome_emailoptional | boolean | Whether to send the default welcome email to the subscription. |
utm_sourceoptional | text | The source of the subscription. |
utm_mediumoptional | text | The medium of the subscription. |
utm_campaignoptional | text | The acquisition campaign of the subscription. |
referring_siteoptional | text | The website that the subscription was referred from. |
referral_codeoptional | text | A subscription's referral_code to give them credit for the new subscription. |
tieroptional | one of "free" | "premium" | The tier for this subscription. |
custom_fieldsoptional | object (depends on other props) | Custom Fields |
stripe_customer_idoptional | text | The Stripe customer ID for this subscription. |
double_opt_overrideoptional | text | Override publication double-opt settings for this subscription. |
premium_tier_idsoptional | array | The IDs of the premium tiers this subscription is associated with. |
automation_idsoptional | id (picked from your account) | Enroll the subscription into automations after their subscription has been created. |
list_automationsin catalog
List Automations. Retrieves a list of automations for a publication.
| Input | Type | Description |
|---|---|---|
publicationIdrequired | id (picked from your account) | Publication |
limitoptional | number | A limit on the number of automations to be returned (1-100, default 10). |
pageoptional | number | The page number for pagination (default 1). |
add_subscription_to_automation
Add Subscription to Automation. Adds an existing subscription to a specific automation flow.
| Input | Type | Description |
|---|---|---|
publicationIdrequired | id (picked from your account) | Publication |
automationIdrequired | id (picked from your account) | Automation ID |
emailoptional | text | The email address of the subscription. Provide either Email or Subscription ID. |
subscription_idoptional | id (picked from your account) | Subscription ID |
double_opt_overrideoptional | text | Override publication double-opt settings for this subscription (e.g., "on"). |
custom_api_call
Custom API Call. Make a custom API call to a specific endpoint
| Input | Type | Description |
|---|---|---|
urlrequired | object (depends on other props) | url |
methodrequired | one of "GET" | "POST" | "PATCH" | "PUT" | "DELETE" | "HEAD" | Method |
headersrequired | object | Authorization headers are injected automatically from your connection. |
queryParamsrequired | object | Query Parameters |
body_typeoptional | one of "none" | "json" | "form_data" | "raw" | Body Type |
bodyoptional | object (depends on other props) | Body |
response_is_binaryoptional | boolean | Enable for files like PDFs, images, etc. |
failsafeoptional | boolean | No Error on Failure |
timeoutoptional | number | Timeout (in seconds) |
followRedirectsoptional | boolean | Follow redirects |
list_posts
List Posts. Retrieves all posts belonging to a specific publication.
| Input | Type | Description |
|---|---|---|
publicationIdrequired | id (picked from your account) | Publication |
expandoptional | list of | Optionally expand the results by adding additional information. |
audiencerequired | one of "all" | "free" | "premium" | Audience |
platformrequired | one of "all" | "web" | "email" | "both" | Platform |
statusrequired | one of "all" | "draft" | "confirmed" | "archived" | Status |
content_tagsoptional | array | Filter posts by content tags. Returns posts with ANY of the specified tags. |
limitoptional | number | Number of posts to return (1-100, default 10). |
pageoptional | number | Page number for pagination (default 1). |
update_subscription
Update Subscription. Update an existing subscription.
| Input | Type | Description |
|---|---|---|
publicationIdrequired | id (picked from your account) | Publication |
subscriptionIdrequired | id (picked from your account) | Subscription ID |
tieroptional | one of "free" | "premium" | Set the tier for this subscription. |
stripe_customer_idoptional | text | The Stripe Customer ID of the subscription. |
unsubscribeoptional | boolean | Whether to unsubscribe this subscription from the publication. |
custom_fieldsoptional | object (depends on other props) | Custom Fields |
Details
- Id
beehiiv- Category
- Marketing
- Tags
- email, newsletter, publishing, creators
- Package
@activepieces/piece-beehiiv@0.2.4- Tier
- Community