> 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.

# Get referral program <Badge intent="info" minimal outlined>OAuth Scope: referral_program:read</Badge>

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

Retrieve details about the publication's referral program, including milestones and rewards.

Reference: https://developers.beehiiv.com/api-reference/referral-program/show

## 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.
- `page` (integer, optional) — 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.

## Response

### 200

OK

- `data` (list of Milestone, required) — A list of the milestones related to this publication's referral program.
- `limit` (integer, required) — The limit placed on the results. If no limit was specified in the request,this defaults to 10.
- `page` (integer, required, default: 1) — The page number the results are from. If no page was specified in the request, this defaults to page 1.
- `total_results` (integer, required) — The total number of results from all pages.
- `total_pages` (integer, required) — The total number of 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

### Milestone

The milestone object.

- `id` (string, required) — A unique prefixed id of the milestone.
- `auto_fulfill` (boolean, required) — Only available with a promo code reward type. This indicates that an email will automatically be sent when the milestone is reached containing the reward promo code.
- `num_referrals` (integer, required) — The number of referrals needed to reach this milestone.
- `reward` (MilestoneReward, required) — The reward object.

### ErrorDetail

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

### MilestoneReward

The reward object.

- `id` (string, required) — A unique prefixed id of the reward.
- `name` (string, required) — The name given to the reward at creation.
- `description` (string, required) — The description given to the name at creation.
- `image_url` (string, required) — A URL of an image to be displayed with the reward.
- `type` (enum, required) — What type of reward this is.`physical` - A product which must be sent to the subscriber.`promo_code` - A code that is redeemable for goods or services.
  - Allowed values: `physical`, `promo_code`, `digital`, `premium_gift`

## Examples

**Response**

```json
{
  "data": [
    {
      "id": "mile_00000000-0000-0000-0000-000000000000",
      "auto_fulfill": true,
      "num_referrals": 1,
      "reward": {
        "id": "rew_00000000-0000-0000-0000-000000000000",
        "name": "name",
        "description": "description",
        "image_url": "image_url",
        "type": "physical"
      }
    }
  ],
  "limit": 1,
  "page": 1,
  "total_results": 1,
  "total_pages": 1
}
```

**SDK Code**

```typescript
import { BeehiivClient } from "beehiiv";

const client = new BeehiivClient({ token: "YOUR_TOKEN" });
await client.referralProgram.get("pub_00000000-0000-0000-0000-000000000000");

```

```python
import requests

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

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

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

print(response.json())
```

```go
package main

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

func main() {

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

	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
require 'uri'
require 'net/http'

url = URI("https://api.beehiiv.com/v2/publications/pub_00000000-0000-0000-0000-000000000000/referral_program")

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
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/referral_program")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?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/referral_program', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp
using RestSharp;

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

```swift
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/referral_program")! 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()
```