beehiiv Polls API
The Polls API from beehiiv — 3 operation(s) for polls.
Operations 3
Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay
The Polls API from beehiiv — 3 operation(s) for polls.
Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/beehiiv:beehiiv-polls-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Reference Polls API
version: 1.0.0
servers:
- url: https://api.beehiiv.com/v2
description: Default
tags:
- name: Polls
paths:
/publications/{publicationId}/polls:
get:
operationId: index
summary: 'List polls OAuth Scope: polls:read'
description: Retrieve all polls belonging to a specific publication. Poll choices are always included. Use `expand[]=stats` to include aggregate vote counts per choice.
tags:
- Polls
parameters:
- name: publicationId
in: path
description: The prefixed ID of the publication object
required: true
schema:
$ref: '#/components/schemas/type_ids_PublicationId'
- name: limit
in: 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.
required: false
schema:
type: integer
- name: cursor
in: 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.'
required: false
schema:
type: string
- name: page
in: 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.'
required: false
schema:
type: integer
- name: order_by
in: query
description: The field that the results are sorted by. Defaults to created.<br> `created` - The time the poll was created.<br> `name` - The name of the poll.
required: false
schema:
$ref: '#/components/schemas/type_polls_PollOrderBy'
- name: direction
in: query
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 to smallest.
required: false
schema:
$ref: '#/components/schemas/type__RequestDirection'
- name: expand[]
in: query
description: Optionally expand the response to include additional data.<br> `stats` - Returns aggregate vote counts per choice and total completions.<br> `poll_responses` - Returns up to 10 most recent subscriber responses. Use /polls/{pollId}/responses for paginated access to all responses.<br> `trivia_answer` - Returns the correct answer for trivia-type polls.
required: false
schema:
type: array
items:
$ref: '#/components/schemas/type_polls_PollsExpandItems'
- name: post_id
in: query
description: Filter to only return polls that were embedded in the specified post. Accepts a prefixed post ID (e.g. `post_abc123`).
required: false
schema:
type: string
- name: Authorization
in: header
description: Bearer authentication
required: true
schema:
type: string
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/type_polls_PollsListResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/type__Error'
'401':
description: Unauthorized. The API key or OAuth access token is missing, invalid, or expired.
content:
application/json:
schema:
$ref: '#/components/schemas/type__Error'
'404':
description: Resource Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/type__Error'
'429':
description: Rate Limit Exceeded
content:
application/json:
schema:
$ref: '#/components/schemas/type__Error'
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/type__Error'
/publications/{publicationId}/polls/{pollId}:
get:
operationId: show
summary: 'Get poll OAuth Scope: polls:read'
description: 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.
tags:
- Polls
parameters:
- name: publicationId
in: path
description: The prefixed ID of the publication object
required: true
schema:
$ref: '#/components/schemas/type_ids_PublicationId'
- name: pollId
in: path
description: The prefixed ID of the poll object
required: true
schema:
$ref: '#/components/schemas/type_ids_PollId'
- name: expand[]
in: query
description: Optionally expand the response to include additional data.<br> `stats` - Returns aggregate vote counts per choice and total completions.<br> `poll_responses` - Returns up to 10 most recent subscriber responses. Use /polls/{pollId}/responses for paginated access to all responses.<br> `trivia_answer` - Returns the correct answer for trivia-type polls.
required: false
schema:
type: array
items:
$ref: '#/components/schemas/type_polls_PollsExpandItems'
- name: Authorization
in: header
description: Bearer authentication
required: true
schema:
type: string
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/type_polls_PollShowResponse'
'401':
description: Unauthorized. The API key or OAuth access token is missing, invalid, or expired.
content:
application/json:
schema:
$ref: '#/components/schemas/type__Error'
'404':
description: Resource Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/type__Error'
'429':
description: Rate Limit Exceeded
content:
application/json:
schema:
$ref: '#/components/schemas/type__Error'
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/type__Error'
/publications/{publicationId}/polls/{pollId}/responses:
get:
operationId: list-responses
summary: 'List poll responses OAuth Scope: polls:read'
description: 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.
tags:
- Polls
parameters:
- name: publicationId
in: path
description: The prefixed ID of the publication object
required: true
schema:
$ref: '#/components/schemas/type_ids_PublicationId'
- name: pollId
in: path
description: The prefixed ID of the poll object
required: true
schema:
$ref: '#/components/schemas/type_ids_PollId'
- name: limit
in: 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.
required: false
schema:
type: integer
- name: cursor
in: query
description: '**Cursor-based pagination (recommended)**: Use this opaque cursor token to fetch the next page of results.'
required: false
schema:
type: string
- name: page
in: query
description: '**Offset-based pagination (deprecated)**: Page number for offset-based pagination.'
required: false
schema:
type: integer
- name: order_by
in: query
description: The field that the results are sorted by. Defaults to created.
required: false
schema:
$ref: '#/components/schemas/type_polls_PollResponsesOrderBy'
- name: direction
in: query
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 to smallest.
required: false
schema:
$ref: '#/components/schemas/type__RequestDirection'
- name: expand[]
in: query
description: Optionally expand the response to include additional data.<br> `post` - Returns the post title and publication date for the post where each response was collected.
required: false
schema:
type: array
items:
$ref: '#/components/schemas/type_polls_PollResponsesExpandItems'
- name: post_id
in: query
description: Filter to only return responses collected via the specified post. Accepts a prefixed post ID (e.g. `post_abc123`).
required: false
schema:
type: string
- name: Authorization
in: header
description: Bearer authentication
required: true
schema:
type: string
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/type_polls_PollResponsesListResponse'
'401':
description: Unauthorized. The API key or OAuth access token is missing, invalid, or expired.
content:
application/json:
schema:
$ref: '#/components/schemas/type__Error'
'404':
description: Resource Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/type__Error'
'429':
description: Rate Limit Exceeded
content:
application/json:
schema:
$ref: '#/components/schemas/type__Error'
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/type__Error'
components:
schemas:
type_polls_PollType:
type: string
enum:
- voting
- trivia
title: PollType
type_ids_PublicationId:
type: string
description: The prefixed ID of the publication.
title: PublicationId
type_ids_PollId:
type: string
description: The prefixed ID of the poll.
title: PollId
type_polls_PollOrderBy:
type: string
enum:
- created
- name
default: created
title: PollOrderBy
type_ids_SubscriptionId:
type: string
description: The prefixed ID of the subscription.
title: SubscriptionId
type_polls_PollResponseItem:
type: object
properties:
id:
type: string
description: The unique identifier of the poll response.
subscription_id:
$ref: '#/components/schemas/type_ids_SubscriptionId'
description: The prefixed ID of the subscription that responded. Null if the subscription has been permanently deleted.
subscription_deleted:
type: boolean
description: Whether the associated subscription has been deleted or permanently removed.
poll_choice_id:
type: string
description: The UUID of the poll choice selected.
poll_choice_label:
type: string
description: The text label of the poll choice selected.
created_at:
type: integer
description: The time the response was created. Measured in seconds since the Unix epoch.
extended_feedback:
type: string
description: Optional extended feedback provided by the subscriber.
post_id:
type: string
description: The prefixed ID of the post where the response was collected. Only included when `expand[]=post` is specified.
post_title:
type: string
description: The title of the post where the response was collected. Only included when `expand[]=post` is specified.
post_publish_date:
type: integer
description: The scheduled publication date of the post where the response was collected. Measured in seconds since the Unix epoch. Only included when `expand[]=post` is specified. Null if the post is not yet scheduled.
required:
- id
- subscription_deleted
- poll_choice_id
- created_at
title: PollResponseItem
type__RequestDirection:
type: string
enum:
- asc
- desc
default: asc
description: The direction of the request. Defaults to `asc`.
title: RequestDirection
type__Error:
type: object
properties:
status:
type: integer
statusText:
type: string
errors:
type: array
items:
$ref: '#/components/schemas/type__ErrorDetail'
required:
- status
- statusText
- errors
description: The top level error response.
title: Error
type_polls_Poll:
type: object
properties:
id:
$ref: '#/components/schemas/type_ids_PollId'
description: The prefixed ID of the poll.
name:
type: string
description: The name of the poll.
question:
type: string
description: The poll question text.
description:
type: string
description: An optional description of the poll.
poll_type:
$ref: '#/components/schemas/type_polls_PollType'
description: The type of poll.
status:
$ref: '#/components/schemas/type_polls_PollStatus'
description: The current status of the poll.
created_at:
type: integer
description: The time the poll was created. Measured in seconds since the Unix epoch.
poll_choices:
type: array
items:
$ref: '#/components/schemas/type_polls_PollChoice'
description: The available choices for this poll.
trivia_answer:
type: string
description: The correct answer for trivia-type polls. Only included when `expand[]=trivia_answer` is specified and the poll is of type trivia.
stats:
$ref: '#/components/schemas/type_polls_PollStats'
description: Aggregate statistics for the poll. Only included when `expand[]=stats` is specified.
total_responses:
type: integer
description: Total number of responses to this poll. Only included when `expand[]=poll_responses` is specified.
poll_responses:
type: array
items:
$ref: '#/components/schemas/type_polls_PollResponseItem'
description: Up to 10 most recent subscriber responses. Only included when `expand[]=poll_responses` is specified. Use /polls/{pollId}/responses for paginated access to all responses.
required:
- id
- name
- question
- poll_type
- status
- created_at
- poll_choices
title: Poll
type_polls_PollShowResponse:
type: object
properties:
data:
$ref: '#/components/schemas/type_polls_Poll'
required:
- data
title: PollShowResponse
type_polls_PollResponsesListResponse:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/type_polls_PollResponseItem'
description: An array of poll responses.
limit:
type: integer
description: The limit placed on the results. If no limit was specified in the request, this defaults to 10.
page:
type: integer
default: 1
description: '**Offset pagination only**: The page number the results are from. Only present when using deprecated offset-based pagination.'
total_pages:
type: integer
description: '**Offset pagination only**: The total number of pages. Only present when using deprecated offset-based pagination.'
has_more:
type: boolean
description: '**Cursor pagination only**: Indicates whether there are more results available after the current page.'
next_cursor:
type: string
description: '**Cursor pagination only**: The cursor token to use for fetching the next page of results.'
total_results:
type: integer
description: The total number of results from all pages.
required:
- data
title: PollResponsesListResponse
type_polls_PollStatus:
type: string
enum:
- draft
- published
title: PollStatus
type__ErrorDetail:
type: object
properties:
message:
type: string
code:
type: string
required:
- message
- code
title: ErrorDetail
type_polls_PollChoice:
type: object
properties:
id:
type: string
description: The unique identifier of the poll choice.
label:
type: string
description: The text label for this choice.
required:
- id
- label
title: PollChoice
type_polls_PollResponsesExpandItems:
type: string
enum:
- post
title: PollResponsesExpandItems
type_polls_PollStats:
type: object
properties:
completions:
type: integer
description: The total number of responses to this poll.
vote_counts:
type: object
additionalProperties:
type: integer
description: A map of poll choice labels to the number of votes each choice received.
required:
- completions
- vote_counts
title: PollStats
type_polls_PollsExpandItems:
type: string
enum:
- stats
- poll_responses
- trivia_answer
title: PollsExpandItems
type_polls_PollsListResponse:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/type_polls_Poll'
description: An array of polls.
limit:
type: integer
description: The limit placed on the results. If no limit was specified in the request, this defaults to 10.
page:
type: integer
default: 1
description: '**Offset pagination only**: The page number the results are from. Only present when using deprecated offset-based pagination.'
total_pages:
type: integer
description: '**Offset pagination only**: The total number of pages. Only present when using deprecated offset-based pagination.'
has_more:
type: boolean
description: '**Cursor pagination only**: Indicates whether there are more results available after the current page. Only present when using cursor-based pagination.'
next_cursor:
type: string
description: '**Cursor pagination only**: The cursor token to use for fetching the next page of results. This will be null if has_more is false. Only present when using cursor-based pagination.'
total_results:
type: integer
description: The total number of results from all pages.
required:
- data
title: PollsListResponse
type_polls_PollResponsesOrderBy:
type: string
enum:
- created
default: created
title: PollResponsesOrderBy
securitySchemes:
BearerAuthScheme:
type: http
scheme: bearer