Skip to Content
You are viewing a beta version of Clerk Docs
Visit the latest docs
Clerk logo

Clerk Docs

Ctrl + K
Go to clerk.com

deleteOrganization()

Deletes an Organization given a valid ID.

function deleteOrganization: (organizationId: string) => Promise<Organization>;

deleteOrganization() parameters

NameTypeDescription
organizationIdstringThe ID of the organization to delete.

deleteOrganization() example

const organizationId = 'org_2b6TtF4XlxDsKo6t0E0UyywGB72'; const response = await clerkClient.organizations.deleteOrganization(organizationId); console.log(response); /* DeletedObject { object: 'organization', id: 'org_2b6TtF4XlxDsKo6t0E0UyywGB72', slug: null, deleted: true } */

Backend API (BAPI) endpoint

This method in the SDK is a wrapper around the BAPI endpoint DELETE/organizations/{organization_id}. See the BAPI reference(opens in a new tab) for more details.

Last updated on August 16, 2023

What did you think of this content?

Clerk © 2024