Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to Beehiiv

Scalekit connector
Open markdown

The Beehiiv connector lets your AI agent act in each user's Beehiiv account. Each user connects their own Beehiiv access token once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 60 tools.

Tools
60
What they doRead · write · destructive
38 · 17 · 538 read17 write5 destructive
Users sign in with

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. Create the Beehiiv connection

    In AgentKit > Connections, create a Beehiiv connection. The name you give it is the connection_name your code passes. See Configure connections.

  4. Authorize a user and make your first call

    quickstart.mts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    import { createInterface } from 'node:readline/promises'
    const scalekit = new ScalekitClient(
    process.env.SCALEKIT_ENVIRONMENT_URL,
    process.env.SCALEKIT_CLIENT_ID,
    process.env.SCALEKIT_CLIENT_SECRET,
    )
    const actions = scalekit.actions
    const connector = 'beehiiv'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize Beehiiv:', link)
    const rl = createInterface({ input: process.stdin, output: process.stdout })
    await rl.question('Press Enter after authorizing...')
    rl.close()
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'beehiiv_identify_workspace',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user opens the link once and enters their Beehiiv credentials there. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • beehiiv_get_authorGet one author by id.Read-only

    Get Author

    Get one author by id. Returns the author id, name, bio, image url and social links. Use beehiiv_list_authors to find an author id. Requires a publication_id and an author_id.

    Inputs

    author_idstringrequired
    The author identifier. This accepts a prefixed author ID, full name, or first name. Use beehiiv_list_authors to find IDs. Example: author_00000000-0000-0000-0000-000000000000.
    publication_idstringrequired
    The prefixed ID of the publication object Use beehiiv_list_publications to find IDs. Example: pub_00000000-0000-0000-0000-000000000000.
  • beehiiv_get_automationGet one automation by id.Read-only

    Get Automation

    Get one automation by id. Returns the automation id, name, status, description, trigger events and stats. Use beehiiv_list_automations to find an automation id. Requires a publication_id and an automation_id.

    Inputs

    automation_idstringrequired
    The prefixed ID of the automation object Use beehiiv_list_automations to find IDs. Example: aut_00000000-0000-0000-0000-000000000000.
    publication_idstringrequired
    The prefixed ID of the publication object Use beehiiv_list_publications to find IDs. Example: pub_00000000-0000-0000-0000-000000000000.
    expandstring
    Optional list of expandable objects. Allowed values: stats. Example: stats.one of stats
  • beehiiv_get_automation_journeyGet one subscriber journey within an automation.Read-only

    Get Automation Journey

    Get one subscriber journey within an automation. Returns the journey id, subscription id, email, status and start and completion times. Use beehiiv_list_automation_journeys to find a journey id. Requires an automation_id and a journey_id.

    Inputs

    automation_idstringrequired
    The prefixed ID of the automation object Use beehiiv_list_automations to find IDs. Example: aut_00000000-0000-0000-0000-000000000000.
    journey_idstringrequired
    The prefixed automation journey id Use beehiiv_list_automation_journeys to find IDs. Example: aj_00000000-0000-0000-0000-000000000000.
    publication_idstringrequired
    The prefixed ID of the publication object Use beehiiv_list_publications to find IDs. Example: pub_00000000-0000-0000-0000-000000000000.
  • beehiiv_get_condition_setGet one condition set by id.Read-only

    Get Condition Set

    Get one condition set by id. Returns the condition set id, name, status, purpose, timestamps and stats. Use beehiiv_list_condition_sets to find an id. Requires a publication_id and a condition_set_id.

    Inputs

    condition_set_idstringrequired
    The UUID of the condition set object Use beehiiv_list_condition_sets to find IDs. Example: condition_set_00000000-0000-0000-0000-000000000000.
    publication_idstringrequired
    The prefixed ID of the publication object Use beehiiv_list_publications to find IDs. Example: pub_00000000-0000-0000-0000-000000000000.
    expandstring
    Optionally expand the response to include additional data. stats - Calculates and returns the active subscriber count for this condition set synchronously. Allowed values: stats. This tool sends a single value per call. Example: stats.one of stats
  • beehiiv_get_custom_fieldGet one custom field by id.Read-only

    Get Custom Field

    Get one custom field by id. Returns the field id, kind, display name, creation time and options. Use beehiiv_list_custom_fields to find a field id. Requires a publication_id and a custom_field_id.

    Inputs

    custom_field_idstringrequired
    The ID of the Custom Fields object Use beehiiv_list_custom_fields to find IDs. Example: custom_field_00000000-0000-0000-0000-000000000000.
    publication_idstringrequired
    The prefixed ID of the publication object Use beehiiv_list_publications to find IDs. Example: pub_00000000-0000-0000-0000-000000000000.
  • beehiiv_get_engagementsGet daily or aggregate email engagement metrics for a publication over a date range.Read-only

    Get Publication Engagements

    Get daily or aggregate email engagement metrics for a publication over a date range. Returns opens, unique opens, clicks and unique clicks per period. Use this for engagement trends. Use beehiiv_get_post_aggregate_stats for post-level totals. Use beehiiv_list_publications first to get the publication_id.

    Inputs

    publication_idstringrequired
    The ID of the beehiiv publication this request applies to. Starts with pub_. Use beehiiv_list_publications to find IDs. Example: pub_00000000-0000-0000-0000-000000000000.
    directionstring
    The direction that the results are sorted in. Defaults to asc. asc: Oldest to newest desc: Newest to oldest Allowed values: asc, desc. Example: desc.one of ascdescdefault asc
    email_typestring
    Filter engagement metrics by email type. If omitted, all email engagement is included. post: Only post emails. message: Only automated and system-generated emails. Allowed values: all, post, message. Example: all.one of allpostmessage
    granularitystring
    The granularity at which to report the engagement metrics. Defaults to day if not provided. Allowed values: day, week, month. Example: day.one of dayweekmonth
    number_of_daysinteger
    The number of days to return engagement metrics for, starting from start_date. Must be between 1 and 31. Defaults to 1 if not provided. Example: 7.
    start_datestring
    The starting date for the engagement metrics in YYYY-MM-DD format. Defaults to 1 day ago if not provided. Example: 2025-01-01.
  • beehiiv_get_newsletter_listGet one newsletter list by id.Read-only

    Get Newsletter List

    Get one newsletter list by id. Returns the list id, name, slug, description, status, subscriber count and email settings. Use beehiiv_list_newsletter_lists to find a list id. Requires a publication_id and a newsletter_list_id.

    Inputs

    newsletter_list_idstringrequired
    The prefixed ID of the newsletter list object Use beehiiv_list_newsletter_lists to find IDs. Example: list_00000000-0000-0000-0000-000000000000.
    publication_idstringrequired
    The prefixed ID of the publication object Use beehiiv_list_publications to find IDs. Example: pub_00000000-0000-0000-0000-000000000000.
  • beehiiv_get_pollGet one poll by id.Read-only

    Get Poll

    Get one poll by id. Returns the poll id, name, question, type, status, choices, stats and response totals. Use beehiiv_list_polls to find a poll id. Requires a publication_id and a poll_id.

    Inputs

    poll_idstringrequired
    The prefixed ID of the poll object Use beehiiv_list_polls to find IDs. Example: poll_00000000-0000-0000-0000-000000000000.
    publication_idstringrequired
    The prefixed ID of the publication object Use beehiiv_list_publications to find IDs. Example: pub_00000000-0000-0000-0000-000000000000.
    expandstring
    Optionally expand the response to include additional data. stats - Returns aggregate vote counts per choice and total completions. poll_responses - Returns up to 10 most recent subscriber responses. Use /polls/{pollId}/responses for paginated access to all responses. trivia_answer - Returns the correct answer for trivia-type polls. Allowed values: stats, poll_responses, trivia_answer. This tool sends a single value per call. Example: stats.one of statspoll_responsestrivia_answer