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

Destroy an organization

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

passwordstringRequired

Current password

otp_codestringOptional

OTP code

Example:"123456"

Returns

Returns a resource object of type organization

Examples

import { buildClient } from "@datocms/dashboard-client";
async function run() {
const client = buildClient({ apiToken: process.env.DATOCMS_API_TOKEN });
const organizationId = "124";
const organization = await client.organizations.destroy(organizationId, {
password: "",
});
// Check the 'Returned output' tab for the result ☝️
console.log(organization);
}
run();
{
id: "124",
name: "",
meta: { discount_on_public_plans: 20, agency_partner: null },
active_subscription: { type: "per_owner_pricing_subscription", id: "124" },
billing_profile: null,
}