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

Confirm email change

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.

Confirms a pending email change using the token sent to the new email address. If the caller is authenticated as the same account, returns a new session (200). Otherwise returns 204 No Content.

Body parameters

tokenstringRequired

Email confirmation token

account_idstringRequired

Account ID

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.confirmEmailChange({
token: "",
account_id: "",
});
// Check the 'Returned output' tab for the result ☝️
console.log(account);
}
run();
{
id: "eyJCJhbGci.eyJhaWwuY29tIn0.32wQOMci",
account: { type: "account", id: "312" },
}