beehiiv · Capability

API Reference — subpackage_subscriptions

API Reference — subpackage_subscriptions. 8 operations. Lead operation: Create subscription OAuth Scope: subscriptions:write. Self-contained Naftiko capability covering one Beehiiv business surface.

Run with Naftiko Beehiivsubpackage_subscriptions

What You Can Do

POST
Create — Create subscription OAuth Scope: subscriptions:write
/v1/publications/{publicationid}/subscriptions
GET
Index — List subscriptions OAuth Scope: subscriptions:read
/v1/publications/{publicationid}/subscriptions
GET
Getbyemail — Get subscription by email OAuth Scope: subscriptions:read
/v1/publications/{publicationid}/subscriptions/by-email/{email}
PUT
Updatebyemail — Update subscription by email OAuth Scope: subscriptions:write
/v1/publications/{publicationid}/subscriptions/by-email/{email}
GET
Getbyid — Get subscription by ID OAuth Scope: subscriptions:read
/v1/publications/{publicationid}/subscriptions/{subscriptionid}
PUT
Put — Update subscription by ID OAuth Scope: subscriptions:write
/v1/publications/{publicationid}/subscriptions/{subscriptionid}
PATCH
Patch — Update subscription by ID OAuth Scope: subscriptions:write
/v1/publications/{publicationid}/subscriptions/{subscriptionid}
DELETE
Delete — Delete subscription OAuth Scope: subscriptions:write
/v1/publications/{publicationid}/subscriptions/{subscriptionid}

MCP Tools

create-subscription-badge-intent-info-minimal

Create subscription OAuth Scope: subscriptions:write

list-subscriptions-badge-intent-info-minimal

List subscriptions OAuth Scope: subscriptions:read

read-only idempotent
get-subscription-email-badge-intent-info

Get subscription by email OAuth Scope: subscriptions:read

read-only idempotent
update-subscription-email-badge-intent-info

Update subscription by email OAuth Scope: subscriptions:write

idempotent
get-subscription-id-badge-intent-info

Get subscription by ID OAuth Scope: subscriptions:read

read-only idempotent
update-subscription-id-badge-intent-info

Update subscription by ID OAuth Scope: subscriptions:write

idempotent
update-subscription-id-badge-intent-info-2

Update subscription by ID OAuth Scope: subscriptions:write

idempotent
delete-subscription-badge-intent-info-minimal

Delete subscription OAuth Scope: subscriptions:write

idempotent

Capability Spec

beehiiv-subpackage-subscriptions.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: API Reference — subpackage_subscriptions
  description: 'API Reference — subpackage_subscriptions. 8 operations. Lead operation: Create subscription <Badge intent="info"
    minimal outlined>OAuth Scope: subscriptions:write</Badge>. Self-contained Naftiko capability covering one Beehiiv business
    surface.'
  tags:
  - Beehiiv
  - subpackage_subscriptions
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    BEEHIIV_API_KEY: BEEHIIV_API_KEY
capability:
  consumes:
  - type: http
    namespace: beehiiv-subpackage-subscriptions
    baseUri: https://api.beehiiv.com/v2
    description: API Reference — subpackage_subscriptions business capability. Self-contained, no shared references.
    resources:
    - name: publications-publicationId-subscriptions
      path: /publications/{publicationId}/subscriptions
      operations:
      - name: create
        method: POST
        description: 'Create subscription <Badge intent="info" minimal outlined>OAuth Scope: subscriptions:write</Badge>'
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: publicationId
          in: path
          type: string
          description: The prefixed ID of the publication object
          required: true
        - name: Authorization
          in: header
          type: string
          description: Bearer authentication
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
      - name: index
        method: GET
        description: 'List subscriptions <Badge intent="info" minimal outlined>OAuth Scope: subscriptions:read</Badge>'
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: publicationId
          in: path
          type: string
          description: The prefixed ID of the publication object
          required: true
        - name: expand[]
          in: query
          type: string
          description: 'Optional list of expandable objects.<br>`subscription_premium_tiers ` - Returns an array of tiers
            the subscription is associated with.<br>`referrals` - Returns '
        - name: status
          in: query
          type: string
          description: Optionally filter the results by a status
        - name: tier
          in: query
          type: string
          description: Optionally filter the results by a their tier
        - name: premium_tiers[]
          in: query
          type: string
          description: Optionally filter the results by one or multiple premium tiers
        - name: premium_tier_ids[]
          in: query
          type: string
          description: Optionally filter the results by one or multiple premium tier ids
        - name: limit
          in: query
          type: integer
          description: A limit on the number of objects to be returned. The limit can range between 1 and 100, and the default
            is 10.
        - name: cursor
          in: query
          type: string
          description: '**Cursor-based pagination (recommended)**: Use this opaque cursor token to fetch the next page of
            results. When provided, pagination will use cursor-based metho'
        - name: page
          in: query
          type: integer
          description: '**Offset-based pagination (deprecated)**: Page number for offset-based pagination. This method is
            deprecated and limited to 100 pages maximum. Please migrate to'
        - name: email
          in: query
          type: string
          description: Optional email address to find a subscription.<br>This param must be an exact match and is case insensitive.
        - name: order_by
          in: query
          type: string
          description: The field that the results are sorted by. Defaults to created<br> `created` - The time in which the
            subscription was first created.<br>
        - name: direction
          in: query
          type: string
          description: The direction that the results are sorted in. Defaults to asc<br> `asc` - Ascending, sorts from smallest
            to largest.<br> `desc` - Descending, sorts from largest
        - name: creation_date
          in: query
          type: string
          description: Optional date entry (in the format YYYY/MM/DD) that filters returned subscriptions by their creation
            date.
        - name: Authorization
          in: header
          type: string
          description: Bearer authentication
          required: true
    - name: publications-publicationId-subscriptions-by_email-email
      path: /publications/{publicationId}/subscriptions/by_email/{email}
      operations:
      - name: getbyemail
        method: GET
        description: 'Get subscription by email <Badge intent="info" minimal outlined>OAuth Scope: subscriptions:read</Badge>'
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: publicationId
          in: path
          type: string
          description: The prefixed ID of the publication object
          required: true
        - name: email
          in: path
          type: string
          description: The ID of the subscriber object
          required: true
        - name: expand[]
          in: query
          type: string
          description: 'Optional list of expandable objects.<br>`subscription_premium_tiers ` - Returns an array of tiers
            the subscription is associated with.<br>`referrals` - Returns '
        - name: Authorization
          in: header
          type: string
          description: Bearer authentication
          required: true
      - name: updatebyemail
        method: PUT
        description: 'Update subscription by email <Badge intent="info" minimal outlined>OAuth Scope: subscriptions:write</Badge>'
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: publicationId
          in: path
          type: string
          description: The prefixed ID of the publication object
          required: true
        - name: email
          in: path
          type: string
          description: The email of the subscription object
          required: true
        - name: Authorization
          in: header
          type: string
          description: Bearer authentication
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    - name: publications-publicationId-subscriptions-subscriptionId
      path: /publications/{publicationId}/subscriptions/{subscriptionId}
      operations:
      - name: getbyid
        method: GET
        description: 'Get subscription by ID <Badge intent="info" minimal outlined>OAuth Scope: subscriptions:read</Badge>'
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: publicationId
          in: path
          type: string
          description: The prefixed ID of the publication object
          required: true
        - name: subscriptionId
          in: path
          type: string
          description: The prefixed ID of the subscription object
          required: true
        - name: expand[]
          in: query
          type: string
          description: Optional list of expandable objects.<br>`subscription_premium_tiers` - Returns an array of tiers the
            subscription is associated with.<br>`referrals` - Returns a
        - name: Authorization
          in: header
          type: string
          description: Bearer authentication
          required: true
      - name: put
        method: PUT
        description: 'Update subscription by ID <Badge intent="info" minimal outlined>OAuth Scope: subscriptions:write</Badge>'
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: publicationId
          in: path
          type: string
          description: The prefixed ID of the publication object
          required: true
        - name: subscriptionId
          in: path
          type: string
          description: The prefixed ID of the subscription object
          required: true
        - name: Authorization
          in: header
          type: string
          description: Bearer authentication
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
      - name: patch
        method: PATCH
        description: 'Update subscription by ID <Badge intent="info" minimal outlined>OAuth Scope: subscriptions:write</Badge>'
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: publicationId
          in: path
          type: string
          description: The prefixed ID of the publication object
          required: true
        - name: subscriptionId
          in: path
          type: string
          description: The prefixed ID of the subscription object
          required: true
        - name: Authorization
          in: header
          type: string
          description: Bearer authentication
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
      - name: delete
        method: DELETE
        description: 'Delete subscription <Badge intent="info" minimal outlined>OAuth Scope: subscriptions:write</Badge>'
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: publicationId
          in: path
          type: string
          description: The prefixed ID of the publication object
          required: true
        - name: subscriptionId
          in: path
          type: string
          description: The prefixed ID of the subscription object
          required: true
        - name: Authorization
          in: header
          type: string
          description: Bearer authentication
          required: true
    authentication:
      type: bearer
      token: '{{env.BEEHIIV_API_KEY}}'
  exposes:
  - type: rest
    namespace: beehiiv-subpackage-subscriptions-rest
    port: 8080
    description: REST adapter for API Reference — subpackage_subscriptions. One Spectral-compliant resource per consumed operation,
      prefixed with /v1.
    resources:
    - path: /v1/publications/{publicationid}/subscriptions
      name: publications-publicationid-subscriptions
      description: REST surface for publications-publicationId-subscriptions.
      operations:
      - method: POST
        name: create
        description: 'Create subscription <Badge intent="info" minimal outlined>OAuth Scope: subscriptions:write</Badge>'
        call: beehiiv-subpackage-subscriptions.create
        with:
          publicationId: rest.publicationId
          Authorization: rest.Authorization
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
      - method: GET
        name: index
        description: 'List subscriptions <Badge intent="info" minimal outlined>OAuth Scope: subscriptions:read</Badge>'
        call: beehiiv-subpackage-subscriptions.index
        with:
          publicationId: rest.publicationId
          expand[]: rest.expand[]
          status: rest.status
          tier: rest.tier
          premium_tiers[]: rest.premium_tiers[]
          premium_tier_ids[]: rest.premium_tier_ids[]
          limit: rest.limit
          cursor: rest.cursor
          page: rest.page
          email: rest.email
          order_by: rest.order_by
          direction: rest.direction
          creation_date: rest.creation_date
          Authorization: rest.Authorization
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/publications/{publicationid}/subscriptions/by-email/{email}
      name: publications-publicationid-subscriptions-by-email-email
      description: REST surface for publications-publicationId-subscriptions-by_email-email.
      operations:
      - method: GET
        name: getbyemail
        description: 'Get subscription by email <Badge intent="info" minimal outlined>OAuth Scope: subscriptions:read</Badge>'
        call: beehiiv-subpackage-subscriptions.getbyemail
        with:
          publicationId: rest.publicationId
          email: rest.email
          expand[]: rest.expand[]
          Authorization: rest.Authorization
        outputParameters:
        - type: object
          mapping: $.
      - method: PUT
        name: updatebyemail
        description: 'Update subscription by email <Badge intent="info" minimal outlined>OAuth Scope: subscriptions:write</Badge>'
        call: beehiiv-subpackage-subscriptions.updatebyemail
        with:
          publicationId: rest.publicationId
          email: rest.email
          Authorization: rest.Authorization
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
    - path: /v1/publications/{publicationid}/subscriptions/{subscriptionid}
      name: publications-publicationid-subscriptions-subscriptionid
      description: REST surface for publications-publicationId-subscriptions-subscriptionId.
      operations:
      - method: GET
        name: getbyid
        description: 'Get subscription by ID <Badge intent="info" minimal outlined>OAuth Scope: subscriptions:read</Badge>'
        call: beehiiv-subpackage-subscriptions.getbyid
        with:
          publicationId: rest.publicationId
          subscriptionId: rest.subscriptionId
          expand[]: rest.expand[]
          Authorization: rest.Authorization
        outputParameters:
        - type: object
          mapping: $.
      - method: PUT
        name: put
        description: 'Update subscription by ID <Badge intent="info" minimal outlined>OAuth Scope: subscriptions:write</Badge>'
        call: beehiiv-subpackage-subscriptions.put
        with:
          publicationId: rest.publicationId
          subscriptionId: rest.subscriptionId
          Authorization: rest.Authorization
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
      - method: PATCH
        name: patch
        description: 'Update subscription by ID <Badge intent="info" minimal outlined>OAuth Scope: subscriptions:write</Badge>'
        call: beehiiv-subpackage-subscriptions.patch
        with:
          publicationId: rest.publicationId
          subscriptionId: rest.subscriptionId
          Authorization: rest.Authorization
          body: rest.body
        outputParameters:
        - type: object
          mapping: $.
      - method: DELETE
        name: delete
        description: 'Delete subscription <Badge intent="info" minimal outlined>OAuth Scope: subscriptions:write</Badge>'
        call: beehiiv-subpackage-subscriptions.delete
        with:
          publicationId: rest.publicationId
          subscriptionId: rest.subscriptionId
          Authorization: rest.Authorization
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    namespace: beehiiv-subpackage-subscriptions-mcp
    port: 9090
    transport: http
    description: MCP adapter for API Reference — subpackage_subscriptions. One tool per consumed operation, routed inline
      through this capability's consumes block.
    tools:
    - name: create-subscription-badge-intent-info-minimal
      description: 'Create subscription <Badge intent="info" minimal outlined>OAuth Scope: subscriptions:write</Badge>'
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: beehiiv-subpackage-subscriptions.create
      with:
        publicationId: tools.publicationId
        Authorization: tools.Authorization
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: list-subscriptions-badge-intent-info-minimal
      description: 'List subscriptions <Badge intent="info" minimal outlined>OAuth Scope: subscriptions:read</Badge>'
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: beehiiv-subpackage-subscriptions.index
      with:
        publicationId: tools.publicationId
        expand[]: tools.expand[]
        status: tools.status
        tier: tools.tier
        premium_tiers[]: tools.premium_tiers[]
        premium_tier_ids[]: tools.premium_tier_ids[]
        limit: tools.limit
        cursor: tools.cursor
        page: tools.page
        email: tools.email
        order_by: tools.order_by
        direction: tools.direction
        creation_date: tools.creation_date
        Authorization: tools.Authorization
      outputParameters:
      - type: object
        mapping: $.
    - name: get-subscription-email-badge-intent-info
      description: 'Get subscription by email <Badge intent="info" minimal outlined>OAuth Scope: subscriptions:read</Badge>'
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: beehiiv-subpackage-subscriptions.getbyemail
      with:
        publicationId: tools.publicationId
        email: tools.email
        expand[]: tools.expand[]
        Authorization: tools.Authorization
      outputParameters:
      - type: object
        mapping: $.
    - name: update-subscription-email-badge-intent-info
      description: 'Update subscription by email <Badge intent="info" minimal outlined>OAuth Scope: subscriptions:write</Badge>'
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: beehiiv-subpackage-subscriptions.updatebyemail
      with:
        publicationId: tools.publicationId
        email: tools.email
        Authorization: tools.Authorization
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: get-subscription-id-badge-intent-info
      description: 'Get subscription by ID <Badge intent="info" minimal outlined>OAuth Scope: subscriptions:read</Badge>'
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: beehiiv-subpackage-subscriptions.getbyid
      with:
        publicationId: tools.publicationId
        subscriptionId: tools.subscriptionId
        expand[]: tools.expand[]
        Authorization: tools.Authorization
      outputParameters:
      - type: object
        mapping: $.
    - name: update-subscription-id-badge-intent-info
      description: 'Update subscription by ID <Badge intent="info" minimal outlined>OAuth Scope: subscriptions:write</Badge>'
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: beehiiv-subpackage-subscriptions.put
      with:
        publicationId: tools.publicationId
        subscriptionId: tools.subscriptionId
        Authorization: tools.Authorization
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: update-subscription-id-badge-intent-info-2
      description: 'Update subscription by ID <Badge intent="info" minimal outlined>OAuth Scope: subscriptions:write</Badge>'
      hints:
        readOnly: false
        destructive: false
        idempotent: true
      call: beehiiv-subpackage-subscriptions.patch
      with:
        publicationId: tools.publicationId
        subscriptionId: tools.subscriptionId
        Authorization: tools.Authorization
        body: tools.body
      outputParameters:
      - type: object
        mapping: $.
    - name: delete-subscription-badge-intent-info-minimal
      description: 'Delete subscription <Badge intent="info" minimal outlined>OAuth Scope: subscriptions:write</Badge>'
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: beehiiv-subpackage-subscriptions.delete
      with:
        publicationId: tools.publicationId
        subscriptionId: tools.subscriptionId
        Authorization: tools.Authorization
      outputParameters:
      - type: object
        mapping: $.