CorefinityCorefinityDocs
Open the Control PanelControl Panel
Sites · 10 of 18

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.

DELETE/api/corestack/sites/{site}

Path parameters

siteintegerRequired

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

confirm_domainstring

To delete a site, name its production row in {site} and send the site's domain here, exactly.

confirm_namestring

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

StatusReasonWhat to do
401noneSend a valid token as Authorization: Bearer <token>.
403company_unavailableYour company is unavailable.
403scope_requiredUse a token with the scope named in scope.
403two_factor_requiredTurn on two-factor on your account, then send again.
404noneCheck the id. You see only what your account can reach.
409busyAnother operation is running on the site. Wait for it to finish.
409clone_in_progressAnother copy is running on the site. Wait for it to finish.
409cluster_deletingThe cluster is being deleted. Nothing can be changed on it.
409cluster_pausedChanges on this site are paused for planned maintenance; please try again later.
409deletedThe 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.
409has_environmentsThe site still has an environment that stops this. Read the message: delete its other environments first, or do what it names.
409is_productionThe production environment is the site itself. Delete the site instead.
409managed_elsewhereThis site is read-only here. Change it in the control panel that manages it.
422confirm_mismatchSend the confirmation exactly as the field named in field asks for it.
429rate_limitedWait for the seconds in Retry-After.
502noneRead the message; it says what happened.
503switched_offCorefinity 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"
  }'
{
  "held_delete_id": 3120,
  "message": "Turning off external access, then deleting.",
  "reason": "external_db_delete_queued",
  "turn_off_operation_id": 5119
}
Try it

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.

Was this helpful?
Open in ClaudeOpen in ChatGPT