Copy a template across projects
Duplicate a template — its published layout/design, variable manifest, and
everything needed to derive its jsonSchema — from a SOURCE project into
THIS (target) project, published as version 1. Both the source and target
project must be owned by the authenticated account. contentJson,
compiledHtml, variablesManifest, and pageConfig are carried over
verbatim, so the copy renders byte-for-byte identically to the source.
Idempotent: if the target project already has a non-deleted template at
the resolved slug, that template is returned as-is (200,
alreadyExisted: true) instead of erroring or creating a duplicate.
Authorizations
Account API key (ck_acct_…) presented as a bearer token. Distinct
credential system from bearerApiKey — validated against a separate
table, never against project keys or vice versa. Scoped to every
project owned by the account; used only by the /v1/projects*
endpoints below (each of which declares this scheme explicitly and
does not inherit the document-level bearerApiKey default). Minted
from the dashboard (Account → API keys) — there is no
programmatic endpoint that issues an account key.
Path Parameters
The project id.
Body
UUID of the source project. Provide this or sourceProjectSlug.
Slug of the source project, scoped to the authenticated account.
UUID of the template to copy, scoped to the source project. Provide this or sourceTemplateSlug.
Slug of the template to copy, scoped to the source project.
Display name for the copy. Omit to keep the source template's name and slug unchanged; when provided, the target slug is derived from it instead.
1 - 120Response
Idempotent replay — the target project already had a template at the resolved slug.
Response for POST /v1/projects/{id}/templates/copy. Identical shape for a freshly created copy (201) and an idempotent replay (200) — see alreadyExisted.
The target project (echoes the path id).
Always 1 for a freshly created copy.
The source's version number that was copied.
True when a pre-existing template at the target slug was returned instead of creating a duplicate.