Delete Image
curl --request DELETE \
--url https://api.vertracloud.app/v1/images/{image_id} \
--header 'Content-Type: application/json' \
--data '
{
"confirm_name": "<string>"
}
'import requests
url = "https://api.vertracloud.app/v1/images/{image_id}"
payload = { "confirm_name": "<string>" }
headers = {"Content-Type": "application/json"}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({confirm_name: '<string>'})
};
fetch('https://api.vertracloud.app/v1/images/{image_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.vertracloud.app/v1/images/{image_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'confirm_name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.vertracloud.app/v1/images/{image_id}"
payload := strings.NewReader("{\n \"confirm_name\": \"<string>\"\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.vertracloud.app/v1/images/{image_id}")
.header("Content-Type", "application/json")
.body("{\n \"confirm_name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vertracloud.app/v1/images/{image_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"confirm_name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"response": {
"deleted_apps": ["app-abc123def456"]
}
}
Docker Images
Delete Image
Deletes an image, its versions, its context and every application created from it.
DELETE
/
v1
/
images
/
{image_id}
Delete Image
curl --request DELETE \
--url https://api.vertracloud.app/v1/images/{image_id} \
--header 'Content-Type: application/json' \
--data '
{
"confirm_name": "<string>"
}
'import requests
url = "https://api.vertracloud.app/v1/images/{image_id}"
payload = { "confirm_name": "<string>" }
headers = {"Content-Type": "application/json"}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({confirm_name: '<string>'})
};
fetch('https://api.vertracloud.app/v1/images/{image_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.vertracloud.app/v1/images/{image_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'confirm_name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.vertracloud.app/v1/images/{image_id}"
payload := strings.NewReader("{\n \"confirm_name\": \"<string>\"\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.vertracloud.app/v1/images/{image_id}")
.header("Content-Type", "application/json")
.body("{\n \"confirm_name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vertracloud.app/v1/images/{image_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"confirm_name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"response": {
"deleted_apps": ["app-abc123def456"]
}
}
Deleting an image also deletes every application created from it. Each app follows the usual rules for deleting an application, including the safety snapshot on plans that have it.
images:delete scope when called with an API key; images:write does not cover it. When the image has applications, the key also needs the apps:delete scope, because they are deleted too. Without it the call fails with API_KEY_SCOPE_DENIED and details.required set to apps:delete. Deleting is refused while a build is running, and it is allowed on plans that can no longer create images.
string
required
The image ID.
string
If the image belongs to a workspace, the workspace’s ID. Required for workspace members acting on an image they don’t own.
string
required
Must be equal to the image name.
Response
{
"response": {
"deleted_apps": ["app-abc123def456"]
}
}
Error Responses
string
The error code indicating the reason for the failure. Possible values:
API_KEY_SCOPE_DENIED: The API key does not have theimages:deletescope, or the image has applications and the key does not have theapps:deletescope.details.requirednames the missing scope (403).IMAGE_NOT_FOUND: The image does not exist or you cannot access it (404).IMAGE_NAME_MISMATCH:confirm_nameis not the image name (400).IMAGE_BUILD_IN_PROGRESS: A build is running; wait for it to end (409).INTERNAL_SERVER_ERROR: Unexpected failure (500).
{
"code": "IMAGE_NAME_MISMATCH"
}