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

typestringRequired

Must be exactly "account".

attributes.emailstringRequired

Email

Example:"foo@bar.com"
attributes.passwordstringRequired

Password

attributes.first_namestring, nullOptional

First name

Example:"Mark"
attributes.last_namestring, nullOptional

Last name

Example:"Smith"
attributes.companystring, nullOptional

Company name

Example:"Dundler Mifflin"
attributes.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"
attributes.signup_to_newsletterbooleanOptional

Whether the user opts-in to signup to DatoCMS newletter

attributes.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

attributes.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

attributes.acquisition_methodobjectOptional
mediumstringRequired
sourcestringRequired
campaignstringOptional
attributes.latest_acquisition_methodobjectOptional
mediumstringRequired
sourcestringRequired
campaignstringOptional

Returns

Returns a resource object of type session.

Examples

POST https://site-api.datocms.com/account HTTP/1.1
Authorization: Bearer YOUR-API-TOKEN
Accept: application/json
X-Api-Version: 3
Content-Type: application/vnd.api+json
{
"data": {
"type": "account",
"attributes": {
"email": "foo@bar.com",
"password": ""
}
}
}
Terminal window
curl -g 'https://site-api.datocms.com/account' \
-X POST \
-H "Authorization: Bearer YOUR-API-TOKEN" \
-H "Accept: application/json" \
-H "X-Api-Version: 3" \
-H "Content-Type: application/vnd.api+json" \
--data-binary '{"data":{"type":"account","attributes":{"email":"foo@bar.com","password":""}}}'
await fetch("https://site-api.datocms.com/account", {
method: "POST",
headers: {
Authorization: "Bearer YOUR-API-TOKEN",
Accept: "application/json",
"X-Api-Version": "3",
"Content-Type": "application/vnd.api+json",
},
body: JSON.stringify({
data: {
type: "account",
attributes: { email: "foo@bar.com", password: "" },
},
}),
});
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": "session",
"id": "eyJCJhbGci.eyJhaWwuY29tIn0.32wQOMci",
"relationships": {
"account": {
"data": {
"type": "account",
"id": "312"
}
}
}
}
}