client.automationJourneys.create(publicationId, automationId, { ...params }) -> Beehiiv.AutomationJourneysResponse
-
-
-
Add an existing subscription to an automation flow. Requires the automation to have an active Add by API trigger. The specified
email
orsubscription_id
will be matched against your existing subscribers. If an existing subscriber is found, they will be enrolled immediately.
Looking to enroll new subscribers? Use the Create Subscription endpoint instead and specify theautomation_ids
param.
-
-
-
await client.automationJourneys.create( "pub_00000000-0000-0000-0000-000000000000", "aut_00000000-0000-0000-0000-000000000000", { email: "[email protected]", doubleOptOverride: "on", } );
-
-
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
automationId:
Beehiiv.AutomationId
β The prefixed ID of the automation object
-
request:
Beehiiv.AutomationJourneysCreateRequest
-
requestOptions:
AutomationJourneys.RequestOptions
-
-
client.automationJourneys.index(publicationId, automationId) -> Beehiiv.AutomationJourneysIndexResponse
-
-
-
Retrieve a list of automation journeys that have occurred within a specific automation.
-
-
-
await client.automationJourneys.index( "pub_00000000-0000-0000-0000-000000000000", "aut_00000000-0000-0000-0000-000000000000" );
-
-
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
automationId:
Beehiiv.AutomationId
β The prefixed ID of the automation object
-
requestOptions:
AutomationJourneys.RequestOptions
-
-
client.automationJourneys.show(publicationId, automationId, automationJourneyId) -> Beehiiv.AutomationJourneysResponse
-
-
-
Retrieve a single automation journey by ID.
-
-
-
await client.automationJourneys.show( "pub_00000000-0000-0000-0000-000000000000", "aut_00000000-0000-0000-0000-000000000000", "aj_00000000-0000-0000-0000-000000000000" );
-
-
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
automationId:
Beehiiv.AutomationId
β The prefixed ID of the automation object
-
automationJourneyId:
Beehiiv.AutomationJourneyId
β The prefixed automation journey id
-
requestOptions:
AutomationJourneys.RequestOptions
-
-
client.automations.index(publicationId, { ...params }) -> Beehiiv.AutomationsListResponse
-
-
-
await client.automations.index("pub_00000000-0000-0000-0000-000000000000");
-
-
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
request:
Beehiiv.AutomationsListRequest
-
requestOptions:
Automations.RequestOptions
-
-
client.automations.show(publicationId, automationId) -> Beehiiv.AutomationsGetResponse
-
-
-
await client.automations.show("pub_00000000-0000-0000-0000-000000000000", "aut_00000000-0000-0000-0000-000000000000");
-
-
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
automationId:
Beehiiv.AutomationId
β The prefixed ID of the automation object
-
requestOptions:
Automations.RequestOptions
-
-
client.bulkSubscriptionUpdates.index(publicationId) -> Beehiiv.BulkSubscriptionUpdatesListResponse
-
-
-
Returns a list of Subscription Update objects for a publication.
-
-
-
await client.bulkSubscriptionUpdates.index("publicationId");
-
-
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
requestOptions:
BulkSubscriptionUpdates.RequestOptions
-
-
client.bulkSubscriptionUpdates.show(publicationId, id) -> Beehiiv.BulkSubscriptionUpdatesGetResponse
-
-
-
Returns a single Subscription Update object for a publication.
-
-
-
await client.bulkSubscriptionUpdates.show("publicationId", "id");
-
-
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
id:
string
β The ID of the Subscription Update object
-
requestOptions:
BulkSubscriptionUpdates.RequestOptions
-
-
client.bulkSubscriptionUpdates.put(publicationId, { ...params }) -> Beehiiv.SubscriptionsPatchResponse
-
-
-
Bulk update multiple subscriptions fields, including status, custom fields, and tiers.
-
-
-
await client.bulkSubscriptionUpdates.put("publicationId", { subscriptions: [ { subscriptionId: "sub_1234-5678-9012-3456-7890", tier: "premium", stripeCustomerId: "cus_1234567890", unsubscribe: false, customFields: [ { name: "custom_field_name", value: "custom_field_value", }, { name: "custom_field_name_2", value: "custom_field_value_2", }, ], }, { subscriptionId: "sub_9876-5432-1098-7654-3210", tier: "free", stripeCustomerId: "cus_1234567890", unsubscribe: true, customFields: [ { name: "custom_field_name_3", value: "custom_field_value_3", }, { name: "custom_field_name_4", value: "custom_field_value_4", }, ], }, ], });
-
-
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
request:
Beehiiv.BulkSubscriptionsPutRequest
-
requestOptions:
BulkSubscriptionUpdates.RequestOptions
-
-
client.bulkSubscriptionUpdates.patch(publicationId, { ...params }) -> Beehiiv.SubscriptionsPatchResponse
-
-
-
Bulk update multiple subscriptions fields, including status, custom fields, and tiers.
-
-
-
await client.bulkSubscriptionUpdates.patch("publicationId", { subscriptions: [ { subscriptionId: "sub_1234-5678-9012-3456-7890", tier: "premium", stripeCustomerId: "cus_1234567890", unsubscribe: false, customFields: [ { name: "custom_field_name", value: "custom_field_value", }, { name: "custom_field_name_2", value: "custom_field_value_2", }, ], }, { subscriptionId: "sub_9876-5432-1098-7654-3210", tier: "free", stripeCustomerId: "cus_1234567890", unsubscribe: true, customFields: [ { name: "custom_field_name_3", value: "custom_field_value_3", }, { name: "custom_field_name_4", value: "custom_field_value_4", }, ], }, ], });
-
-
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
request:
Beehiiv.BulkSubscriptionsPatchRequest
-
requestOptions:
BulkSubscriptionUpdates.RequestOptions
-
-
client.bulkSubscriptionUpdates.putStatus(publicationId, { ...params }) -> void
-
-
-
Bulk update subscriptions' status.
-
-
-
await client.bulkSubscriptionUpdates.putStatus("publicationId", { subscriptionIds: ["sub_1234-5678-9012-3456-7890", "sub_9876-5432-1098-7654-3210"], newStatus: "active", });
-
-
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
request:
Beehiiv.BulkSubscriptionsStatusPutRequest
-
requestOptions:
BulkSubscriptionUpdates.RequestOptions
-
-
client.bulkSubscriptionUpdates.patchStatus(publicationId, { ...params }) -> void
-
-
-
Bulk update subscriptions' status.
-
-
-
await client.bulkSubscriptionUpdates.patchStatus("publicationId", { subscriptionIds: ["sub_1234-5678-9012-3456-7890", "sub_9876-5432-1098-7654-3210"], newStatus: "active", });
-
-
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
request:
Beehiiv.BulkSubscriptionsStatusPatchRequest
-
requestOptions:
BulkSubscriptionUpdates.RequestOptions
-
-
client.customFields.create(publicationId, { ...params }) -> Beehiiv.CustomFieldResponse
-
-
-
Create a custom field on a publication, for use in subscriptions
-
-
-
await client.customFields.create("publicationId", { kind: "string", display: "Display", });
-
-
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
request:
Beehiiv.CustomFieldsCreateRequest
-
requestOptions:
CustomFields.RequestOptions
-
-
client.customFields.show(publicationId, id) -> Beehiiv.CustomFieldResponse
-
-
-
View a specific custom field on a publication
-
-
-
await client.customFields.show("publicationId", "id");
-
-
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
id:
string
β The ID of the Custom Fields object
-
requestOptions:
CustomFields.RequestOptions
-
-
client.customFields.index(publicationId) -> Beehiiv.CustomFieldIndexResponse
-
-
-
List all custom fields on a publication
-
-
-
await client.customFields.index("publicationId");
-
-
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
requestOptions:
CustomFields.RequestOptions
-
-
client.customFields.put(publicationId, id, { ...params }) -> Beehiiv.CustomFieldResponse
-
-
-
Update a custom field on a publication
-
-
-
await client.customFields.put("publicationId", "id", { display: "New Display", });
-
-
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
id:
string
β The ID of the Custom Fields object
-
request:
Beehiiv.CustomFieldsPutRequest
-
requestOptions:
CustomFields.RequestOptions
-
-
client.customFields.patch(publicationId, id, { ...params }) -> Beehiiv.CustomFieldsPatchResponse
-
-
-
Update a custom field on a publication
-
-
-
await client.customFields.patch("publicationId", "id", { display: "New Display", });
-
-
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
id:
string
β The ID of the Custom Fields object
-
request:
Beehiiv.CustomFieldsPatchRequest
-
requestOptions:
CustomFields.RequestOptions
-
-
client.customFields.delete(publicationId, id) -> Beehiiv.CustomFieldsDeleteResponse
-
-
-
Delete a custom field from a publication
-
-
-
await client.customFields.delete("publicationId", "id");
-
-
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
id:
string
β The ID of the Custom Fields object
-
requestOptions:
CustomFields.RequestOptions
-
-
client.emailBlasts.index(publicationId, { ...params }) -> Beehiiv.EmailBlastsListResponse
-
-
-
Retrieve all email blasts belonging to a specific publication
-
-
-
await client.emailBlasts.index("pub_00000000-0000-0000-0000-000000000000");
-
-
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
request:
Beehiiv.EmailBlastsListRequest
-
requestOptions:
EmailBlasts.RequestOptions
-
-
client.emailBlasts.show(publicationId, emailBlastId, { ...params }) -> Beehiiv.EmailBlastsGetResponse
-
-
-
Retrieve a single email blast belonging to a specific publication
-
-
-
await client.emailBlasts.show("pub_00000000-0000-0000-0000-000000000000", "blast_00000000-0000-0000-0000-000000000000");
-
-
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
emailBlastId:
Beehiiv.EmailBlastId
β The prefixed ID of the email blast object
-
request:
Beehiiv.EmailBlastsGetRequest
-
requestOptions:
EmailBlasts.RequestOptions
-
-
client.posts.create(publicationId, { ...params }) -> Beehiiv.PostsCreateResponse
-
-
-
This feature is currently in beta, the API is subject to change, and available only to Enterprise users.
To inquire about Enterprise pricing, please visit our Enterprise page. Create a post for a specific publication.
-
This feature is currently in beta, the API is subject to change, and available only to Enterprise users.
-
-
await client.posts.create("pub_00000000-0000-0000-0000-000000000000", { title: "The Kitchen Sink Post (refactored version)", subtitle: "Contains lots of examples of each block type and the various settings you could use", blocks: [ { type: "heading", level: "2", textAlignment: "center", text: "This is my block!!!", anchorHeader: false, anchorIncludeInToc: false, }, { type: "list", listType: "ordered", items: ["a", "b", "c"], }, { type: "list", listType: "ordered", items: ["d", "e", "f"], startNumber: 4, }, { type: "list", listType: "unordered", items: ["g", "h", "i"], startNumber: 4, }, { type: "table", headerRow: true, headerColumn: true, rows: [ [ { text: "A", }, { text: "B", alignment: "center", }, { text: "C", alignment: "right", }, ], [ { text: "D", alignment: "right", }, { text: "E", alignment: "center", }, { text: "F", alignment: "left", }, ], ], }, { type: "table", rows: [ [ { text: "A", }, { text: "B", }, { text: "C", }, ], [ { text: "D", }, { text: "E", }, { text: "F", }, ], ], }, { type: "table", headerRow: false, rows: [ [ { text: "A", }, { text: "B", }, { text: "C", }, ], [ { text: "D", }, { text: "E", }, { text: "F", }, ], ], }, { type: "columns", columns: [ { blocks: [ { type: "paragraph", plaintext: "Marble Column 1 {{email}}", }, ], }, { blocks: [ { type: "image", imageUrl: "https://cdn.britannica.com/89/164789-050-D6B5E2C7/Barack-Obama-2012.jpg", url: "https://www.whitehouse.gov/", title: "Barry O", altText: "A picture of Barry Obama", caption: "One Cool President", captionAlignment: "center", imageAlignment: "right", width: 75, }, ], }, ], }, { type: "advertisement", opportunityId: "d8dfa6be-24b5-4cad-8350-ae44366dbd4c", }, { type: "image", imageUrl: "https://cdn.britannica.com/89/164789-050-D6B5E2C7/Barack-Obama-2012.jpg", url: "https://www.whitehouse.gov/", title: "Barry O", altText: "A picture of Barry Obama", caption: "One Cool President", captionAlignment: "center", imageAlignment: "right", width: 75, }, { type: "paragraph", formattedText: [ { text: "This is going to be ", }, { text: "a really, really awesome time ", styling: ["bold"], }, { text: "Are you ready for this?", styling: ["italic", "bold"], }, ], }, { type: "button", href: "/subscribe", target: "_blank", alignment: "center", size: "large", text: "Subscribe", }, { type: "button", href: "/signup", target: "_blank", alignment: "right", size: "small", text: "Sign Up", }, { type: "button", href: "/", target: "_blank", text: "View Posts", }, { type: "heading", level: "4", textAlignment: "right", text: "This is my block!!!", anchorHeader: true, anchorIncludeInToc: true, }, ], postTemplateId: "post_template_00000000-0000-0000-0000-000000000000", scheduledAt: "2024-12-25T12:00:00Z", customLinkTrackingEnabled: true, emailCaptureTypeOverride: "none", overrideScheduledAt: "2022-10-26T14:01:16Z", socialShare: "comments_and_likes_only", thumbnailImageUrl: "https://images.squarespace-cdn.com/content/v1/56e4ca0540261d39b90e4b18/1605047208324-PONGEYKEAKTMM1LANHJ5/1ED706BF-A70B-4F26-B3D5-266B449DDA8A_1_105_c.jpeg", emailSettings: { fromAddress: "from_address", customLiveUrl: "https://beehiiv.com", displayTitleInEmail: true, displayBylineInEmail: true, displaySubtitleInEmail: true, emailHeaderEngagementButtons: "email_header_engagement_buttons", emailHeaderSocialShare: "email_header_social_share", emailPreviewText: "email_preview_text", emailSubjectLine: "email_subject_line", }, webSettings: { displayThumbnailOnWeb: true, hideFromFeed: true, slug: "and-this-is-gonna-rock", }, seoSettings: { defaultDescription: "default_description", defaultTitle: "default_title", ogDescription: "OpenGraph description", ogTitle: "Opengraph Title", twitterDescription: "Twitter Stuff", twitterTitle: "My Twitter Article", }, contentTags: ["Obama", "Care", "Rocks", "Healthcare"], recipients: { web: { tierIds: ["premium"], }, email: { tierIds: ["premium", "free"], includeSegmentIds: ["seg_6426b403-39f5-42bd-86e9-9533fb0099e7"], excludeSegmentIds: ["seg_e34b4085-aef6-449f-a699-7563f915f852"], }, }, });
-
-
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
request:
Beehiiv.PostsCreateRequest
-
requestOptions:
Posts.RequestOptions
-
-
client.posts.index(publicationId, { ...params }) -> Beehiiv.PostsListResponse
-
-
-
Retrieve all posts belonging to a specific publication
-
-
-
await client.posts.index("pub_00000000-0000-0000-0000-000000000000");
-
-
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
request:
Beehiiv.PostsListRequest
-
requestOptions:
Posts.RequestOptions
-
-
client.posts.show(postId, publicationId, { ...params }) -> Beehiiv.PostsGetResponse
-
-
-
Retreive a single Post belonging to a specific publication
-
-
-
await client.posts.show("post_00000000-0000-0000-0000-000000000000", "pub_00000000-0000-0000-0000-000000000000");
-
-
-
postId:
Beehiiv.PostId
β The prefixed ID of the post object
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
request:
Beehiiv.PostsGetRequest
-
requestOptions:
Posts.RequestOptions
-
-
client.posts.delete(postId, publicationId) -> Beehiiv.PostsDeleteResponse
-
-
-
Delete or Archive a post. Any post that has been confirmed will have it's status changed to
archived
. Posts in thedraft
status will be permenantly deleted.
-
-
-
await client.posts.delete("post_00000000-0000-0000-0000-000000000000", "pub_00000000-0000-0000-0000-000000000000");
-
-
-
postId:
Beehiiv.PostId
β The prefixed ID of the post object
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
requestOptions:
Posts.RequestOptions
-
-
client.publications.index({ ...params }) -> Beehiiv.PublicationsListResponse
-
-
-
Retrieve all publications associated with your API key.
-
-
-
await client.publications.index();
-
-
-
request:
Beehiiv.PublicationsListRequest
-
requestOptions:
Publications.RequestOptions
-
-
client.publications.show(publicationId, { ...params }) -> Beehiiv.PublicationsGetResponse
-
-
-
Retrieve a single publication
-
-
-
await client.publications.show("pub_ad76629e-4a39-43ad-8055-0ee89dc6db15");
-
-
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
request:
Beehiiv.PublicationsGetRequest
-
requestOptions:
Publications.RequestOptions
-
-
client.referralProgram.show(publicationId, { ...params }) -> Beehiiv.ReferralProgramGetResponse
-
-
-
Retrieve details about the publication's referral program, including milestones and rewards.
-
-
-
await client.referralProgram.show("pub_00000000-0000-0000-0000-000000000000");
-
-
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
request:
Beehiiv.ReferralProgramGetRequest
-
requestOptions:
ReferralProgram.RequestOptions
-
-
client.segments.index(publicationId, { ...params }) -> Beehiiv.SegmentsListResponse
-
-
-
Retrieve information about all segments belonging to a specific publication
-
-
-
await client.segments.index("pub_00000000-0000-0000-0000-000000000000");
-
-
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
request:
Beehiiv.SegmentsListRequest
-
requestOptions:
Segments.RequestOptions
-
-
client.segments.show(publicationId, segmentId, { ...params }) -> Beehiiv.SegmentShowResponse
-
-
-
Retrieve information about a specific segment belonging to a publication
-
-
-
await client.segments.show("pub_00000000-0000-0000-0000-000000000000", "seg_00000000-0000-0000-0000-000000000000");
-
-
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
segmentId:
Beehiiv.SegmentId
β The prefixed ID of the segment object
-
request:
Beehiiv.SegmentsShowRequest
-
requestOptions:
Segments.RequestOptions
-
-
client.segments.expandResults(publicationId, segmentId, { ...params }) -> Beehiiv.SegmentsGetResponse
-
-
-
List the Subscriber Ids from the most recent calculation of a specific publication.
-
-
-
await client.segments.expandResults( "pub_00000000-0000-0000-0000-000000000000", "seg_00000000-0000-0000-0000-000000000000" );
-
-
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
segmentId:
Beehiiv.SegmentId
β The prefixed ID of the segment object
-
request:
Beehiiv.SegmentsGetRequest
-
requestOptions:
Segments.RequestOptions
-
-
client.segments.delete(publicationId, segmentId) -> Beehiiv.SegmentDeleteResponse
-
-
-
Delete a segment. Deleting the segment does not effect the subscriptions in the segment.
-
-
-
await client.segments.delete("pub_00000000-0000-0000-0000-000000000000", "seg_00000000-0000-0000-0000-000000000000");
-
-
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
segmentId:
Beehiiv.SegmentId
β The prefixed ID of the segment object
-
requestOptions:
Segments.RequestOptions
-
-
client.subscriptions.create(publicationId, { ...params }) -> Beehiiv.SubscriptionResponse
-
-
-
Create new subscriptions for a publication.
-
-
-
await client.subscriptions.create("pub_00000000-0000-0000-0000-000000000000", { email: "[email protected]", reactivateExisting: false, sendWelcomeEmail: false, utmSource: "WayneEnterprise", utmMedium: "organic", utmCampaign: "fall_2022_promotion", referringSite: "www.wayneenterprise.com/blog", customFields: [ { name: "First Name", value: "Bruce", }, { name: "Last Name", value: "Wayne", }, ], stripeCustomerId: "stripe_customer_id", });
-
-
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
request:
Beehiiv.SubscriptionsCreateRequest
-
requestOptions:
Subscriptions.RequestOptions
-
-
client.subscriptions.index(publicationId, { ...params }) -> Beehiiv.SubscriptionsListResponse
-
-
-
Retrieve all subscriptions belonging to a specific publication
-
-
-
await client.subscriptions.index("pub_00000000-0000-0000-0000-000000000000", { email: "[email protected]", });
-
-
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
request:
Beehiiv.SubscriptionsListRequest
-
requestOptions:
Subscriptions.RequestOptions
-
-
client.subscriptions.getByEmail(publicationId, email, { ...params }) -> Beehiiv.SubscriptionResponse
-
-
-
Please note that this endpoint requires the email to be URL encoded. Please reference your language's documentation for the correct method of encoding. Retrieve a single subscription belonging to a specific email address in a specific publication.
-
-
-
await client.subscriptions.getByEmail("pub_00000000-0000-0000-0000-000000000000", "[email protected]");
-
-
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
email:
string
β The ID of the subscriber object
-
request:
Beehiiv.SubscriptionsGetRequest
-
requestOptions:
Subscriptions.RequestOptions
-
-
client.subscriptions.getById(publicationId, subscriptionId, { ...params }) -> Beehiiv.SubscriptionResponse
-
-
-
In previous versions of the API, another endpoint existed to retrieve a subscription by the subscriber ID. This endpoint is now deprecated and will be removed in a future version of the API. Please use this endpoint instead. The subscription ID can be found by exporting a list of subscriptions either via the
Settings > Publications > Export Data
or by exporting a CSV in a segment. Retrieve a single subscription belonging to a specific publication.
-
-
-
await client.subscriptions.getById( "pub_00000000-0000-0000-0000-000000000000", "sub_00000000-0000-0000-0000-000000000000" );
-
-
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
subscriptionId:
Beehiiv.SubscriptionId
β The prefixed ID of the subscription object
-
request:
Beehiiv.SubscriptionsGetByIdRequest
-
requestOptions:
Subscriptions.RequestOptions
-
-
client.subscriptions.getBySubscriberId(publicationId, subscriberId, { ...params }) -> Beehiiv.SubscriptionResponse
-
-
-
Retrieve a single subscription belonging to a specific publication via the subscriber ID.
-
-
-
await client.subscriptions.getBySubscriberId( "pub_00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000000" );
-
-
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
subscriberId:
string
β The ID of the subscriber object
-
request:
Beehiiv.SubscriptionsGetBySubscriberIdRequest
-
requestOptions:
Subscriptions.RequestOptions
-
-
client.subscriptions.getJwtToken(publicationId, subscriptionId) -> Beehiiv.SubscriptionJwtTokenResponse
-
-
-
Generate a JWT token that can be used to automatically log in subscribers via URL. This token is short lived and should be used immediately.
-
-
-
await client.subscriptions.getJwtToken( "pub_00000000-0000-0000-0000-000000000000", "sub_00000000-0000-0000-0000-000000000000" );
-
-
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
subscriptionId:
Beehiiv.SubscriptionId
β The prefixed ID of the subscription object
-
requestOptions:
Subscriptions.RequestOptions
-
-
client.subscriptions.put(publicationId, subscriptionId, { ...params }) -> Beehiiv.SubscriptionResponse
-
-
-
Update a single subscription.
-
-
-
await client.subscriptions.put("pub_00000000-0000-0000-0000-000000000000", "sub_00000000-0000-0000-0000-000000000000", { tier: "premium", stripeCustomerId: "cus_12345abcde", customFields: [ { name: "First Name", value: "Bruce", }, { name: "Last Name", value: "Wayne", }, ], });
-
-
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
subscriptionId:
Beehiiv.SubscriptionId
β The prefixed ID of the subscription object
-
request:
Beehiiv.SubscriptionsUpdateRequest
-
requestOptions:
Subscriptions.RequestOptions
-
-
client.subscriptions.patch(publicationId, subscriptionId, { ...params }) -> Beehiiv.SubscriptionResponse
-
-
-
Update a single subscription.
-
-
-
await client.subscriptions.patch( "pub_00000000-0000-0000-0000-000000000000", "sub_00000000-0000-0000-0000-000000000000", { tier: "premium", stripeCustomerId: "cus_12345abcde", customFields: [ { name: "First Name", value: "Bruce", }, { name: "Last Name", value: "Wayne", }, ], } );
-
-
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
subscriptionId:
Beehiiv.SubscriptionId
β The prefixed ID of the subscription object
-
request:
Beehiiv.SubscriptionsPatchSingleRequest
-
requestOptions:
Subscriptions.RequestOptions
-
-
client.subscriptions.delete(subscriptionId, publicationId) -> Beehiiv.SubscriptionDeleteResponse
-
-
-
This cannot be undone. All data associated with the subscription will also be deleted. We recommend unsubscribing when possible instead of deleting.
If a premium subscription is deleted they will no longer be billed. Deletes a subscription.
-
-
-
await client.subscriptions.delete( "sub_00000000-0000-0000-0000-000000000000", "pub_00000000-0000-0000-0000-000000000000" );
-
-
-
subscriptionId:
Beehiiv.SubscriptionId
β The prefixed ID of the subscription object
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
requestOptions:
Subscriptions.RequestOptions
-
-
client.subscriptionTags.create(publicationId, subscriptionId, { ...params }) -> Beehiiv.SubscriptionTagsCreateResponse
-
-
-
Adds tags to a subscription. If the tag does not exist on the publication, it will be created automatically.
-
-
-
await client.subscriptionTags.create("publicationId", "subscriptionId");
-
-
-
publicationId:
Beehiiv.PublicationId
-
subscriptionId:
Beehiiv.SubscriptionId
-
request:
Beehiiv.SubscriptionTagsCreateRequest
-
requestOptions:
SubscriptionTags.RequestOptions
-
-
client.tiers.create(publicationId, { ...params }) -> Beehiiv.TierResponse
-
-
-
Create a new tier for a publication.
-
-
-
await client.tiers.create("pub_00000000-0000-0000-0000-000000000000", { name: "Gold Tier", description: "Our premium tier with exclusive benefits", pricesAttributes: [ { currency: "usd", amountCents: 500, enabled: true, interval: "month", intervalDisplay: "Monthly", cta: "Subscribe Now", features: ["Exclusive content", "Ad-free experience", "Priority support"], }, ], });
-
-
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
request:
Beehiiv.PostPublicationsPublicationIdTiersRequest
-
requestOptions:
Tiers.RequestOptions
-
-
client.tiers.index(publicationId, { ...params }) -> Beehiiv.IndexTiersResponse
-
-
-
Retrieve all tiers belonging to a specific publication
-
-
-
await client.tiers.index("pub_00000000-0000-0000-0000-000000000000");
-
-
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
request:
Beehiiv.GetPublicationsPublicationIdTiersRequest
-
requestOptions:
Tiers.RequestOptions
-
-
client.tiers.show(publicationId, tierId, { ...params }) -> Beehiiv.TierResponse
-
-
-
Retrieve a single tier belonging to a specific publication
-
-
-
await client.tiers.show("pub_00000000-0000-0000-0000-000000000000", "tier_00000000-0000-0000-0000-000000000000");
-
-
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
tierId:
Beehiiv.TierId
β The prefixed ID of the tier object
-
request:
Beehiiv.GetPublicationsPublicationIdTiersTierIdRequest
-
requestOptions:
Tiers.RequestOptions
-
-
client.tiers.put(publicationId, tierId, { ...params }) -> Beehiiv.TierResponse
-
-
-
Update an existing tier belonging to a specific publication
-
-
-
await client.tiers.put("pub_00000000-0000-0000-0000-000000000000", "tier_00000000-0000-0000-0000-000000000000", { name: "Gold", description: "Our premium tier with exclusive benefits", pricesAttributes: [ { id: "price_00000000-0000-0000-0000-000000000000", currency: "usd", amountCents: 500, interval: "month", intervalDisplay: "Monthly", cta: "Subscribe Now", features: ["Exclusive content"], delete: true, }, ], });
-
-
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
tierId:
Beehiiv.TierId
β The prefixed ID of the tier object
-
request:
Beehiiv.UpdatePutTierRequest
-
requestOptions:
Tiers.RequestOptions
-
-
client.tiers.patch(publicationId, tierId, { ...params }) -> Beehiiv.TierResponse
-
-
-
Update an existing tier belonging to a specific publication
-
-
-
await client.tiers.patch("pub_00000000-0000-0000-0000-000000000000", "tier_00000000-0000-0000-0000-000000000000", { name: "Gold", description: "Our premium tier with exclusive benefits", pricesAttributes: [ { id: "price_00000000-0000-0000-0000-000000000000", currency: "usd", amountCents: 500, interval: "month", intervalDisplay: "Monthly", cta: "Subscribe Now", features: ["Exclusive content"], delete: true, }, ], });
-
-
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
tierId:
Beehiiv.TierId
β The prefixed ID of the tier object
-
request:
Beehiiv.UpdatePatchTierRequest
-
requestOptions:
Tiers.RequestOptions
-
-
client.webhooks.create(publicationId, { ...params }) -> Beehiiv.WebhookResponse
-
-
-
Create a new webhook for a given publication.
-
-
-
await client.webhooks.create("pub_00000000-0000-0000-0000-000000000000", { url: "https://example.com/webhook", eventTypes: ["post.sent"], });
-
-
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
request:
Beehiiv.PostWebhooksRequest
-
requestOptions:
Webhooks.RequestOptions
-
-
client.webhooks.index(publicationId, { ...params }) -> Beehiiv.IndexWebhooksResponse
-
-
-
Retrieve all webhooks belonging to a specific publication.
-
-
-
await client.webhooks.index("pub_00000000-0000-0000-0000-000000000000");
-
-
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
request:
Beehiiv.GetWebhooksRequest
-
requestOptions:
Webhooks.RequestOptions
-
-
client.webhooks.show(publicationId, endpointId) -> Beehiiv.WebhookResponse
-
-
-
Retrieve a specific webhook belonging to a publication.
-
-
-
await client.webhooks.show("pub_00000000-0000-0000-0000-000000000000", "ep_0000000000000000000000000000");
-
-
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
endpointId:
Beehiiv.EndpointId
β The prefixed ID of the webhook object
-
requestOptions:
Webhooks.RequestOptions
-
-
client.webhooks.delete(publicationId, endpointId) -> Beehiiv.WebhooksDeleteResponse
-
-
-
Delete a webhook subscription from a publication.
-
-
-
await client.webhooks.delete("pub_00000000-0000-0000-0000-000000000000", "ep_0000000000000000000000000000");
-
-
-
publicationId:
Beehiiv.PublicationId
β The prefixed ID of the publication object
-
endpointId:
Beehiiv.EndpointId
β The prefixed ID of the webhook object
-
requestOptions:
Webhooks.RequestOptions
-
-
client.webhooks.test(publicationId, endpointId) -> Beehiiv.GetPublicationsPublicationIdWebhooksWebhookIdTestsResponse
-
-
-
Send test info to an already set up webhook endpoint.
-
-
-
await client.webhooks.test("pub_00000000-0000-0000-0000-000000000000", "ep_0000000000000000000000000000");
-
-
-
publicationId:
string
β The prefixed ID of the publication object
-
endpointId:
Beehiiv.EndpointId
β The prefixed ID of the webhook object
-
requestOptions:
Webhooks.RequestOptions
-
-