Show examples in:
JavascriptHTTP
Endpoint info
Available examples
Dashboard API > Project

List all projects

Warning: Experimental API

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

sortenum

Sorts projects (default sorting is by ascending name)

Example:"name"
name

Sort by name (ascending order)

-name

Sort by name (descending order)

last_data_change_at

Sort by last_data_change_at (ascending order)

-last_data_change_at

Sort by last_data_change_at (descending order)

plan

Sort by plan (ascending order)

-plan

Sort by plan (descending order)

created_at

Sort by creation date (ascending order)

-created_at

Sort by creation date (descending order)

filtersobject
matchstring

Filter by project name

pageobject

Parameters to control offset-based pagination

offsetinteger

The (zero-based) offset of the first entity returned in the collection (defaults to 0)

Example:200
limitinteger

The maximum number of entities to return (defaults to 20, maximum is 50)

includestring

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.

Example:"active_plan,transfer"

Returns

Returns an array of resource objects of type site.

Examples

GET https://site-api.datocms.com/sites HTTP/1.1
Authorization: Bearer YOUR-API-TOKEN
Accept: application/json
X-Api-Version: 3
Terminal window
curl -g 'https://site-api.datocms.com/sites' \
\
-H "Authorization: Bearer YOUR-API-TOKEN" \
-H "Accept: application/json" \
-H "X-Api-Version: 3"
await fetch("https://site-api.datocms.com/sites", {
headers: {
Authorization: "Bearer YOUR-API-TOKEN",
Accept: "application/json",
"X-Api-Version": "3",
},
});
HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: cache-control: max-age=0, private, must-revalidate
X-RateLimit-Limit: 30
X-RateLimit-Remaining: 28
{
"data": [
{
"type": "site",
"id": "155",
"attributes": {
"name": "My blog",
"domain": "admin.foobar.com",
"internal_domain": "clueless-star-1231.admin.datocms.com",
"last_data_change_at": "2020-04-21T07:57:11.124Z",
"access_token": "",
"created_at": "2020-04-21T07:57:11.124Z",
"deactivated": true
},
"meta": {
"last_data_change_at": "2017-03-30T09:29:14.872Z",
"created_at": "2017-03-30T09:29:14.872Z",
"deactivated": true,
"status": "",
"owner": {
"type": "account",
"email": "mark@foobar.com"
},
"require_2fa": false
},
"relationships": {
"active_subscription": {
"data": null
},
"active_plan": {
"data": null
},
"transfer": {
"data": {
"type": "site_transfer",
"id": "124"
}
}
}
}
],
"meta": {
"total_count": 20,
"total_owned_count": 20
}
}