@@ -5,6 +5,7 @@ All URIs are relative to *https://developers.hostinger.com*
55Method | HTTP request | Description
66------------- | ------------- | -------------
77[ ** create_website_v1** ] ( HostingWebsitesApi.md#create_website_v1 ) | ** POST** /api/hosting/v1/websites | Create website
8+ [ ** delete_website_v1** ] ( HostingWebsitesApi.md#delete_website_v1 ) | ** DELETE** /api/hosting/v1/websites/{domain} | Delete website
89[ ** list_websites_v1** ] ( HostingWebsitesApi.md#list_websites_v1 ) | ** GET** /api/hosting/v1/websites | List websites
910
1011
@@ -90,6 +91,98 @@ Name | Type | Description | Notes
9091
9192[[ Back to top]] ( # ) [[ Back to API list]] ( ../README.md#documentation-for-api-endpoints ) [[ Back to Model list]] ( ../README.md#documentation-for-models ) [[ Back to README]] ( ../README.md )
9293
94+ # ** delete_website_v1**
95+ > CommonSuccessEmptyResource delete_website_v1(domain, hosting_v1_websites_delete_website_request)
96+
97+ Delete website
98+
99+ Permanently deletes a website and all of its data. This action is destructive
100+ and cannot be undone. Always ask the user for explicit confirmation before
101+ calling this endpoint.
102+
103+ All website files, databases and related configuration will be removed.
104+ The hosting plan itself is kept, so a new website can be created on it afterwards.
105+
106+ The confirm field must be boolean true, otherwise the request is rejected.
107+
108+ Supported websites: main and addon domain websites on web hosting plans, and
109+ Website Builder websites. Parked domains and subdomains cannot be deleted with
110+ this endpoint. The domain must be the exact website domain, not a preview
111+ domain or an alias.
112+
113+ Returns 404 when the domain does not exist or does not belong to the
114+ authenticated client.
115+
116+ Website removal is processed asynchronously and can take a few minutes to
117+ complete. The response returns before the removal finishes.
118+
119+ ### Example
120+
121+ * Bearer Authentication (apiToken):
122+
123+ ``` python
124+ import hostinger_api
125+ from hostinger_api.models.common_success_empty_resource import CommonSuccessEmptyResource
126+ from hostinger_api.models.hosting_v1_websites_delete_website_request import HostingV1WebsitesDeleteWebsiteRequest
127+ from hostinger_api.rest import ApiException
128+ from pprint import pprint
129+
130+
131+ # Configure Bearer authorization: apiToken
132+ configuration = hostinger_api.Configuration(
133+ access_token = os.environ[" BEARER_TOKEN" ]
134+ )
135+
136+ # Enter a context with an instance of the API client
137+ with hostinger_api.ApiClient(configuration) as api_client:
138+ # Create an instance of the API class
139+ api_instance = hostinger_api.HostingWebsitesApi(api_client)
140+ domain = ' mydomain.tld' # str | Domain name
141+ hosting_v1_websites_delete_website_request = hostinger_api.HostingV1WebsitesDeleteWebsiteRequest() # HostingV1WebsitesDeleteWebsiteRequest |
142+
143+ try :
144+ # Delete website
145+ api_response = api_instance.delete_website_v1(domain, hosting_v1_websites_delete_website_request)
146+ print (" The response of HostingWebsitesApi->delete_website_v1:\n " )
147+ pprint(api_response)
148+ except Exception as e:
149+ print (" Exception when calling HostingWebsitesApi->delete_website_v1: %s \n " % e)
150+ ```
151+
152+
153+
154+ ### Parameters
155+
156+
157+ Name | Type | Description | Notes
158+ ------------- | ------------- | ------------- | -------------
159+ ** domain** | ** str** | Domain name |
160+ ** hosting_v1_websites_delete_website_request** | [ ** HostingV1WebsitesDeleteWebsiteRequest** ] ( HostingV1WebsitesDeleteWebsiteRequest.md ) | |
161+
162+ ### Return type
163+
164+ [ ** CommonSuccessEmptyResource** ] ( CommonSuccessEmptyResource.md )
165+
166+ ### Authorization
167+
168+ [ apiToken] ( ../README.md#apiToken )
169+
170+ ### HTTP request headers
171+
172+ - ** Content-Type** : application/json
173+ - ** Accept** : application/json
174+
175+ ### HTTP response details
176+
177+ | Status code | Description | Response headers |
178+ | -------------| -------------| ------------------|
179+ ** 200** | Success empty response | - |
180+ ** 422** | Validation error response | - |
181+ ** 401** | Unauthenticated response | - |
182+ ** 500** | Error response | - |
183+
184+ [[ Back to top]] ( # ) [[ Back to API list]] ( ../README.md#documentation-for-api-endpoints ) [[ Back to Model list]] ( ../README.md#documentation-for-models ) [[ Back to README]] ( ../README.md )
185+
93186# ** list_websites_v1**
94187> HostingListWebsitesV1200Response list_websites_v1(page=page, per_page=per_page, username=username, order_id=order_id, is_enabled=is_enabled, domain=domain)
95188
0 commit comments