beehiiv

Create subscribers, list publications, and manage your newsletter on beehiiv.

MarketingAPI key6 actionsAll integrations

On this page
  1. Connect
  2. Call it from a workflow
  3. Actions (6)
  4. create_subscription
  5. list_automations
  6. add_subscription_to_automation
  7. custom_api_call
  8. list_posts
  9. update_subscription
  10. Details

Connect

Auth type: API key (secret_text). Pass the provider's API key or token as the connection's credential. It is sealed at rest and only opened on the server when an action runs.

  • From your agent: integrations {action: "connect", piece, credentials, env} stores the credentials for dev, prod or all. Answers name the fields, never the values.
  • Or set the integration's project secrets with the secrets tool (SLACK_BOT_TOKEN, DISCORD_WEBHOOK_URL, TELEGRAM_BOT_TOKEN, TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN …): a call uses the connection, else those secrets. integrations {action: "catalog", piece} lists which ones work.
  • Try one action now with integrations {action: "call", piece, piece_action, input}. It really sends.

Call it from a workflow

step.ctx.integrations.invoke("beehiiv", action, input) resolves with the provider's answer and rejects when beehiiv isn't connected or refuses. Wrap it in step.run so a retry sends once. See step.ctx. Its actions run through the integration runner, which the server's operator turns on: integrations {action: "catalog", piece: "beehiiv"} says whether yours can call it.

Workflow
// workflows/notify.ts: call beehiiv when a booking is confirmed
import { on } from "@appbricx/workflows";

export const tellBeehiiv = on.transition("booking", "status", "confirmed", async (_event, step) => {
  // Recorded once: a retry doesn't send it twice. Rejects when beehiiv isn't connected.
  const output = await step.run("beehiiv", () =>
    step.ctx.integrations.invoke("beehiiv", "create_subscription", {
      "publicationId": "<publicationId>",
      "email": "<email>"
    }),
  );
  step.ctx.log("beehiiv answered", output);
});
Try it from your agent
{
  "name": "integrations",
  "arguments": {
    "project_id": "<project-id>",
    "action": "call",
    "piece": "beehiiv",
    "piece_action": "create_subscription",
    "input": {
      "publicationId": "<publicationId>",
      "email": "<email>"
    },
    "env": "dev"
  }
}
From another backend (connector proxy)
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_subscription

Create Subscription. Creates a new subscription.

InputTypeDescription
publicationIdrequiredid (picked from your account)Publication
emailrequiredtextThe email address of the new subscription.
reactivate_existingoptionalbooleanWhether to reactivate the subscription if they have already unsubscribed. Use only if the subscription is knowingly resubscribing.
send_welcome_emailoptionalbooleanWhether to send the default welcome email to the subscription.
utm_sourceoptionaltextThe source of the subscription.
utm_mediumoptionaltextThe medium of the subscription.
utm_campaignoptionaltextThe acquisition campaign of the subscription.
referring_siteoptionaltextThe website that the subscription was referred from.
referral_codeoptionaltextA subscription's referral_code to give them credit for the new subscription.
tieroptionalone of "free" | "premium"The tier for this subscription.
custom_fieldsoptionalobject (depends on other props)Custom Fields
stripe_customer_idoptionaltextThe Stripe customer ID for this subscription.
double_opt_overrideoptionaltextOverride publication double-opt settings for this subscription.
premium_tier_idsoptionalarrayThe IDs of the premium tiers this subscription is associated with.
automation_idsoptionalid (picked from your account)Enroll the subscription into automations after their subscription has been created.

list_automations

List Automations. Retrieves a list of automations for a publication.

InputTypeDescription
publicationIdrequiredid (picked from your account)Publication
limitoptionalnumberA limit on the number of automations to be returned (1-100, default 10).
pageoptionalnumberThe page number for pagination (default 1).

add_subscription_to_automation

Add Subscription to Automation. Adds an existing subscription to a specific automation flow.

InputTypeDescription
publicationIdrequiredid (picked from your account)Publication
automationIdrequiredid (picked from your account)Automation ID
emailoptionaltextThe email address of the subscription. Provide either Email or Subscription ID.
subscription_idoptionalid (picked from your account)Subscription ID
double_opt_overrideoptionaltextOverride 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

InputTypeDescription
urlrequiredobject (depends on other props)url
methodrequiredone of "GET" | "POST" | "PATCH" | "PUT" | "DELETE" | "HEAD"Method
headersrequiredobjectAuthorization headers are injected automatically from your connection.
queryParamsrequiredobjectQuery Parameters
body_typeoptionalone of "none" | "json" | "form_data" | "raw"Body Type
bodyoptionalobject (depends on other props)Body
response_is_binaryoptionalbooleanEnable for files like PDFs, images, etc.
failsafeoptionalbooleanNo Error on Failure
timeoutoptionalnumberTimeout (in seconds)
followRedirectsoptionalbooleanFollow redirects

list_posts

List Posts. Retrieves all posts belonging to a specific publication.

InputTypeDescription
publicationIdrequiredid (picked from your account)Publication
expandoptionallist ofOptionally expand the results by adding additional information.
audiencerequiredone of "all" | "free" | "premium"Audience
platformrequiredone of "all" | "web" | "email" | "both"Platform
statusrequiredone of "all" | "draft" | "confirmed" | "archived"Status
content_tagsoptionalarrayFilter posts by content tags. Returns posts with ANY of the specified tags.
limitoptionalnumberNumber of posts to return (1-100, default 10).
pageoptionalnumberPage number for pagination (default 1).

update_subscription

Update Subscription. Update an existing subscription.

InputTypeDescription
publicationIdrequiredid (picked from your account)Publication
subscriptionIdrequiredid (picked from your account)Subscription ID
tieroptionalone of "free" | "premium"Set the tier for this subscription.
stripe_customer_idoptionaltextThe Stripe Customer ID of the subscription.
unsubscribeoptionalbooleanWhether to unsubscribe this subscription from the publication.
custom_fieldsoptionalobject (depends on other props)Custom Fields

Details

Id
beehiiv
Category
Marketing
Tags
email, newsletter, publishing, creators
Package
@activepieces/piece-beehiiv@0.2.4
Runs
Through the integration runner