Show examples in:
JavascriptHTTP
Dashboard API > Project

Create a new project

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

confirm_mux_encoding_consumptionstring

Confirm the creation of the project starting from a public template project, even if the copy of videos require significant use of Video Encoding resources

Example:"true"

Body parameters

namestringRequired

Site name

Example:"My blog"
internal_subdomainstringOptional

Internal project subdomain

Example:"clueless-star-1231"
main_localestringOptional

Main locale for the project

Example:"en"
theme_hueintegerOptional

Theme hue for the project (from 0 to 359)

Example:16
templatestring, nullOptional

Site template

Example:"portfolio"

Returns

Returns a resource object of type site

Examples

import { buildClient } from "@datocms/dashboard-client";
async function run() {
const client = buildClient({ apiToken: process.env.DATOCMS_API_TOKEN });
const site = await client.sites.create({ name: "My blog" });
// Check the 'Returned output' tab for the result ☝️
console.log(site);
}
run();
{
id: "155",
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,
},
active_subscription: null,
active_plan: null,
transfer: { type: "site_transfer", id: "124" },
}