naftiko: 1.0.0-alpha2 info: label: API Reference — subpackage_posts description: 'API Reference — subpackage_posts. 6 operations. Lead operation: Create post OAuth Scope: posts:write. Self-contained Naftiko capability covering one Beehiiv business surface.' tags: - Beehiiv - subpackage_posts 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-posts baseUri: https://api.beehiiv.com/v2 description: API Reference — subpackage_posts business capability. Self-contained, no shared references. resources: - name: publications-publicationId-posts path: /publications/{publicationId}/posts operations: - name: create method: POST description: 'Create post OAuth Scope: posts:write' 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 posts OAuth Scope: posts:read' 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: array description: Optionally expand the results by adding additional information.
`stats` - Adds statistics about the post(s).
`free_web_content` - Adds the web HTML rend - name: audience in: query type: string description: Optionally filter the results by audience - name: platform in: query type: string description: Optionally filter the results by platform.
`web` - Posts only published to web.
`email` - Posts only published to email.
`both` - Posts published to em - name: status in: query type: string description: Optionally filter the results by the status of the post.
`draft` - not been scheduled.
`confirmed` - The post will be active after the `scheduled_at`.
- name: content_tags[] in: query type: array description: 'Optionally filter posts by content_tags. Adding a content tag will return any post with that content tag associated to it.

Example: Filtering for ' - name: slugs[] in: query type: array description: 'Optionally filter posts by their slugs. Adding a slug will return any post with that exact slug associated to it.

Example: Filtering for `slugs: [' - name: authors[] in: query type: array description: Optionally filter posts by their authors. Adding an author name will return any post with that author associated to it (case-insensitive).

Example: This takes in an array of Display Names of the premium tiers.
It will also scope any expande - 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: page in: query type: integer description: 'Pagination returns the results in pages. Each page contains the number of results specified by the `limit` (default: 10).
If not specified, results 1-10 from' - name: order_by in: query type: string description: The field that the results are sorted by. Defaults to created
`created` - The time in which the post was first created.
`publish_date` - The time the po - name: direction in: query type: string description: The direction that the results are sorted in. Defaults to asc
`asc` - Ascending, sorts from smallest to largest.
`desc` - Descending, sorts from largest - name: hidden_from_feed in: query type: string description: Optionally filter the results by the `hidden_from_feed` attribute of the post.
`all` - Does not restrict results by `hidden_from_feed`.
`true` - Only retu - name: Authorization in: header type: string description: Bearer authentication required: true - name: publications-publicationId-posts-aggregate_stats path: /publications/{publicationId}/posts/aggregate_stats operations: - name: aggregatestats method: GET description: 'Get aggregate stats OAuth Scope: posts:read' 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: audience in: query type: string description: Optionally filter the results by audience - name: platform in: query type: string description: Optionally filter the results by platform.
`web` - Posts only published to web.
`email` - Posts only published to email.
`both` - Posts published to em - name: status in: query type: string description: Optionally filter the results by the status of the post.
`draft` - not been scheduled.
`confirmed` - The post will be active after the `scheduled_at`.
- name: content_tags[] in: query type: array description: 'Optionally filter posts by content_tags. Adding a content tag will return any post with that content tag associated to it.
Example: Filtering for `content_ta' - name: authors[] in: query type: array description: Optionally filter posts by their authors. Adding an author name will return any post with that author associated to it (case-insensitive).

Example:`all` - Does not restrict results by `hidden_from_feed`.
`true` - Only retu - name: Authorization in: header type: string description: Bearer authentication required: true - name: publications-publicationId-posts-postId path: /publications/{publicationId}/posts/{postId} operations: - name: update method: PATCH description: 'Update post OAuth Scope: posts:write' 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: postId in: path type: string description: The prefixed ID of the post to update 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: show method: GET description: 'Get post OAuth Scope: posts:read' 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: postId in: path type: string description: The prefixed ID of the post object required: true - name: expand in: query type: array description: Optionally expand the results by adding additional information.
`stats` - Adds statistics about the post(s).
`free_web_content` - Adds the web HTML rend - name: premium_tiers in: query type: array description: 'Scope any expanded content output to the specified premium tiers.
This takes in an array of Display Names of the premium tiers.
Note: This is case insen' - name: Authorization in: header type: string description: Bearer authentication required: true - name: delete method: DELETE description: 'Delete post OAuth Scope: posts:write' 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: postId in: path type: string description: The prefixed ID of the post 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-posts-rest port: 8080 description: REST adapter for API Reference — subpackage_posts. One Spectral-compliant resource per consumed operation, prefixed with /v1. resources: - path: /v1/publications/{publicationid}/posts name: publications-publicationid-posts description: REST surface for publications-publicationId-posts. operations: - method: POST name: create description: 'Create post OAuth Scope: posts:write' call: beehiiv-subpackage-posts.create with: publicationId: rest.publicationId Authorization: rest.Authorization body: rest.body outputParameters: - type: object mapping: $. - method: GET name: index description: 'List posts OAuth Scope: posts:read' call: beehiiv-subpackage-posts.index with: publicationId: rest.publicationId expand: rest.expand audience: rest.audience platform: rest.platform status: rest.status content_tags[]: rest.content_tags[] slugs[]: rest.slugs[] authors[]: rest.authors[] premium_tiers: rest.premium_tiers limit: rest.limit page: rest.page order_by: rest.order_by direction: rest.direction hidden_from_feed: rest.hidden_from_feed Authorization: rest.Authorization outputParameters: - type: object mapping: $. - path: /v1/publications/{publicationid}/posts/aggregate-stats name: publications-publicationid-posts-aggregate-stats description: REST surface for publications-publicationId-posts-aggregate_stats. operations: - method: GET name: aggregatestats description: 'Get aggregate stats OAuth Scope: posts:read' call: beehiiv-subpackage-posts.aggregatestats with: publicationId: rest.publicationId audience: rest.audience platform: rest.platform status: rest.status content_tags[]: rest.content_tags[] authors[]: rest.authors[] hidden_from_feed: rest.hidden_from_feed Authorization: rest.Authorization outputParameters: - type: object mapping: $. - path: /v1/publications/{publicationid}/posts/{postid} name: publications-publicationid-posts-postid description: REST surface for publications-publicationId-posts-postId. operations: - method: PATCH name: update description: 'Update post OAuth Scope: posts:write' call: beehiiv-subpackage-posts.update with: publicationId: rest.publicationId postId: rest.postId Authorization: rest.Authorization body: rest.body outputParameters: - type: object mapping: $. - method: GET name: show description: 'Get post OAuth Scope: posts:read' call: beehiiv-subpackage-posts.show with: publicationId: rest.publicationId postId: rest.postId expand: rest.expand premium_tiers: rest.premium_tiers Authorization: rest.Authorization outputParameters: - type: object mapping: $. - method: DELETE name: delete description: 'Delete post OAuth Scope: posts:write' call: beehiiv-subpackage-posts.delete with: publicationId: rest.publicationId postId: rest.postId Authorization: rest.Authorization outputParameters: - type: object mapping: $. - type: mcp namespace: beehiiv-subpackage-posts-mcp port: 9090 transport: http description: MCP adapter for API Reference — subpackage_posts. One tool per consumed operation, routed inline through this capability's consumes block. tools: - name: create-post-badge-intent-info-minimal description: 'Create post OAuth Scope: posts:write' hints: readOnly: false destructive: false idempotent: false call: beehiiv-subpackage-posts.create with: publicationId: tools.publicationId Authorization: tools.Authorization body: tools.body outputParameters: - type: object mapping: $. - name: list-posts-badge-intent-info-minimal description: 'List posts OAuth Scope: posts:read' hints: readOnly: true destructive: false idempotent: true call: beehiiv-subpackage-posts.index with: publicationId: tools.publicationId expand: tools.expand audience: tools.audience platform: tools.platform status: tools.status content_tags[]: tools.content_tags[] slugs[]: tools.slugs[] authors[]: tools.authors[] premium_tiers: tools.premium_tiers limit: tools.limit page: tools.page order_by: tools.order_by direction: tools.direction hidden_from_feed: tools.hidden_from_feed Authorization: tools.Authorization outputParameters: - type: object mapping: $. - name: get-aggregate-stats-badge-intent-info description: 'Get aggregate stats OAuth Scope: posts:read' hints: readOnly: true destructive: false idempotent: true call: beehiiv-subpackage-posts.aggregatestats with: publicationId: tools.publicationId audience: tools.audience platform: tools.platform status: tools.status content_tags[]: tools.content_tags[] authors[]: tools.authors[] hidden_from_feed: tools.hidden_from_feed Authorization: tools.Authorization outputParameters: - type: object mapping: $. - name: update-post-badge-intent-info-minimal description: 'Update post OAuth Scope: posts:write' hints: readOnly: false destructive: false idempotent: true call: beehiiv-subpackage-posts.update with: publicationId: tools.publicationId postId: tools.postId Authorization: tools.Authorization body: tools.body outputParameters: - type: object mapping: $. - name: get-post-badge-intent-info-minimal description: 'Get post OAuth Scope: posts:read' hints: readOnly: true destructive: false idempotent: true call: beehiiv-subpackage-posts.show with: publicationId: tools.publicationId postId: tools.postId expand: tools.expand premium_tiers: tools.premium_tiers Authorization: tools.Authorization outputParameters: - type: object mapping: $. - name: delete-post-badge-intent-info-minimal description: 'Delete post OAuth Scope: posts:write' hints: readOnly: false destructive: true idempotent: true call: beehiiv-subpackage-posts.delete with: publicationId: tools.publicationId postId: tools.postId Authorization: tools.Authorization outputParameters: - type: object mapping: $.