> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.beehiiv.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.beehiiv.com/_mcp/server.

# List polls <Badge intent="info" minimal outlined>OAuth Scope: polls:read</Badge>

GET https://api.beehiiv.com/v2/publications/{publicationId}/polls

Retrieve all polls belonging to a specific publication. Poll choices are always included. Use `expand[]=stats` to include aggregate vote counts per choice.

Reference: https://developers.beehiiv.com/api-reference/polls/index

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `publicationId` (string, required) — The prefixed ID of the publication object

### Query parameters

- `limit` (integer, optional) — A limit on the number of objects to be returned. The limit can range between 1 and 100, and the default is 10.
- `cursor` (string, optional) — **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.
- `page` (integer, optional) — **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.
- `order_by` (enum, optional, default: created) — The field that the results are sorted by. Defaults to created. `created` - The time the poll was created. `name` - The name of the poll.
  - Allowed values: `created`, `name`
- `direction` (enum, optional, default: asc) — 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.
  - Allowed values: `asc`, `desc`
- `expand[]` (list of enum, optional) — 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.
  - Allowed values: `stats`, `poll_responses`, `trivia_answer`
- `post_id` (string, optional) — Filter to only return polls that were embedded in the specified post. Accepts a prefixed post ID (e.g. `post_abc123`).

## Response

### 200

OK

- `data` (list of Poll, required) — An array of polls.
- `limit` (integer, optional) — The limit placed on the results. If no limit was specified in the request, this defaults to 10.
- `page` (integer, optional, default: 1) — **Offset pagination only**: The page number the results are from. Only present when using deprecated offset-based pagination.
- `total_pages` (integer, optional) — **Offset pagination only**: The total number of pages. Only present when using deprecated offset-based pagination.
- `has_more` (boolean, optional) — **Cursor pagination only**: Indicates whether there are more results available after the current page. Only present when using cursor-based pagination.
- `next_cursor` (string, optional) — **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` (integer, optional) — The total number of results from all pages.

## Errors

### 400 Bad Request Error

Bad Request

- `status` (integer, required)
- `statusText` (string, required)
- `errors` (list of ErrorDetail, required)

### 401 Unauthorized Error

Unauthorized. The API key or OAuth access token is missing, invalid, or expired.

- `status` (integer, required)
- `statusText` (string, required)
- `errors` (list of ErrorDetail, required)

### 404 Not Found Error

Resource Not Found

- `status` (integer, required)
- `statusText` (string, required)
- `errors` (list of ErrorDetail, required)

### 429 Too Many Requests Error

Rate Limit Exceeded

- `status` (integer, required)
- `statusText` (string, required)
- `errors` (list of ErrorDetail, required)

### 500 Internal Server Error

Internal Server Error

- `status` (integer, required)
- `statusText` (string, required)
- `errors` (list of ErrorDetail, required)

## Types

### Poll

- `id` (string, required) — The prefixed ID of the poll.
- `name` (string, required) — The name of the poll.
- `question` (string, required) — The poll question text.
- `poll_type` (enum, required) — The type of poll.
  - Allowed values: `voting`, `trivia`
- `status` (enum, required) — The current status of the poll.
  - Allowed values: `draft`, `published`
- `created_at` (integer, required) — The time the poll was created. Measured in seconds since the Unix epoch.
- `poll_choices` (list of PollChoice, required) — The available choices for this poll.
- `description` (string, optional) — An optional description of the poll.
- `trivia_answer` (string, optional) — The correct answer for trivia-type polls. Only included when `expand[]=trivia_answer` is specified and the poll is of type trivia.
- `stats` (PollStats, optional) — Aggregate statistics for the poll. Only included when `expand[]=stats` is specified.
- `total_responses` (integer, optional) — Total number of responses to this poll. Only included when `expand[]=poll_responses` is specified.
- `poll_responses` (list of PollResponseItem, optional) — 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.

### ErrorDetail

- `message` (string, required)
- `code` (string, required)

### PollChoice

- `id` (string, required) — The unique identifier of the poll choice.
- `label` (string, required) — The text label for this choice.

### PollStats

- `completions` (integer, required) — The total number of responses to this poll.
- `vote_counts` (map from string to integer, required) — A map of poll choice labels to the number of votes each choice received.

### PollResponseItem

- `id` (string, required) — The unique identifier of the poll response.
- `subscription_deleted` (boolean, required) — Whether the associated subscription has been deleted or permanently removed.
- `poll_choice_id` (string, required) — The UUID of the poll choice selected.
- `created_at` (integer, required) — The time the response was created. Measured in seconds since the Unix epoch.
- `subscription_id` (string, optional) — The prefixed ID of the subscription that responded. Null if the subscription has been permanently deleted.
- `poll_choice_label` (string, optional) — The text label of the poll choice selected.
- `extended_feedback` (string, optional) — Optional extended feedback provided by the subscriber.
- `post_id` (string, optional) — The prefixed ID of the post where the response was collected. Only included when `expand[]=post` is specified.
- `post_title` (string, optional) — The title of the post where the response was collected. Only included when `expand[]=post` is specified.
- `post_publish_date` (integer, optional) — 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.

## Examples

### Cursor-based pagination

**Response**

```json
{
  "data": [
    {
      "id": "poll_00000000-0000-0000-0000-000000000000",
      "name": "Favorite Color",
      "question": "What is your favorite color?",
      "poll_type": "voting",
      "status": "published",
      "created_at": 1666800076,
      "poll_choices": [
        {
          "id": "00000000-0000-0000-0000-000000000001",
          "label": "Red"
        },
        {
          "id": "00000000-0000-0000-0000-000000000002",
          "label": "Blue"
        },
        {
          "id": "00000000-0000-0000-0000-000000000003",
          "label": "Green"
        }
      ],
      "description": "Choose an answer from the list below."
    }
  ],
  "limit": 10,
  "has_more": false,
  "next_cursor": null
}
```

**SDK Code**

```python Cursor-based pagination
import requests

url = "https://api.beehiiv.com/v2/publications/pub_00000000-0000-0000-0000-000000000000/polls"

querystring = {"limit":"10"}

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript Cursor-based pagination
const url = 'https://api.beehiiv.com/v2/publications/pub_00000000-0000-0000-0000-000000000000/polls?limit=10';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Cursor-based pagination
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.beehiiv.com/v2/publications/pub_00000000-0000-0000-0000-000000000000/polls?limit=10"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Cursor-based pagination
require 'uri'
require 'net/http'

url = URI("https://api.beehiiv.com/v2/publications/pub_00000000-0000-0000-0000-000000000000/polls?limit=10")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java Cursor-based pagination
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.beehiiv.com/v2/publications/pub_00000000-0000-0000-0000-000000000000/polls?limit=10")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Cursor-based pagination
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.beehiiv.com/v2/publications/pub_00000000-0000-0000-0000-000000000000/polls?limit=10', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp Cursor-based pagination
using RestSharp;

var client = new RestClient("https://api.beehiiv.com/v2/publications/pub_00000000-0000-0000-0000-000000000000/polls?limit=10");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Cursor-based pagination
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.beehiiv.com/v2/publications/pub_00000000-0000-0000-0000-000000000000/polls?limit=10")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### With stats expansion

**Response**

```json
{
  "data": [
    {
      "id": "poll_00000000-0000-0000-0000-000000000000",
      "name": "Favorite Color",
      "question": "What is your favorite color?",
      "poll_type": "voting",
      "status": "published",
      "created_at": 1666800076,
      "poll_choices": [
        {
          "id": "00000000-0000-0000-0000-000000000001",
          "label": "Red"
        },
        {
          "id": "00000000-0000-0000-0000-000000000002",
          "label": "Blue"
        },
        {
          "id": "00000000-0000-0000-0000-000000000003",
          "label": "Green"
        }
      ],
      "description": "Choose an answer from the list below.",
      "stats": {
        "completions": 150,
        "vote_counts": {
          "Red": 75,
          "Blue": 50,
          "Green": 25
        }
      }
    }
  ],
  "limit": 10,
  "has_more": false,
  "next_cursor": null
}
```

**SDK Code**

```python With stats expansion
import requests

url = "https://api.beehiiv.com/v2/publications/pub_00000000-0000-0000-0000-000000000000/polls"

querystring = {"limit":"10","expand[]":"[\"stats\"]"}

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript With stats expansion
const url = 'https://api.beehiiv.com/v2/publications/pub_00000000-0000-0000-0000-000000000000/polls?limit=10&expand%5B%5D=%5B%22stats%22%5D';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go With stats expansion
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.beehiiv.com/v2/publications/pub_00000000-0000-0000-0000-000000000000/polls?limit=10&expand%5B%5D=%5B%22stats%22%5D"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby With stats expansion
require 'uri'
require 'net/http'

url = URI("https://api.beehiiv.com/v2/publications/pub_00000000-0000-0000-0000-000000000000/polls?limit=10&expand%5B%5D=%5B%22stats%22%5D")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java With stats expansion
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.beehiiv.com/v2/publications/pub_00000000-0000-0000-0000-000000000000/polls?limit=10&expand%5B%5D=%5B%22stats%22%5D")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php With stats expansion
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.beehiiv.com/v2/publications/pub_00000000-0000-0000-0000-000000000000/polls?limit=10&expand%5B%5D=%5B%22stats%22%5D', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp With stats expansion
using RestSharp;

var client = new RestClient("https://api.beehiiv.com/v2/publications/pub_00000000-0000-0000-0000-000000000000/polls?limit=10&expand%5B%5D=%5B%22stats%22%5D");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift With stats expansion
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.beehiiv.com/v2/publications/pub_00000000-0000-0000-0000-000000000000/polls?limit=10&expand%5B%5D=%5B%22stats%22%5D")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Filtered by post

**Response**

```json
{
  "data": [
    {
      "id": "poll_00000000-0000-0000-0000-000000000000",
      "name": "Favorite Color",
      "question": "What is your favorite color?",
      "poll_type": "voting",
      "status": "published",
      "created_at": 1666800076,
      "poll_choices": [
        {
          "id": "00000000-0000-0000-0000-000000000001",
          "label": "Red"
        },
        {
          "id": "00000000-0000-0000-0000-000000000002",
          "label": "Blue"
        },
        {
          "id": "00000000-0000-0000-0000-000000000003",
          "label": "Green"
        }
      ],
      "description": "Choose an answer from the list below."
    }
  ],
  "limit": 10,
  "has_more": false,
  "next_cursor": null
}
```

**SDK Code**

```python Filtered by post
import requests

url = "https://api.beehiiv.com/v2/publications/pub_00000000-0000-0000-0000-000000000000/polls"

querystring = {"post_id":"post_00000000-0000-0000-0000-000000000000"}

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript Filtered by post
const url = 'https://api.beehiiv.com/v2/publications/pub_00000000-0000-0000-0000-000000000000/polls?post_id=post_00000000-0000-0000-0000-000000000000';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Filtered by post
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.beehiiv.com/v2/publications/pub_00000000-0000-0000-0000-000000000000/polls?post_id=post_00000000-0000-0000-0000-000000000000"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Filtered by post
require 'uri'
require 'net/http'

url = URI("https://api.beehiiv.com/v2/publications/pub_00000000-0000-0000-0000-000000000000/polls?post_id=post_00000000-0000-0000-0000-000000000000")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java Filtered by post
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.beehiiv.com/v2/publications/pub_00000000-0000-0000-0000-000000000000/polls?post_id=post_00000000-0000-0000-0000-000000000000")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Filtered by post
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.beehiiv.com/v2/publications/pub_00000000-0000-0000-0000-000000000000/polls?post_id=post_00000000-0000-0000-0000-000000000000', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp Filtered by post
using RestSharp;

var client = new RestClient("https://api.beehiiv.com/v2/publications/pub_00000000-0000-0000-0000-000000000000/polls?post_id=post_00000000-0000-0000-0000-000000000000");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Filtered by post
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.beehiiv.com/v2/publications/pub_00000000-0000-0000-0000-000000000000/polls?post_id=post_00000000-0000-0000-0000-000000000000")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```