B2B Saas Authentication

/

Mobile SDKs

/

React Native SDK reference

/

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 { Text, TouchableOpacity, View } from 'react-native';
import { useStytchB2BClient } from '@stytch/react-native/b2b';

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

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

  return (
    <View>
      <TouchableOpacity onPress={deleteOrganization}>
        <Text>Delete your Organization</Text>
      </TouchableOpacity>
    </View>
  );
};

RESPONSE

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