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

# Create publication duplicate <Badge intent="info" minimal outlined>OAuth Scope: publications:write</Badge>

POST https://api.beehiiv.com/v2/publications/{publicationId}/duplicates
Content-Type: application/json

This is a gated feature that requires enablement. Contact support to enable Publication Duplication for your workspace.Creates a new publication in the same workspace, or copies into one you already have, and copies the parts of the source publication that don't hold subscriber data into it: custom fields, subscriber tags, newsletter lists, segments, post templates, the website design, automations, and optionally webhooks. Use it to stand up new publications from a template publication.The new publication is created immediately and the copy runs in the background, so this endpoint answers `202`. Poll the `Get publication duplicate` endpoint until the status is `completed`, `partial`, or `failed`.**Not copied:** subscribers, posts, billing records, and domains. Tag definitions are copied but not which subscribers have them.**Items that can't be copied:** segments whose conditions point at something that only exists on the source publication (a tier, specific post or email, poll, product, form, or another automation) are skipped and listed under `results`. A segment that uses a newsletter list is copied when `newsletter_lists` is copied too. Post templates used by a recurring series are skipped too. The status is `partial` when anything is skipped.**Request related components together:** a segment that uses a custom field or subscriber tag can only be copied when that custom field or tag is copied too, so include `custom_fields` and `subscriber_tags` alongside `segments`, and `newsletter_lists` for segments that use a list. Otherwise the segment is skipped and listed under `results`. System fields and tags exist in every publication and don't need to be requested. Automations create any segments, tags, or custom fields they need that are missing.**Copying into an existing publication:** send `destination_publication_id` instead of `name` to copy into a publication in the same workspace, such as one you duplicated earlier, to add anything it is missing. Nothing is created and the publication limit does not apply. Items the destination already has, matched by name ignoring case or as an earlier copy of the same item, are skipped and listed under `skipped` in `results` instead of being copied again, so repeating the request is safe. Existing items are never updated. Webhooks are matched by URL. The website design is skipped when the destination's site already has pages. Send either `name` or `destination_publication_id`, not both.This endpoint requires an API key with access to every publication in the workspace, and counts a new publication against the workspace's publication limit. When the workspace is at its limit the request is rejected with a `400` and the code `MAX_PUBLICATIONS_REACHED`.**Webhooks:** request `webhooks` to copy the source publication's webhooks. It is not copied by default, because the new webhooks start receiving the new publication's events as soon as they are created. Each new webhook has its own signing secret, returned under `results.webhooks.webhooks` once the duplicate has finished. Until then, and when a secret can't be retrieved, `signing_secret` is `null`, so poll again. With OAuth, requesting `webhooks` needs the `webhooks:write` scope and reading the secrets needs `webhooks:read`.Retrying a request is safe. If a duplicate with the same `name`, `description`, `subdomain`, `components` and `website_theme` was started from this publication within the last hour and has not failed, it is returned with `reused` set to `true` instead of creating another publication, even if it has already finished. A request that differs in any of these starts a new one, so several publications can be created from the same template. A request with `destination_publication_id` returns the duplicate for that publication and `components` only while it is still running; once it has finished, a new request starts another incremental duplication.If a duplicate ends with the status `failed`, its new publication is still in the workspace and still counts against the publication limit. Retrying after a failure creates another publication, so delete the one left behind first if you don't need it.

Reference: https://developers.beehiiv.com/api-reference/publication-duplicates/create

## 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 to copy

### Body (application/json)

This endpoint expects an object.

- `name` (string, optional) — The name of the new publication. Required unless `destination_publication_id` is given.
- `description` (string, optional) — The description of the new publication.
- `subdomain` (string, optional) — The subdomain of the new publication, as in `subdomain.beehiiv.com`. Generated from the name when omitted. A subdomain that is already taken is rejected with a `422`.
- `destination_publication_id` (string, optional) — The prefixed ID of an existing publication in the same workspace to copy into instead of creating a new one. Cannot be combined with `name`.
- `components` (list of enum, optional) — Which parts of the publication to copy. Defaults to every component except `webhooks` when omitted.
  - Allowed values: `custom_fields`, `subscriber_tags`, `newsletter_lists`, `segments`, `post_templates`, `website_design`, `automations`, `webhooks`
- `website_theme` (PublicationDuplicateWebsiteTheme, optional) — Theme changes applied to the copied website. Requires `website_design` to be copied, otherwise the request is rejected with a `400`.

## Response

### 202

Accepted

- `data` (PublicationDuplicate, optional)
- `reused` (boolean, optional) — True when this request matched a duplicate that was already started, and that duplicate is returned unchanged instead of a second publication being created. This is what makes retrying safe.

## 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)

### 403 Forbidden Error

Forbidden

- `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)

### 422 Unprocessable Entity Error

Unprocessable Entity

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

### PublicationDuplicateWebsiteTheme

Colors, fonts and styles applied to the new publication's website when `website_design` is copied. Colors are hex values such as `#030712`. Only the fields you send are changed.

- `primary_color` (string, optional)
- `text_on_primary_color` (string, optional)
- `secondary_color` (string, optional)
- `text_on_secondary_color` (string, optional)
- `tertiary_color` (string, optional)
- `text_on_tertiary_color` (string, optional)
- `background_color` (string, optional)
- `text_on_background_color` (string, optional)
- `subscribe_background_color` (string, optional)
- `text_on_subscribe_background_color` (string, optional)
- `border_color` (string, optional)
- `border_style` (string, optional) — One of `round`, `square`, or `circle`.
- `border_radius` (string, optional)
- `header_font` (string, optional)
- `body_font` (string, optional)
- `button_font` (string, optional)
- `content_theme` (string, optional) — One of `light`, `dark`, or `secondary`.
- `subscribe_theme` (string, optional) — One of `light`, `dark`, or `secondary`.
- `logo_shadow` (string, optional) — One of `none`, `sm`, `md`, or `lg`.
- `post_page_custom_css` (string, optional)

### PublicationDuplicate

- `id` (string, optional) — The ID of the publication duplicate
- `status` (enum, optional) — The status of the duplicate
  - Allowed values: `pending`, `processing`, `completed`, `partial`, `failed`
- `source_publication_id` (string, optional) — The publication that was copied
- `destination_publication_id` (string, optional) — The new publication the copy is being written into
- `components` (list of enum, optional) — The components that were requested
  - Allowed values: `custom_fields`, `subscriber_tags`, `newsletter_lists`, `segments`, `post_templates`, `website_design`, `automations`, `webhooks`
- `results` (PublicationDuplicateResults, optional) — Per-component results
- `completed` (integer, optional) — The timestamp of the duplicate's completion. Null until the status is `completed`, `partial`, or `failed`.
- `created` (integer, optional) — The timestamp of the duplicate's creation
- `updated` (integer, optional) — The timestamp of the duplicate's last update

### ErrorDetail

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

### PublicationDuplicateResults

Per-component results. Only the components that were requested are present, and the object is empty until the duplicate starts processing.

- `custom_fields` (PublicationDuplicateComponentResult, optional)
- `subscriber_tags` (PublicationDuplicateComponentResult, optional)
- `newsletter_lists` (PublicationDuplicateComponentResult, optional)
- `segments` (PublicationDuplicateComponentResult, optional)
- `post_templates` (PublicationDuplicateComponentResult, optional)
- `website_design` (PublicationDuplicateComponentResult, optional)
- `automations` (PublicationDuplicateComponentResult, optional)
- `webhooks` (PublicationDuplicateWebhooksResult, optional)

### PublicationDuplicateComponentResult

- `status` (enum, optional) — How copying this component went
  - Allowed values: `completed`, `partial`, `failed`
- `copied` (integer, optional) — The number of items copied into the new publication
- `failed` (list of string, optional) — The names of the items that could not be copied
- `skipped` (list of string, optional) — The names of the items that were not copied because the publication already had them. Only set when copying into an existing publication, and skipped items do not change the status.

### PublicationDuplicateWebhooksResult

- `copied` (integer, optional) — The number of items copied into the new publication
- `failed` (list of string, optional) — The names of the items that could not be copied
- `skipped` (list of string, optional) — The names of the items that were not copied because the publication already had them. Only set when copying into an existing publication, and skipped items do not change the status.
- `status` (enum, optional) — How copying this component went
  - Allowed values: `completed`, `partial`, `failed`
- `webhooks` (list of PublicationDuplicateWebhook, optional) — The webhooks created in the new publication

### PublicationDuplicateWebhook

- `id` (string, optional) — The ID of the webhook created in the new publication
- `url` (string, optional) — The URL the webhook sends events to
- `signing_secret` (string, optional) — The secret for verifying the new webhook's signatures. It differs from the source webhook's secret. Null until the duplicate has finished, when it could not be retrieved, when the API key cannot access the new publication, or when an OAuth token lacks the `webhooks:read` scope.

## Examples

**Request**

```json
{
  "name": "My Second Newsletter"
}
```

**Response**

```json
{
  "data": {
    "id": "pub_dup_00000000-0000-0000-0000-000000000000",
    "status": "pending",
    "source_publication_id": "pub_00000000-0000-0000-0000-000000000000",
    "destination_publication_id": "pub_11111111-1111-1111-1111-111111111111",
    "components": [
      "custom_fields",
      "subscriber_tags",
      "newsletter_lists",
      "segments",
      "post_templates",
      "website_design",
      "automations"
    ],
    "results": {},
    "created": 1666800076,
    "updated": 1666800076
  },
  "reused": false
}
```

**SDK Code**

```python
import requests

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

payload = { "name": "My Second Newsletter" }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.beehiiv.com/v2/publications/pub_00000000-0000-0000-0000-000000000000/duplicates';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"name":"My Second Newsletter"}'
};

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

```go
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"name\": \"My Second Newsletter\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	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/duplicates")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"My Second Newsletter\"\n}"

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.post("https://api.beehiiv.com/v2/publications/pub_00000000-0000-0000-0000-000000000000/duplicates")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"My Second Newsletter\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.beehiiv.com/v2/publications/pub_00000000-0000-0000-0000-000000000000/duplicates', [
  'body' => '{
  "name": "My Second Newsletter"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.beehiiv.com/v2/publications/pub_00000000-0000-0000-0000-000000000000/duplicates");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"My Second Newsletter\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["name": "My Second Newsletter"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.beehiiv.com/v2/publications/pub_00000000-0000-0000-0000-000000000000/duplicates")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```