{ "opencollection": "1.0.0", "info": { "name": "API Reference subpackage_advertisement_opportunities subpackage_posts API", "version": "1.0.0" }, "items": [ { "info": { "name": "subpackage_posts", "type": "folder" }, "items": [ { "info": { "name": "List posts OAuth Scope: posts:read", "type": "http" }, "http": { "method": "GET", "url": "https://api.beehiiv.com/v2/publications/:publicationId/posts", "headers": [ { "name": "Authorization", "value": "" } ], "params": [ { "name": "publicationId", "value": "", "type": "path", "description": "The prefixed ID of the publication object" }, { "name": "expand", "value": "", "type": "query", "description": "Optionally expand the results by adding additional information.
`stats` - Adds statistics about the post(s).
`free_web_content` - Adds the web HTML rendered to a free reader.
`free_email_content` - Adds the email HTML rendered to a free reader.
`free_rss_content` - Adds the RSS feed HTML.
`premium_web_content` - Adds the web HTML rendered to a premium reader.
`premium_email_content` - Adds the email HTML rendered to a premium reader." }, { "name": "audience", "value": "", "type": "query", "description": "Optionally filter the results by audience" }, { "name": "platform", "value": "", "type": "query", "description": "Optionally filter the results by platform.
`web` - Posts only published to web.
`email` - Posts only published to email.
`both` - Posts published to email and web.
`all` - Does not restrict results by platform." }, { "name": "status", "value": "", "type": "query", "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`.
`archived` - The post is no longer active.
`all` - Does not restrict results by status." }, { "name": "content_tags[]", "value": "", "type": "query", "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_tags: [\"sales\",\"closing\"]` will return results of posts that have *either* `sales` or `closing` content_tags." }, { "name": "slugs[]", "value": "", "type": "query", "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: [\"my-first-post\",\"another-post\"]` will return results of posts that have *either* `my-first-post` or `another-post` as their slug." }, { "name": "authors[]", "value": "", "type": "query", "description": "Optionally filter posts by their authors. Adding an author name will return any post with that author associated to it (case-insensitive).

Example: Filtering for `authors: [\"John Doe\",\"Jane Smith\"]` will return results of posts that have *either* John Doe or Jane Smith as authors." }, { "name": "premium_tiers", "value": "", "type": "query", "description": "Optionally filter posts by audience based on premium tiers.
This takes in an array of Display Names of the premium tiers.
It will also scope any expanded content output to the specified premium tiers.
Note: This is case insensitive." }, { "name": "limit", "value": "", "type": "query", "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", "value": "", "type": "query", "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 page 1 will be returned." }, { "name": "order_by", "value": "", "type": "query", "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 post was set to be published.
`displayed_date` - The time displayed in place of the `publish_date`. If no `displayed_date` was set, it will default to the `publish_date`" }, { "name": "direction", "value": "", "type": "query", "description": "The direction that the results are sorted in. Defaults to asc
`asc` - Ascending, sorts from smallest to largest.
`desc` - Descending, sorts from largest to smallest." }, { "name": "hidden_from_feed", "value": "", "type": "query", "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 return posts hidden from the feed.
`false` - Only return posts that are visible on the feed." } ] }, "docs": "Retrieve all posts belonging to a specific publication" }, { "info": { "name": "Create post OAuth Scope: posts:write", "type": "http" }, "http": { "method": "POST", "url": "https://api.beehiiv.com/v2/publications/:publicationId/posts", "headers": [ { "name": "Authorization", "value": "" } ], "params": [ { "name": "publicationId", "value": "", "type": "path", "description": "The prefixed ID of the publication object" } ], "body": { "type": "json", "data": "{}" } }, "docs": "\n This feature is currently in beta, the API is subject to change, and available only to Enterprise users.

To inquire about Enterprise pricing,\n please visit our Enterprise page.\n
\nCreate a post for a specific publication. For a detailed walkthrough including setup, testing workflows, and working with custom HTML and templates, see the OAuth Scope: posts:read", "type": "http" }, "http": { "method": "GET", "url": "https://api.beehiiv.com/v2/publications/:publicationId/posts/:postId", "headers": [ { "name": "Authorization", "value": "" } ], "params": [ { "name": "publicationId", "value": "", "type": "path", "description": "The prefixed ID of the publication object" }, { "name": "postId", "value": "", "type": "path", "description": "The prefixed ID of the post object" }, { "name": "expand", "value": "", "type": "query", "description": "Optionally expand the results by adding additional information.
`stats` - Adds statistics about the post(s).
`free_web_content` - Adds the web HTML rendered to a free reader.
`free_email_content` - Adds the email HTML rendered to a free reader.
`free_rss_content` - Adds the RSS feed HTML.
`premium_web_content` - Adds the web HTML rendered to a premium reader.
`premium_email_content` - Adds the email HTML rendered to a premium reader." }, { "name": "premium_tiers", "value": "", "type": "query", "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 insensitive." } ] }, "docs": "Retrieve a single Post belonging to a specific publication" }, { "info": { "name": "Update post OAuth Scope: posts:write", "type": "http" }, "http": { "method": "PATCH", "url": "https://api.beehiiv.com/v2/publications/:publicationId/posts/:postId", "headers": [ { "name": "Authorization", "value": "" } ], "params": [ { "name": "publicationId", "value": "", "type": "path", "description": "The prefixed ID of the publication object" }, { "name": "postId", "value": "", "type": "path", "description": "The prefixed ID of the post to update" } ], "body": { "type": "json", "data": "{}" } }, "docs": "\n This feature is currently in beta, the API is subject to change, and available only to Enterprise users.

To inquire about Enterprise pricing,\n please visit our
Enterprise page.\n\nUpdate an existing post for a specific publication. Only the fields provided in the request body will be updated — all other fields remain unchanged. For a detailed walkthrough of content methods and working with" }, { "info": { "name": "Delete post OAuth Scope: posts:write", "type": "http" }, "http": { "method": "DELETE", "url": "https://api.beehiiv.com/v2/publications/:publicationId/posts/:postId", "headers": [ { "name": "Authorization", "value": "" } ], "params": [ { "name": "publicationId", "value": "", "type": "path", "description": "The prefixed ID of the publication object" }, { "name": "postId", "value": "", "type": "path", "description": "The prefixed ID of the post object" } ] }, "docs": "Delete or Archive a post. Any post that has been confirmed will have it's status changed to `archived`. Posts in the `draft` status will be permanently deleted." }, { "info": { "name": "Get aggregate stats OAuth Scope: posts:read", "type": "http" }, "http": { "method": "GET", "url": "https://api.beehiiv.com/v2/publications/:publicationId/posts/aggregate_stats", "headers": [ { "name": "Authorization", "value": "" } ], "params": [ { "name": "publicationId", "value": "", "type": "path", "description": "The prefixed ID of the publication object" }, { "name": "audience", "value": "", "type": "query", "description": "Optionally filter the results by audience" }, { "name": "platform", "value": "", "type": "query", "description": "Optionally filter the results by platform.
`web` - Posts only published to web.
`email` - Posts only published to email.
`both` - Posts published to email and web.
`all` - Does not restrict results by platform." }, { "name": "status", "value": "", "type": "query", "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`.
`archived` - The post is no longer active.
`all` - Does not restrict results by status." }, { "name": "content_tags[]", "value": "", "type": "query", "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_tags: [\"sales\",\"closing\"]` will return results of posts that have *either* sales or closing content_tags." }, { "name": "authors[]", "value": "", "type": "query", "description": "Optionally filter posts by their authors. Adding an author name will return any post with that author associated to it (case-insensitive).

Example: Filtering for `authors: [\"John Doe\",\"Jane Smith\"]` will return results of posts that have *either* John Doe or Jane Smith as authors." }, { "name": "hidden_from_feed", "value": "", "type": "query", "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 return posts hidden from the feed.
`false` - Only return posts that are visible on the feed." } ] }, "docs": "Retrieve aggregate stats for all posts" } ] } ], "bundled": true }