# beehiiv

Manage beehiiv newsletters: publications, posts, subscribers, segments, automations. Exposes **34 actions** covering the full API surface
the agent needs - read and write.

## What it can do

| Method | What it does |
| --- | --- |
| `beehiiv_get_publication` | Get publication (newsletter) info - GET /publications/&#123;id&#125;. |
| `beehiiv_list_subscribers` | List newsletter subscribers - GET /publications/&#123;id&#125;/subscribers. |
| `beehiiv_get_subscriber` | Get one subscriber - GET /publications/&#123;id&#125;/subscribers/&#123;subscriber_id&#125;. |
| `beehiiv_create_subscriber` | Add a subscriber - POST /publications/&#123;id&#125;/subscribers. |
| `beehiiv_update_subscriber` | Update a subscriber - PATCH /publications/&#123;id&#125;/subscribers/&#123;subscriber_id&#125;. |
| `beehiiv_delete_subscriber` | Delete a subscriber - DELETE /publications/&#123;id&#125;/subscribers/&#123;subscriber_id&#125;. |
| `beehiiv_list_posts` | List posts - GET /publications/&#123;id&#125;/posts. |
| `beehiiv_get_post` | Get one post - GET /publications/&#123;id&#125;/posts/&#123;post_id&#125;. |
| `beehiiv_create_post` | Create a post - POST /publications/&#123;id&#125;/posts. |
| `beehiiv_update_post` | Update a post - PATCH /publications/&#123;id&#125;/posts/&#123;post_id&#125;. |
| `beehiiv_publish_post` | Publish a post immediately - POST /publications/&#123;id&#125;/posts/&#123;post_id&#125;/publish. |
| `beehiiv_delete_post` | Delete a post - DELETE /publications/&#123;id&#125;/posts/&#123;post_id&#125;. |
| `beehiiv_get_post_stats` | Get post analytics - GET /publications/&#123;id&#125;/posts/&#123;post_id&#125;/stats. |
| `beehiiv_list_emails` | List emails/campaigns - GET /publications/&#123;id&#125;/emails. |
| `beehiiv_get_email` | Get one email/campaign - GET /publications/&#123;id&#125;/emails/&#123;email_id&#125;. |
| `beehiiv_get_email_stats` | Get email analytics - GET /publications/&#123;id&#125;/emails/&#123;email_id&#125;/stats. |
| `beehiiv_list_referrals` | List referrals - GET /publications/&#123;id&#125;/referrals. |
| `beehiiv_get_referral` | Get one referral - GET /publications/&#123;id&#125;/referrals/&#123;referral_id&#125;. |
| `beehiiv_list_segments` | List subscriber segments - GET /publications/&#123;id&#125;/segments. |
| `beehiiv_get_segment` | Get one segment - GET /publications/&#123;id&#125;/segments/&#123;segment_id&#125;. |
| `beehiiv_create_segment` | Create a segment - POST /publications/&#123;id&#125;/segments. |
| `beehiiv_update_segment` | Update a segment - PATCH /publications/&#123;id&#125;/segments/&#123;segment_id&#125;. |
| `beehiiv_delete_segment` | Delete a segment - DELETE /publications/&#123;id&#125;/segments/&#123;segment_id&#125;. |
| `beehiiv_list_automations` | List automations - GET /publications/&#123;id&#125;/automations. |
| `beehiiv_get_automation` | Get one automation - GET /publications/&#123;id&#125;/automations/&#123;automation_id&#125;. |
| `beehiiv_create_automation` | Create an automation - POST /publications/&#123;id&#125;/automations. |
| `beehiiv_update_automation` | Update an automation - PATCH /publications/&#123;id&#125;/automations/&#123;automation_id&#125;. |
| `beehiiv_delete_automation` | Delete an automation - DELETE /publications/&#123;id&#125;/automations/&#123;automation_id&#125;. |
| `beehiiv_list_bounces` | List bounces - GET /publications/&#123;id&#125;/bounces. |
| `beehiiv_process_bounce` | Mark subscriber as bounced - POST /publications/&#123;id&#125;/bounces. |
| `beehiiv_get_publication_stats` | Get publication-wide analytics - GET /publications/&#123;id&#125;/stats. |
| `beehiiv_list_webhooks` | List webhooks - GET /publications/&#123;id&#125;/webhooks. |
| `beehiiv_create_webhook` | Create a webhook - POST /publications/&#123;id&#125;/webhooks. |
| `beehiiv_delete_webhook` | Delete a webhook - DELETE /publications/&#123;id&#125;/webhooks/&#123;webhook_id&#125;. |

## How to get credentials

This connector uses an **API key / token**. Create one in the provider
dashboard, then paste it into FlyMyAI:

- **`BEEHIIV_API_KEY`** - beehiiv - Settings - Integrations - API. (https://app.beehiiv.com/settings/integrations/api)
- **`BEEHIIV_PUBLICATION_ID`** - beehiiv publication id (pub_...).

## Fields to fill in FlyMyAI

| FlyMyAI field | Where it comes from |
| --- | --- |
| `BEEHIIV_API_KEY` | beehiiv - Settings - Integrations - API. |
| `BEEHIIV_PUBLICATION_ID` | beehiiv publication id (pub_...). |

## Troubleshooting

- **`401 Unauthorized` / `403 Forbidden`** - the token is wrong, expired, or missing a required scope - regenerate it.
- **`429 Too Many Requests`** - you hit the provider rate limit; retry after a short backoff.
- **Unexpected `4xx` on writes** - double-check required fields; the agent confirms before write actions.

## Links

- [beehiiv API documentation](https://developers.beehiiv.com)
