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

Create a new account

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.

Body parameters

emailstringRequired

Email

Example:"foo@bar.com"
passwordstringRequired

Password

first_namestring, nullOptional

First name

Example:"Mark"
last_namestring, nullOptional

Last name

Example:"Smith"
companystring, nullOptional

Company name

Example:"Dundler Mifflin"
captcha_tokenstringOptional

Cloudflare Turnstile token proving the sign up was not automated. Obtained from the Turnstile widget rendered next to the sign up form, and valid for 300 seconds and a single verification. Required for browser-based sign ups.

Example:"0.6IlxLLPqSAjOaTUvKDnCDQ.rB6UBUW4dGZWZOmHnFVKa5b4qNVvKgOxvGDNJ4qFqR8"
signup_to_newsletterbooleanOptional

Whether the user opts-in to signup to DatoCMS newletter

role_descriptionenumOptional

Role description that best describes you

Example:"lead_developer"
ctoOptional

CTO / Technical Director

lead_developerOptional

Lead Developer / Engineering Manager

frontend_developerOptional

Frontend Developer

web_designerOptional
digital_marketingOptional

Digital Marketing

project_managerOptional

Project Manager

designerOptional

Digital Designer (Web, Visual, Motion, UI, UX)

contentOptional

Content Manager / Writer / Translator

role_contextenumOptional

Context in which you perform your role

Example:"company"
agencyOptional

I work at an agency

companyOptional

I work in-house at a company

freelancerOptional

I am a freelancer

studentOptional

I am a student

acquisition_methodobjectOptional
mediumstringRequired
sourcestringRequired
campaignstringOptional
latest_acquisition_methodobjectOptional
mediumstringRequired
sourcestringRequired
campaignstringOptional

Returns

Returns a resource object of type session

Examples

import { buildClient } from "@datocms/dashboard-client";
async function run() {
const client = buildClient({ apiToken: process.env.DATOCMS_API_TOKEN });
const account = await client.account.create({
email: "foo@bar.com",
password: "",
});
// Check the 'Returned output' tab for the result ☝️
console.log(account);
}
run();
{
id: "eyJCJhbGci.eyJhaWwuY29tIn0.32wQOMci",
account: { type: "account", id: "312" },
}