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').SiteClient;
    const client = new SiteClient('YOUR-API-TOKEN');
    client.maintenanceMode.activate({
    force: true
    })
    .then((maintenanceMode) => {
    console.log(maintenanceMode);
    })
    .catch((error) => {
    console.error(error);
    });
    Returned output:
    > node example.js
    {
    "id": "4235",
    "active": false
    }