Sorry, no results found for "".

Show examples in:
Javascript HTTP
Endpoint info
Available examples

Content Management API > Environment

List all environments

Returns

Returns an array of resource objects of type environment

Examples

import { buildClient } from "@datocms/cma-client-node";
async function run() {
const client = buildClient({ apiToken: process.env.DATOCMS_API_TOKEN });
const environments = await client.environments.list();
for (const environment of environments) {
// 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",
},
}