Create publication duplicate OAuth Scope: publications:write

<Warning>This is a gated feature that requires enablement. Contact support to enable Publication Duplication for your workspace.</Warning> Creates a new publication in the same workspace and copies the parts of the source publication that don't hold subscriber data into it: custom fields, subscriber tags, segments, post templates, the website design, and automations. 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, newsletter list, specific post or email, poll, product, form, or another automation) are skipped and listed under `results`. 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`. 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. This endpoint requires an API key with access to every publication in the workspace, and counts the 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`. Retrying a request is safe. If a duplicate with the same `name` and `components` 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 with a different `name` or `components` starts a new one, so several publications can be created from the same template. 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.

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Path parameters

publicationIdstringRequiredformat: "^(pub_[0-9a-fA-F\-]+)$"
The prefixed ID of the publication to copy

Request

This endpoint expects an object.
namestringRequired2-100 characters
The name of the new publication.
componentslist of enumsOptional
Which parts of the publication to copy. Defaults to all of them when omitted.

Response

Accepted
dataobjectOptional
reusedbooleanOptional
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
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
422
Unprocessable Entity Error
429
Too Many Requests Error
500
Internal Server Error