List all projects
Please note that the Dashboard API is an experimental, prerelease API. This API method is considered unstable, and should be avoided in production environments and automations. Changes may occur at any time without warning.
Query parameters
Sorts projects (default sorting is by ascending name)
"name"
Sort by name (ascending order)
Sort by name (descending order)
Sort by last_data_change_at (ascending order)
Sort by last_data_change_at (descending order)
Sort by plan (ascending order)
Sort by plan (descending order)
Sort by creation date (ascending order)
Sort by creation date (descending order)
Filter by project name
Parameters to control offset-based pagination
The (zero-based) offset of the first entity returned in the collection (defaults to 0)
200
The maximum number of entities to return (defaults to 20, maximum is 50)
Comma-separated list of relationship paths. A relationship path is a dot-separated list of relationship names. Allowed relationship paths: item_types, item_types.fields, item_types.fieldsets, item_types.singleton_item, account.
"active_plan,transfer"
Returns
Returns an array of resource objects of type site
Examples
import { buildClient } from "@datocms/dashboard-client";
async function run() { const client = buildClient({ apiToken: process.env.DATOCMS_API_TOKEN });
// iterates over every page of results for await (const site of client.sites.listPagedIterator()) { // Check the 'Returned output' tab for the result ☝️ console.log(site); }}
run();