Show examples in:
    Activate maintenance mode: this means that the primary environment will be read-only

    Query parameters

    force  Optional  boolean  Example: true

    Force the activation, even if there are collaborators editing some records.

    Returns

    Returns a maintenance_mode resource object.

    Examples

    Example code:
    import { buildClient } from '@datocms/cma-client-node';
    async function run() {
    const client = buildClient({ apiToken: '<YOUR_API_TOKEN>' });
    const maintenanceMode = await client.maintenanceMode.activate({
    force: true
    });
    console.log(maintenanceMode);
    }
    run();
    Returned output:
    {
    id: 'maintenance_mode',
    active: false
    }