Show examples in:
    Fork an existing environment

    Query parameters

    immediate_return  Optional  boolean  Example: true

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

    fast  Optional  boolean  Example: true

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

    force  Optional  boolean  Example: true

    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

    Returns

    Returns a environment resource object.

    Examples

    Example Basic example
    import { buildClient } from '@datocms/cma-client-node';
    async function run() {
    const client = buildClient({ apiToken: '<YOUR_API_TOKEN>' });
    const environmentId = 'main';
    const environment = await client.environments.fork(environmentId, {
    id: 'my-sandbox-env'
    });
    console.log(environment);
    }
    run();