B2B Saas Authentication

/

Frontend SDKs

/

Headless

/

Organizations

/

Delete Organization

Delete Organization

The Delete Organization method wraps the delete organization API endpoint. This will delete the logged-in Member's Organization. As a consequence, their Member object will also be deleted, and their session will be revoked.

import { useStytchB2BClient } from '@stytch/react/b2b';

export const DeleteOrganization = () => {
  const stytch = useStytchB2BClient();

  const deleteOrganization = () => {
    stytch.organization.delete();
  };

  return <button onClick={deleteOrganization}>Delete your Organization</button>;
};

RESPONSE

200
{
    "status_code": 200,
    "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
    "organization_id": "organization-test-07971b06-ac8b-4cdb-9c15-63b17e653931",
  }