Sorry, no results found for "".

Show examples in:
Javascript HTTP

Content Management API > Environment

Fork an existing environment

Query parameters

immediate_return boolean

Whether the call should immediately return a pending environment, or wait for the completion of the fork

fast boolean

Performing a fast fork reduces processing time, but it also prevents writing to the source environment during the process

force boolean

Force the start of fast fork, even if there are collaborators editing some records

Body parameters

id string Required

The ID of the forked environment

Example: "my-sandbox-env"

Returns

Returns a resource object of type environment

Examples

import { buildClient } from "@datocms/cma-client-node";
async function run() {
const client = buildClient({ apiToken: process.env.DATOCMS_API_TOKEN });
const environmentId = "main";
const environment = await client.environments.fork(environmentId, {});
// Check the 'Returned output' tab for the result ☝️
console.log(environment);
}
run();
{
id: "main",
meta: {
status: "ready",
created_at: "2020-04-21T07:57:11.124Z",
read_only_mode: true,
last_data_change_at: "2020-04-21T07:57:11.124Z",
primary: true,
forked_from: "main",
},
}