Delete a site
Deletes the row {site} names, once the request carries the typed confirmation that row takes: the body's fields say which. It answers the operation to follow.
Path parameters
The id of a site row. A website's production site and each of its environments has its own id. Digits only. At least 1.
Body
To delete a site, name its production row in {site} and send the site's domain here, exactly.
To delete one environment, name that environment's row in {site} and send its name here, exactly as the site shows it, such as Staging. A production row takes confirm_domain instead.
Returns
202 The delete has started: the row and the operation to follow. When external database access has to be turned off first, the answer is instead a message with the reason external_db_delete_queued and no operation; the delete then starts by itself. Poll the operation until it finishes.
Fields of the 202 answer
If it is refused
| Status | Reason | What to do |
|---|---|---|
401 | none | Send a valid token as Authorization: Bearer <token>. |
403 | company_unavailable | Your company is unavailable. |
403 | scope_required | Use a token with the scope named in scope. |
403 | two_factor_required | Turn on two-factor on your account, then send again. |
404 | none | Check the id. You see only what your account can reach. |
409 | busy | Another operation is running on the site. Wait for it to finish. |
409 | clone_in_progress | Another copy is running on the site. Wait for it to finish. |
409 | cluster_deleting | The cluster is being deleted. Nothing can be changed on it. |
409 | cluster_paused | Changes on this site are paused for planned maintenance; please try again later. |
409 | deleted | The site, environment or copy has been deleted, or is being deleted. Nothing can be changed on it. Restore a deleted site first if it can still be restored. |
409 | has_environments | The site still has an environment that stops this. Read the message: delete its other environments first, or do what it names. |
409 | is_production | The production environment is the site itself. Delete the site instead. |
409 | managed_elsewhere | This site is read-only here. Change it in the control panel that manages it. |
422 | confirm_mismatch | Send the confirmation exactly as the field named in field asks for it. |
429 | rate_limited | Wait for the seconds in Retry-After. |
502 | none | Read the message; it says what happened. |
503 | switched_off | Corefinity has switched this action off for the moment. Try again later. |
Reasons are listed by name in Errors and refusals.
The same task elsewhere
curl -X DELETE https://manage.corefinity.com/api/corestack/sites/1042 \
-H "Authorization: Bearer $COREFINITY_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"confirm_name": "Staging"
}'use Illuminate\Support\Facades\Http;
$response = Http::withToken(env('COREFINITY_TOKEN'))
->acceptJson()
->delete('https://manage.corefinity.com/api/corestack/sites/1042', [
'confirm_name' => 'Staging',
]);
$data = $response->json();const res = await fetch('https://manage.corefinity.com/api/corestack/sites/1042', {
method: 'DELETE',
headers: {
Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
confirm_name: 'Staging',
}),
});
// An answer with no body (204) has nothing to parse.
const text = await res.text();
const data = text && JSON.parse(text);import os
import requests
res = requests.delete(
"https://manage.corefinity.com/api/corestack/sites/1042",
headers={
"Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
"Accept": "application/json",
},
json={
"confirm_name": "Staging",
},
)
data = res.json() if res.content else None{
"held_delete_id": 3120,
"message": "Turning off external access, then deleting.",
"reason": "external_db_delete_queued",
"turn_off_operation_id": 5119
}{
"message": "Unauthenticated."
}{
"code": "company_unavailable",
"message": "Your company is unavailable.",
"reason": "company_unavailable"
}{
"message": "Not found."
}{
"code": "busy",
"message": "Another change to this site is in progress. Wait for it to finish.",
"reason": "busy"
}{
"code": "confirm_mismatch",
"errors": {
"confirm_name": [
"Type the environment's name exactly to confirm"
]
},
"field": "confirm_name",
"message": "Type the environment's name exactly to confirm",
"reason": "confirm_mismatch"
}{
"code": "rate_limited",
"message": "Too many requests. Try again in 60 seconds.",
"reason": "rate_limited",
"retry_after_seconds": 60
}{
"message": "The site could not be read for its final snapshot. Try again in a minute."
}{
"code": "switched_off",
"message": "Deleting is switched off at the moment",
"reason": "switched_off",
"switch": "delete"
}Try it is off for this endpointIt deletes data that cannot be brought back. Copy the request and run it yourself when you are sure.