{
  "schemaVersion": "1.0",
  "item": {
    "slug": "beehiiv",
    "name": "beehiiv",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/byungkyu/beehiiv",
    "canonicalUrl": "https://clawhub.ai/byungkyu/beehiiv",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/beehiiv",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=beehiiv",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "LICENSE.txt"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-07T17:22:31.273Z",
      "expiresAt": "2026-05-14T17:22:31.273Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=afrexai-annual-report",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=afrexai-annual-report",
        "contentDisposition": "attachment; filename=\"afrexai-annual-report-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/beehiiv"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/beehiiv",
    "agentPageUrl": "https://openagent3.xyz/skills/beehiiv/agent",
    "manifestUrl": "https://openagent3.xyz/skills/beehiiv/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/beehiiv/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "beehiiv",
        "body": "Access the beehiiv API with managed OAuth authentication. Manage newsletter publications, subscriptions, posts, custom fields, segments, tiers, and automations."
      },
      {
        "title": "Quick Start",
        "body": "# List publications\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://gateway.maton.ai/beehiiv/v2/publications')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF"
      },
      {
        "title": "Base URL",
        "body": "https://gateway.maton.ai/beehiiv/{native-api-path}\n\nReplace {native-api-path} with the actual beehiiv API endpoint path. The gateway proxies requests to api.beehiiv.com and automatically injects your OAuth token."
      },
      {
        "title": "Authentication",
        "body": "All requests require the Maton API key in the Authorization header:\n\nAuthorization: Bearer $MATON_API_KEY\n\nEnvironment Variable: Set your API key as MATON_API_KEY:\n\nexport MATON_API_KEY=\"YOUR_API_KEY\""
      },
      {
        "title": "Getting Your API Key",
        "body": "Sign in or create an account at maton.ai\nGo to maton.ai/settings\nCopy your API key"
      },
      {
        "title": "Connection Management",
        "body": "Manage your beehiiv OAuth connections at https://ctrl.maton.ai."
      },
      {
        "title": "List Connections",
        "body": "python <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections?app=beehiiv&status=ACTIVE')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF"
      },
      {
        "title": "Create Connection",
        "body": "python <<'EOF'\nimport urllib.request, os, json\ndata = json.dumps({'app': 'beehiiv'}).encode()\nreq = urllib.request.Request('https://ctrl.maton.ai/connections', data=data, method='POST')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Content-Type', 'application/json')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF"
      },
      {
        "title": "Get Connection",
        "body": "python <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nResponse:\n\n{\n  \"connection\": {\n    \"connection_id\": \"8bfe17f4-0038-4cbd-afb4-907b1ffa9d66\",\n    \"status\": \"ACTIVE\",\n    \"creation_time\": \"2026-02-11T00:25:10.464852Z\",\n    \"last_updated_time\": \"2026-02-11T00:27:00.816431Z\",\n    \"url\": \"https://connect.maton.ai/?session_token=...\",\n    \"app\": \"beehiiv\",\n    \"metadata\": {}\n  }\n}\n\nOpen the returned url in a browser to complete OAuth authorization."
      },
      {
        "title": "Delete Connection",
        "body": "python <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}', method='DELETE')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF"
      },
      {
        "title": "Specifying Connection",
        "body": "If you have multiple beehiiv connections, specify which one to use with the Maton-Connection header:\n\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://gateway.maton.ai/beehiiv/v2/publications')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Maton-Connection', '8bfe17f4-0038-4cbd-afb4-907b1ffa9d66')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nIf omitted, the gateway uses the default (oldest) active connection."
      },
      {
        "title": "API Reference",
        "body": "All beehiiv API endpoints follow this pattern:\n\n/beehiiv/v2/{resource}"
      },
      {
        "title": "List Publications",
        "body": "GET /beehiiv/v2/publications\n\nQuery Parameters:\n\nParameterDescriptionlimitResults per page (1-100, default: 10)pagePage number (default: 1)expand[]Expand with: stats, stat_active_subscriptions, stat_average_open_rate, etc.order_bySort by: created or namedirectionSort direction: asc or desc\n\nResponse:\n\n{\n  \"data\": [\n    {\n      \"id\": \"pub_c6c521e4-91ac-4c14-8a52-06987b7e32f2\",\n      \"name\": \"My Newsletter\",\n      \"organization_name\": \"My Organization\",\n      \"referral_program_enabled\": true,\n      \"created\": 1770767522\n    }\n  ],\n  \"page\": 1,\n  \"limit\": 10,\n  \"total_results\": 1,\n  \"total_pages\": 1\n}"
      },
      {
        "title": "Get Publication",
        "body": "GET /beehiiv/v2/publications/{publication_id}"
      },
      {
        "title": "List Subscriptions",
        "body": "GET /beehiiv/v2/publications/{publication_id}/subscriptions\n\nQuery Parameters:\n\nParameterDescriptionlimitResults per page (1-100, default: 10)cursorCursor for pagination (recommended)pagePage number (deprecated, max 100 pages)emailFilter by exact email (case-insensitive)statusFilter: validating, invalid, pending, active, inactive, alltierFilter: free, premium, allexpand[]Expand with: stats, custom_fields, referralsorder_bySort field (default: created)directionSort direction: asc or desc\n\nResponse:\n\n{\n  \"data\": [\n    {\n      \"id\": \"sub_c27d9640-f418-43a8-a0f9-528c20a05002\",\n      \"email\": \"subscriber@example.com\",\n      \"status\": \"active\",\n      \"created\": 1770767524,\n      \"subscription_tier\": \"free\",\n      \"subscription_premium_tier_names\": [],\n      \"utm_source\": \"direct\",\n      \"utm_medium\": \"\",\n      \"utm_channel\": \"website\",\n      \"utm_campaign\": \"\",\n      \"referring_site\": \"\",\n      \"referral_code\": \"gBZbSVal1X\",\n      \"stripe_customer_id\": \"\"\n    }\n  ],\n  \"limit\": 10,\n  \"has_more\": false,\n  \"next_cursor\": null\n}"
      },
      {
        "title": "Get Subscription by ID",
        "body": "GET /beehiiv/v2/publications/{publication_id}/subscriptions/{subscription_id}\n\nQuery Parameters:\n\nParameterDescriptionexpand[]Expand with: stats, custom_fields, referrals, tags"
      },
      {
        "title": "Get Subscription by Email",
        "body": "GET /beehiiv/v2/publications/{publication_id}/subscriptions/by_email/{email}"
      },
      {
        "title": "Create Subscription",
        "body": "POST /beehiiv/v2/publications/{publication_id}/subscriptions\nContent-Type: application/json\n\n{\n  \"email\": \"newsubscriber@example.com\",\n  \"utm_source\": \"api\",\n  \"send_welcome_email\": false,\n  \"reactivate_existing\": false\n}\n\nRequest Body:\n\nFieldTypeRequiredDescriptionemailstringYesSubscriber email addressreactivate_existingbooleanNoReactivate if previously unsubscribedsend_welcome_emailbooleanNoSend welcome emailutm_sourcestringNoUTM source for trackingutm_mediumstringNoUTM mediumreferring_sitestringNoReferral code of referring subscribercustom_fieldsobjectNoCustom field values (fields must exist)double_opt_overridestringNoon or off to override double opt-intierstringNoSubscription tierpremium_tier_namesarrayNoPremium tier names to assign"
      },
      {
        "title": "Update Subscription",
        "body": "PATCH /beehiiv/v2/publications/{publication_id}/subscriptions/{subscription_id}\nContent-Type: application/json\n\n{\n  \"utm_source\": \"updated-source\",\n  \"custom_fields\": [\n    {\"name\": \"First Name\", \"value\": \"John\"}\n  ]\n}"
      },
      {
        "title": "Delete Subscription",
        "body": "DELETE /beehiiv/v2/publications/{publication_id}/subscriptions/{subscription_id}"
      },
      {
        "title": "List Posts",
        "body": "GET /beehiiv/v2/publications/{publication_id}/posts\n\nQuery Parameters:\n\nParameterDescriptionlimitResults per page (1-100, default: 10)pagePage numberstatusFilter by statusexpand[]Expand with additional data\n\nResponse:\n\n{\n  \"data\": [],\n  \"page\": 1,\n  \"limit\": 10,\n  \"total_results\": 0,\n  \"total_pages\": 0\n}"
      },
      {
        "title": "Get Post",
        "body": "GET /beehiiv/v2/publications/{publication_id}/posts/{post_id}"
      },
      {
        "title": "Delete Post",
        "body": "DELETE /beehiiv/v2/publications/{publication_id}/posts/{post_id}"
      },
      {
        "title": "List Custom Fields",
        "body": "GET /beehiiv/v2/publications/{publication_id}/custom_fields\n\nResponse:\n\n{\n  \"data\": [\n    {\n      \"id\": \"95c9653f-a1cf-45f0-a140-97feef19057b\",\n      \"kind\": \"string\",\n      \"display\": \"Last Name\",\n      \"created\": 1770767523\n    },\n    {\n      \"id\": \"4cfe081e-c89b-4da5-9c1a-52a4fb8ba69e\",\n      \"kind\": \"string\",\n      \"display\": \"First Name\",\n      \"created\": 1770767523\n    }\n  ],\n  \"page\": 1,\n  \"limit\": 10,\n  \"total_results\": 2,\n  \"total_pages\": 1\n}\n\nField Kinds: string, integer, boolean, date, datetime, list, double"
      },
      {
        "title": "Create Custom Field",
        "body": "POST /beehiiv/v2/publications/{publication_id}/custom_fields\nContent-Type: application/json\n\n{\n  \"display\": \"Company\",\n  \"kind\": \"string\"\n}"
      },
      {
        "title": "Update Custom Field",
        "body": "PATCH /beehiiv/v2/publications/{publication_id}/custom_fields/{custom_field_id}\nContent-Type: application/json\n\n{\n  \"display\": \"Company Name\"\n}"
      },
      {
        "title": "Delete Custom Field",
        "body": "DELETE /beehiiv/v2/publications/{publication_id}/custom_fields/{custom_field_id}"
      },
      {
        "title": "List Segments",
        "body": "GET /beehiiv/v2/publications/{publication_id}/segments\n\nResponse:\n\n{\n  \"data\": [],\n  \"page\": 1,\n  \"limit\": 10,\n  \"total_results\": 0,\n  \"total_pages\": 0\n}"
      },
      {
        "title": "Get Segment",
        "body": "GET /beehiiv/v2/publications/{publication_id}/segments/{segment_id}"
      },
      {
        "title": "Delete Segment",
        "body": "DELETE /beehiiv/v2/publications/{publication_id}/segments/{segment_id}"
      },
      {
        "title": "List Tiers",
        "body": "GET /beehiiv/v2/publications/{publication_id}/tiers"
      },
      {
        "title": "Get Tier",
        "body": "GET /beehiiv/v2/publications/{publication_id}/tiers/{tier_id}"
      },
      {
        "title": "Create Tier",
        "body": "POST /beehiiv/v2/publications/{publication_id}/tiers\nContent-Type: application/json\n\n{\n  \"name\": \"Premium\",\n  \"description\": \"Premium tier with exclusive content\"\n}"
      },
      {
        "title": "Update Tier",
        "body": "PATCH /beehiiv/v2/publications/{publication_id}/tiers/{tier_id}\nContent-Type: application/json\n\n{\n  \"name\": \"Updated Tier Name\"\n}"
      },
      {
        "title": "List Automations",
        "body": "GET /beehiiv/v2/publications/{publication_id}/automations"
      },
      {
        "title": "Get Automation",
        "body": "GET /beehiiv/v2/publications/{publication_id}/automations/{automation_id}"
      },
      {
        "title": "Get Referral Program",
        "body": "GET /beehiiv/v2/publications/{publication_id}/referral_program"
      },
      {
        "title": "Pagination",
        "body": "beehiiv supports two pagination methods:"
      },
      {
        "title": "Cursor-Based (Recommended)",
        "body": "GET /beehiiv/v2/publications/{publication_id}/subscriptions?limit=10&cursor={next_cursor}\n\nResponse includes:\n\n{\n  \"data\": [...],\n  \"limit\": 10,\n  \"has_more\": true,\n  \"next_cursor\": \"eyJ0aW1lc3RhbXAiOiIyMDI0LTA3LTAyVDE3OjMwOjAwLjAwMDAwMFoifQ==\"\n}\n\nUse the next_cursor value for subsequent requests."
      },
      {
        "title": "Page-Based (Deprecated)",
        "body": "GET /beehiiv/v2/publications?page=2&limit=10\n\nResponse includes:\n\n{\n  \"data\": [...],\n  \"page\": 2,\n  \"limit\": 10,\n  \"total_results\": 50,\n  \"total_pages\": 5\n}\n\nNote: Page-based pagination is limited to 100 pages maximum."
      },
      {
        "title": "JavaScript",
        "body": "const response = await fetch(\n  'https://gateway.maton.ai/beehiiv/v2/publications',\n  {\n    headers: {\n      'Authorization': `Bearer ${process.env.MATON_API_KEY}`\n    }\n  }\n);\nconst data = await response.json();\nconsole.log(data.data);"
      },
      {
        "title": "Python",
        "body": "import os\nimport requests\n\nresponse = requests.get(\n    'https://gateway.maton.ai/beehiiv/v2/publications',\n    headers={'Authorization': f'Bearer {os.environ[\"MATON_API_KEY\"]}'}\n)\ndata = response.json()\nfor pub in data['data']:\n    print(f\"{pub['id']}: {pub['name']}\")"
      },
      {
        "title": "Notes",
        "body": "Publication IDs start with pub_\nSubscription IDs start with sub_\nTimestamps are Unix timestamps (seconds since epoch)\nCustom fields must be created before use in subscriptions\nCursor-based pagination is recommended for better performance\nPage-based pagination is deprecated and limited to 100 pages\nIMPORTANT: When using curl commands, use curl -g when URLs contain brackets to disable glob parsing\nIMPORTANT: When piping curl output to jq or other commands, environment variables like $MATON_API_KEY may not expand correctly in some shell environments"
      },
      {
        "title": "Error Handling",
        "body": "StatusMeaning400Bad request or invalid parameters401Invalid or missing Maton API key403Forbidden - insufficient permissions or plan limitation404Resource not found429Rate limited500Internal server error"
      },
      {
        "title": "Troubleshooting: API Key Issues",
        "body": "Check that the MATON_API_KEY environment variable is set:\n\necho $MATON_API_KEY\n\nVerify the API key is valid by listing connections:\n\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF"
      },
      {
        "title": "Troubleshooting: Invalid App Name",
        "body": "Ensure your URL path starts with beehiiv. For example:\n\nCorrect: https://gateway.maton.ai/beehiiv/v2/publications\nIncorrect: https://gateway.maton.ai/v2/publications"
      },
      {
        "title": "Resources",
        "body": "beehiiv Developer Documentation\nbeehiiv API Reference\nbeehiiv Help Center\nMaton Community\nMaton Support"
      }
    ],
    "body": "beehiiv\n\nAccess the beehiiv API with managed OAuth authentication. Manage newsletter publications, subscriptions, posts, custom fields, segments, tiers, and automations.\n\nQuick Start\n# List publications\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://gateway.maton.ai/beehiiv/v2/publications')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nBase URL\nhttps://gateway.maton.ai/beehiiv/{native-api-path}\n\n\nReplace {native-api-path} with the actual beehiiv API endpoint path. The gateway proxies requests to api.beehiiv.com and automatically injects your OAuth token.\n\nAuthentication\n\nAll requests require the Maton API key in the Authorization header:\n\nAuthorization: Bearer $MATON_API_KEY\n\n\nEnvironment Variable: Set your API key as MATON_API_KEY:\n\nexport MATON_API_KEY=\"YOUR_API_KEY\"\n\nGetting Your API Key\nSign in or create an account at maton.ai\nGo to maton.ai/settings\nCopy your API key\nConnection Management\n\nManage your beehiiv OAuth connections at https://ctrl.maton.ai.\n\nList Connections\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections?app=beehiiv&status=ACTIVE')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nCreate Connection\npython <<'EOF'\nimport urllib.request, os, json\ndata = json.dumps({'app': 'beehiiv'}).encode()\nreq = urllib.request.Request('https://ctrl.maton.ai/connections', data=data, method='POST')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Content-Type', 'application/json')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nGet Connection\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\n\nResponse:\n\n{\n  \"connection\": {\n    \"connection_id\": \"8bfe17f4-0038-4cbd-afb4-907b1ffa9d66\",\n    \"status\": \"ACTIVE\",\n    \"creation_time\": \"2026-02-11T00:25:10.464852Z\",\n    \"last_updated_time\": \"2026-02-11T00:27:00.816431Z\",\n    \"url\": \"https://connect.maton.ai/?session_token=...\",\n    \"app\": \"beehiiv\",\n    \"metadata\": {}\n  }\n}\n\n\nOpen the returned url in a browser to complete OAuth authorization.\n\nDelete Connection\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections/{connection_id}', method='DELETE')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nSpecifying Connection\n\nIf you have multiple beehiiv connections, specify which one to use with the Maton-Connection header:\n\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://gateway.maton.ai/beehiiv/v2/publications')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nreq.add_header('Maton-Connection', '8bfe17f4-0038-4cbd-afb4-907b1ffa9d66')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\n\nIf omitted, the gateway uses the default (oldest) active connection.\n\nAPI Reference\n\nAll beehiiv API endpoints follow this pattern:\n\n/beehiiv/v2/{resource}\n\nPublications\nList Publications\nGET /beehiiv/v2/publications\n\n\nQuery Parameters:\n\nParameter\tDescription\nlimit\tResults per page (1-100, default: 10)\npage\tPage number (default: 1)\nexpand[]\tExpand with: stats, stat_active_subscriptions, stat_average_open_rate, etc.\norder_by\tSort by: created or name\ndirection\tSort direction: asc or desc\n\nResponse:\n\n{\n  \"data\": [\n    {\n      \"id\": \"pub_c6c521e4-91ac-4c14-8a52-06987b7e32f2\",\n      \"name\": \"My Newsletter\",\n      \"organization_name\": \"My Organization\",\n      \"referral_program_enabled\": true,\n      \"created\": 1770767522\n    }\n  ],\n  \"page\": 1,\n  \"limit\": 10,\n  \"total_results\": 1,\n  \"total_pages\": 1\n}\n\nGet Publication\nGET /beehiiv/v2/publications/{publication_id}\n\nSubscriptions\nList Subscriptions\nGET /beehiiv/v2/publications/{publication_id}/subscriptions\n\n\nQuery Parameters:\n\nParameter\tDescription\nlimit\tResults per page (1-100, default: 10)\ncursor\tCursor for pagination (recommended)\npage\tPage number (deprecated, max 100 pages)\nemail\tFilter by exact email (case-insensitive)\nstatus\tFilter: validating, invalid, pending, active, inactive, all\ntier\tFilter: free, premium, all\nexpand[]\tExpand with: stats, custom_fields, referrals\norder_by\tSort field (default: created)\ndirection\tSort direction: asc or desc\n\nResponse:\n\n{\n  \"data\": [\n    {\n      \"id\": \"sub_c27d9640-f418-43a8-a0f9-528c20a05002\",\n      \"email\": \"subscriber@example.com\",\n      \"status\": \"active\",\n      \"created\": 1770767524,\n      \"subscription_tier\": \"free\",\n      \"subscription_premium_tier_names\": [],\n      \"utm_source\": \"direct\",\n      \"utm_medium\": \"\",\n      \"utm_channel\": \"website\",\n      \"utm_campaign\": \"\",\n      \"referring_site\": \"\",\n      \"referral_code\": \"gBZbSVal1X\",\n      \"stripe_customer_id\": \"\"\n    }\n  ],\n  \"limit\": 10,\n  \"has_more\": false,\n  \"next_cursor\": null\n}\n\nGet Subscription by ID\nGET /beehiiv/v2/publications/{publication_id}/subscriptions/{subscription_id}\n\n\nQuery Parameters:\n\nParameter\tDescription\nexpand[]\tExpand with: stats, custom_fields, referrals, tags\nGet Subscription by Email\nGET /beehiiv/v2/publications/{publication_id}/subscriptions/by_email/{email}\n\nCreate Subscription\nPOST /beehiiv/v2/publications/{publication_id}/subscriptions\nContent-Type: application/json\n\n{\n  \"email\": \"newsubscriber@example.com\",\n  \"utm_source\": \"api\",\n  \"send_welcome_email\": false,\n  \"reactivate_existing\": false\n}\n\n\nRequest Body:\n\nField\tType\tRequired\tDescription\nemail\tstring\tYes\tSubscriber email address\nreactivate_existing\tboolean\tNo\tReactivate if previously unsubscribed\nsend_welcome_email\tboolean\tNo\tSend welcome email\nutm_source\tstring\tNo\tUTM source for tracking\nutm_medium\tstring\tNo\tUTM medium\nreferring_site\tstring\tNo\tReferral code of referring subscriber\ncustom_fields\tobject\tNo\tCustom field values (fields must exist)\ndouble_opt_override\tstring\tNo\ton or off to override double opt-in\ntier\tstring\tNo\tSubscription tier\npremium_tier_names\tarray\tNo\tPremium tier names to assign\nUpdate Subscription\nPATCH /beehiiv/v2/publications/{publication_id}/subscriptions/{subscription_id}\nContent-Type: application/json\n\n{\n  \"utm_source\": \"updated-source\",\n  \"custom_fields\": [\n    {\"name\": \"First Name\", \"value\": \"John\"}\n  ]\n}\n\nDelete Subscription\nDELETE /beehiiv/v2/publications/{publication_id}/subscriptions/{subscription_id}\n\nPosts\nList Posts\nGET /beehiiv/v2/publications/{publication_id}/posts\n\n\nQuery Parameters:\n\nParameter\tDescription\nlimit\tResults per page (1-100, default: 10)\npage\tPage number\nstatus\tFilter by status\nexpand[]\tExpand with additional data\n\nResponse:\n\n{\n  \"data\": [],\n  \"page\": 1,\n  \"limit\": 10,\n  \"total_results\": 0,\n  \"total_pages\": 0\n}\n\nGet Post\nGET /beehiiv/v2/publications/{publication_id}/posts/{post_id}\n\nDelete Post\nDELETE /beehiiv/v2/publications/{publication_id}/posts/{post_id}\n\nCustom Fields\nList Custom Fields\nGET /beehiiv/v2/publications/{publication_id}/custom_fields\n\n\nResponse:\n\n{\n  \"data\": [\n    {\n      \"id\": \"95c9653f-a1cf-45f0-a140-97feef19057b\",\n      \"kind\": \"string\",\n      \"display\": \"Last Name\",\n      \"created\": 1770767523\n    },\n    {\n      \"id\": \"4cfe081e-c89b-4da5-9c1a-52a4fb8ba69e\",\n      \"kind\": \"string\",\n      \"display\": \"First Name\",\n      \"created\": 1770767523\n    }\n  ],\n  \"page\": 1,\n  \"limit\": 10,\n  \"total_results\": 2,\n  \"total_pages\": 1\n}\n\n\nField Kinds: string, integer, boolean, date, datetime, list, double\n\nCreate Custom Field\nPOST /beehiiv/v2/publications/{publication_id}/custom_fields\nContent-Type: application/json\n\n{\n  \"display\": \"Company\",\n  \"kind\": \"string\"\n}\n\nUpdate Custom Field\nPATCH /beehiiv/v2/publications/{publication_id}/custom_fields/{custom_field_id}\nContent-Type: application/json\n\n{\n  \"display\": \"Company Name\"\n}\n\nDelete Custom Field\nDELETE /beehiiv/v2/publications/{publication_id}/custom_fields/{custom_field_id}\n\nSegments\nList Segments\nGET /beehiiv/v2/publications/{publication_id}/segments\n\n\nResponse:\n\n{\n  \"data\": [],\n  \"page\": 1,\n  \"limit\": 10,\n  \"total_results\": 0,\n  \"total_pages\": 0\n}\n\nGet Segment\nGET /beehiiv/v2/publications/{publication_id}/segments/{segment_id}\n\nDelete Segment\nDELETE /beehiiv/v2/publications/{publication_id}/segments/{segment_id}\n\nTiers\nList Tiers\nGET /beehiiv/v2/publications/{publication_id}/tiers\n\nGet Tier\nGET /beehiiv/v2/publications/{publication_id}/tiers/{tier_id}\n\nCreate Tier\nPOST /beehiiv/v2/publications/{publication_id}/tiers\nContent-Type: application/json\n\n{\n  \"name\": \"Premium\",\n  \"description\": \"Premium tier with exclusive content\"\n}\n\nUpdate Tier\nPATCH /beehiiv/v2/publications/{publication_id}/tiers/{tier_id}\nContent-Type: application/json\n\n{\n  \"name\": \"Updated Tier Name\"\n}\n\nAutomations\nList Automations\nGET /beehiiv/v2/publications/{publication_id}/automations\n\nGet Automation\nGET /beehiiv/v2/publications/{publication_id}/automations/{automation_id}\n\nReferral Program\nGet Referral Program\nGET /beehiiv/v2/publications/{publication_id}/referral_program\n\nPagination\n\nbeehiiv supports two pagination methods:\n\nCursor-Based (Recommended)\nGET /beehiiv/v2/publications/{publication_id}/subscriptions?limit=10&cursor={next_cursor}\n\n\nResponse includes:\n\n{\n  \"data\": [...],\n  \"limit\": 10,\n  \"has_more\": true,\n  \"next_cursor\": \"eyJ0aW1lc3RhbXAiOiIyMDI0LTA3LTAyVDE3OjMwOjAwLjAwMDAwMFoifQ==\"\n}\n\n\nUse the next_cursor value for subsequent requests.\n\nPage-Based (Deprecated)\nGET /beehiiv/v2/publications?page=2&limit=10\n\n\nResponse includes:\n\n{\n  \"data\": [...],\n  \"page\": 2,\n  \"limit\": 10,\n  \"total_results\": 50,\n  \"total_pages\": 5\n}\n\n\nNote: Page-based pagination is limited to 100 pages maximum.\n\nCode Examples\nJavaScript\nconst response = await fetch(\n  'https://gateway.maton.ai/beehiiv/v2/publications',\n  {\n    headers: {\n      'Authorization': `Bearer ${process.env.MATON_API_KEY}`\n    }\n  }\n);\nconst data = await response.json();\nconsole.log(data.data);\n\nPython\nimport os\nimport requests\n\nresponse = requests.get(\n    'https://gateway.maton.ai/beehiiv/v2/publications',\n    headers={'Authorization': f'Bearer {os.environ[\"MATON_API_KEY\"]}'}\n)\ndata = response.json()\nfor pub in data['data']:\n    print(f\"{pub['id']}: {pub['name']}\")\n\nNotes\nPublication IDs start with pub_\nSubscription IDs start with sub_\nTimestamps are Unix timestamps (seconds since epoch)\nCustom fields must be created before use in subscriptions\nCursor-based pagination is recommended for better performance\nPage-based pagination is deprecated and limited to 100 pages\nIMPORTANT: When using curl commands, use curl -g when URLs contain brackets to disable glob parsing\nIMPORTANT: When piping curl output to jq or other commands, environment variables like $MATON_API_KEY may not expand correctly in some shell environments\nError Handling\nStatus\tMeaning\n400\tBad request or invalid parameters\n401\tInvalid or missing Maton API key\n403\tForbidden - insufficient permissions or plan limitation\n404\tResource not found\n429\tRate limited\n500\tInternal server error\nTroubleshooting: API Key Issues\nCheck that the MATON_API_KEY environment variable is set:\necho $MATON_API_KEY\n\nVerify the API key is valid by listing connections:\npython <<'EOF'\nimport urllib.request, os, json\nreq = urllib.request.Request('https://ctrl.maton.ai/connections')\nreq.add_header('Authorization', f'Bearer {os.environ[\"MATON_API_KEY\"]}')\nprint(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))\nEOF\n\nTroubleshooting: Invalid App Name\nEnsure your URL path starts with beehiiv. For example:\nCorrect: https://gateway.maton.ai/beehiiv/v2/publications\nIncorrect: https://gateway.maton.ai/v2/publications\nResources\nbeehiiv Developer Documentation\nbeehiiv API Reference\nbeehiiv Help Center\nMaton Community\nMaton Support"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/byungkyu/beehiiv",
    "publisherUrl": "https://clawhub.ai/byungkyu/beehiiv",
    "owner": "byungkyu",
    "version": "1.0.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/beehiiv",
    "downloadUrl": "https://openagent3.xyz/downloads/beehiiv",
    "agentUrl": "https://openagent3.xyz/skills/beehiiv/agent",
    "manifestUrl": "https://openagent3.xyz/skills/beehiiv/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/beehiiv/agent.md"
  }
}