Duplicate an existing project
Please note that the Dashboard API is an experimental, prerelease API. This API method is considered unstable, and should be avoided in production environments and automations. Changes may occur at any time without warning.
Query parameters
Confirm the operation, even if the copy of videos contained in the project requires significant use of Video Encoding resources
"true"
Body parameters
Site name
"My blog"
When duplicating a site it allows to duplicate only the schema
Type of recurrence (yearly/monthly)
"monthly"
Extra packets
{
users: 1,
locales: 1,
item_types: 0,
roles: 0,
build_triggers: 0,
access_tokens: 0,
mux_encoding_seconds: 0,
sandbox_environments: 0,
items: 0,
uploadable_bytes: 0,
}
Subscription plan
Billing profile
Returns
Returns a resource object of type site
Examples
import { buildClient } from "@datocms/dashboard-client";
async function run() { const client = buildClient({ apiToken: process.env.DATOCMS_API_TOKEN });
const siteId = "155";
const site = await client.sites.rawDuplicate(siteId, { type: "site_duplication", attributes: { name: "My blog" }, });
// Check the 'Returned output' tab for the result ☝️ console.log(site);}
run();{ type: "site", id: "155", attributes: { name: "My blog", domain: "admin.foobar.com", internal_domain: "clueless-star-1231.admin.datocms.com", last_data_change_at: "2020-04-21T07:57:11.124Z", access_token: "", created_at: "2020-04-21T07:57:11.124Z", deactivated: true, }, meta: { last_data_change_at: "2017-03-30T09:29:14.872Z", created_at: "2017-03-30T09:29:14.872Z", deactivated: true, status: "", owner: { type: "account", email: "mark@foobar.com" }, require_2fa: false, }, relationships: { active_subscription: { data: null }, active_plan: { data: null }, transfer: { data: { type: "site_transfer", id: "124" } }, },}