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

De-activates 2-factor authorization

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

otp_codestringRequired

OTP code

Example:"123456"
passwordstringRequired

Current password

Returns

Returns a resource object of type account

Examples

import { buildClient } from "@datocms/dashboard-client";
async function run() {
const client = buildClient({ apiToken: process.env.DATOCMS_API_TOKEN });
const account = await client.account.deactivate_2Fa({
otp_code: "123456",
password: "",
});
// Check the 'Returned output' tab for the result ☝️
console.log(account);
}
run();
{
id: "312",
email: "foo@bar.com",
first_name: "Mark",
last_name: "Smith",
company: "Dundler Mifflin",
is_2fa_active: true,
meta: {
email_verified: true,
email_verification_token_sent_at: "2024-01-15T10:20:00.000Z",
},
active_subscription: null,
billing_profile: null,
default_organization: null,
}