{
"opencollection": "1.0.0",
"info": {
"name": "API Reference subpackage_advertisement_opportunities subpackage_polls API",
"version": "1.0.0"
},
"items": [
{
"info": {
"name": "subpackage_polls",
"type": "folder"
},
"items": [
{
"info": {
"name": "List polls OAuth Scope: polls:read",
"type": "http"
},
"http": {
"method": "GET",
"url": "https://api.beehiiv.com/v2/publications/:publicationId/polls",
"headers": [
{
"name": "Authorization",
"value": ""
}
],
"params": [
{
"name": "publicationId",
"value": "",
"type": "path",
"description": "The prefixed ID of the publication object"
},
{
"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": "cursor",
"value": "",
"type": "query",
"description": "**Cursor-based pagination (recommended)**: Use this opaque cursor token to fetch the next page of results. When provided, pagination will use cursor-based method which is more efficient and consistent than offset-based pagination."
},
{
"name": "page",
"value": "",
"type": "query",
"description": "**Offset-based pagination (deprecated)**: Page number for offset-based pagination. Please migrate to cursor-based pagination using the `cursor` parameter. 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 the poll was created.
`name` - The name of the poll."
},
{
"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": "expand[]",
"value": "",
"type": "query",
"description": "Optionally expand the response to include additional data.
`stats` - Returns aggregate vote counts per choice and total completions.
`poll_responses` - Returns up to 10 most recent subscriber responses. Use /polls/{pollId}/responses for paginated access to all responses.
`trivia_answer` - Returns the correct answer for trivia-type polls."
},
{
"name": "post_id",
"value": "",
"type": "query",
"description": "Filter to only return polls that were embedded in the specified post. Accepts a prefixed post ID (e.g. `post_abc123`)."
}
]
},
"docs": "Retrieve all polls belonging to a specific publication. Poll choices are always included. Use `expand[]=stats` to include aggregate vote counts per choice."
},
{
"info": {
"name": "Get poll OAuth Scope: polls:read",
"type": "http"
},
"http": {
"method": "GET",
"url": "https://api.beehiiv.com/v2/publications/:publicationId/polls/:pollId",
"headers": [
{
"name": "Authorization",
"value": ""
}
],
"params": [
{
"name": "publicationId",
"value": "",
"type": "path",
"description": "The prefixed ID of the publication object"
},
{
"name": "pollId",
"value": "",
"type": "path",
"description": "The prefixed ID of the poll object"
},
{
"name": "expand[]",
"value": "",
"type": "query",
"description": "Optionally expand the response to include additional data.
`stats` - Returns aggregate vote counts per choice and total completions.
`poll_responses` - Returns up to 10 most recent subscriber responses. Use /polls/{pollId}/responses for paginated access to all responses.
`trivia_answer` - Returns the correct answer for trivia-type polls."
}
]
},
"docs": "Retrieve detailed information about a specific poll belonging to a publication. Use `expand[]=stats` for aggregate vote counts, or `expand[]=poll_responses` for individual subscriber responses."
},
{
"info": {
"name": "List poll responses OAuth Scope: polls:read",
"type": "http"
},
"http": {
"method": "GET",
"url": "https://api.beehiiv.com/v2/publications/:publicationId/polls/:pollId/responses",
"headers": [
{
"name": "Authorization",
"value": ""
}
],
"params": [
{
"name": "publicationId",
"value": "",
"type": "path",
"description": "The prefixed ID of the publication object"
},
{
"name": "pollId",
"value": "",
"type": "path",
"description": "The prefixed ID of the poll object"
},
{
"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": "cursor",
"value": "",
"type": "query",
"description": "**Cursor-based pagination (recommended)**: Use this opaque cursor token to fetch the next page of results."
},
{
"name": "page",
"value": "",
"type": "query",
"description": "**Offset-based pagination (deprecated)**: Page number for offset-based pagination."
},
{
"name": "order_by",
"value": "",
"type": "query",
"description": "The field that the results are sorted by. Defaults to created."
},
{
"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": "expand[]",
"value": "",
"type": "query",
"description": "Optionally expand the response to include additional data.
`post` - Returns the post title and publication date for the post where each response was collected."
},
{
"name": "post_id",
"value": "",
"type": "query",
"description": "Filter to only return responses collected via the specified post. Accepts a prefixed post ID (e.g. `post_abc123`)."
}
]
},
"docs": "Retrieve all individual subscriber responses for a specific poll with cursor-based pagination. Use this endpoint for large datasets instead of the `expand[]=poll_responses` parameter on the poll show endpoint."
}
]
}
],
"bundled": true
}