naftiko: 1.0.0-alpha2
info:
label: API Reference — subpackage_engagements
description: 'API Reference — subpackage_engagements. 1 operations. Lead operation: Get publication engagements OAuth Scope: publications:read. Self-contained Naftiko capability covering one Beehiiv business
surface.'
tags:
- Beehiiv
- subpackage_engagements
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-engagements
baseUri: https://api.beehiiv.com/v2
description: API Reference — subpackage_engagements business capability. Self-contained, no shared references.
resources:
- name: publications-publicationId-engagements
path: /publications/{publicationId}/engagements
operations:
- name: index
method: GET
description: 'Get publication engagements OAuth Scope: publications:read'
outputRawFormat: json
outputParameters:
- name: result
type: object
value: $.
inputParameters:
- name: publicationId
in: path
type: string
required: true
- name: start_date
in: query
type: string
description: The starting date for the engagement metrics in `YYYY-MM-DD` format. Defaults to 1 day ago if not provided.
- name: number_of_days
in: query
type: string
description: 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.
- name: granularity
in: query
type: string
description: The granularity at which to report the engagement metrics. Defaults to `day` if not provided.
- name: email_type
in: query
type: string
description: 'Filter engagement metrics by email type. If omitted, all email engagement is included.
`post`:
Only post emails.
`message`: Only automated and system-ge'
- name: direction
in: query
type: string
description: 'The direction that the results are sorted in. Defaults to `asc`.
`asc`: Oldest to newest
`desc`:
Newest to oldest'
- 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-engagements-rest
port: 8080
description: REST adapter for API Reference — subpackage_engagements. One Spectral-compliant resource per consumed operation,
prefixed with /v1.
resources:
- path: /v1/publications/{publicationid}/engagements
name: publications-publicationid-engagements
description: REST surface for publications-publicationId-engagements.
operations:
- method: GET
name: index
description: 'Get publication engagements OAuth Scope: publications:read'
call: beehiiv-subpackage-engagements.index
with:
publicationId: rest.publicationId
start_date: rest.start_date
number_of_days: rest.number_of_days
granularity: rest.granularity
email_type: rest.email_type
direction: rest.direction
Authorization: rest.Authorization
outputParameters:
- type: object
mapping: $.
- type: mcp
namespace: beehiiv-subpackage-engagements-mcp
port: 9090
transport: http
description: MCP adapter for API Reference — subpackage_engagements. One tool per consumed operation, routed inline through
this capability's consumes block.
tools:
- name: get-publication-engagements-badge-intent-info
description: 'Get publication engagements OAuth Scope: publications:read'
hints:
readOnly: true
destructive: false
idempotent: true
call: beehiiv-subpackage-engagements.index
with:
publicationId: tools.publicationId
start_date: tools.start_date
number_of_days: tools.number_of_days
granularity: tools.granularity
email_type: tools.email_type
direction: tools.direction
Authorization: tools.Authorization
outputParameters:
- type: object
mapping: $.