Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions tests/test_organizations.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,10 @@ def test_update_organization(self, mock_organization_updated, mock_request_metho
"id": "org_domain_01EHT88Z8WZEFWYPM6EC9BX2R8",
}
]

def test_delete_organization(self, setup, mock_request_method):
mock_response = Response()
mock_response.status_code = 204
mock_request_method("delete", mock_response, 204)
response = self.organizations.delete_organization(organization="connection_id")
assert response.status_code == 204
13 changes: 13 additions & 0 deletions workos/organizations.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import workos
from workos.utils.request import (
RequestHelper,
REQUEST_METHOD_DELETE,
REQUEST_METHOD_GET,
REQUEST_METHOD_POST,
REQUEST_METHOD_PUT,
Expand Down Expand Up @@ -101,3 +102,15 @@ def update_organization(self, organization, name, domains=None):
params=params,
token=workos.api_key,
)

def delete_organization(self, organization):
"""Deletes a single Organization

Args:
organization (str): Organization unique identifier
"""
return self.request_helper.request(
"organizations/{organization}".format(organization=organization),
method=REQUEST_METHOD_DELETE,
token=workos.api_key,
)