Choose your language:
    Activate maintenance mode: this means that the primary environment will be read-only
    Query parameters
    force  boolean  Optional

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

    Returns
    Returns a maintenance_mode object.

    Examples

    Example code:
    const { SiteClient } = require('datocms-client');
    async function run() {
    const client = new SiteClient('YOUR-API-TOKEN');
    const maintenanceMode = await client.maintenanceMode.activate({
    force: true
    });
    console.log(maintenanceMode);
    }
    run();
    Returned output:
    > node example.js
    {
    "id": "4235",
    "active": false
    }