Delete Artifact
curl --request DELETE \
--url https://genui.sh/api/artifacts/{id}import requests
url = "https://genui.sh/api/artifacts/{id}"
response = requests.delete(url)
print(response.text)const options = {method: 'DELETE'};
fetch('https://genui.sh/api/artifacts/{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://genui.sh/api/artifacts/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://genui.sh/api/artifacts/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://genui.sh/api/artifacts/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://genui.sh/api/artifacts/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body{
"id": "art_abc123",
"status": "deleted",
"deletedAt": "2024-01-16T14:30:00Z"
}
{
"error": {
"code": "not_found",
"message": "Artifact not found"
}
}
Artifacts
Delete Artifact
DELETE
/
api
/
artifacts
/
{id}
Delete Artifact
curl --request DELETE \
--url https://genui.sh/api/artifacts/{id}import requests
url = "https://genui.sh/api/artifacts/{id}"
response = requests.delete(url)
print(response.text)const options = {method: 'DELETE'};
fetch('https://genui.sh/api/artifacts/{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://genui.sh/api/artifacts/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://genui.sh/api/artifacts/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://genui.sh/api/artifacts/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://genui.sh/api/artifacts/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body{
"id": "art_abc123",
"status": "deleted",
"deletedAt": "2024-01-16T14:30:00Z"
}
{
"error": {
"code": "not_found",
"message": "Artifact not found"
}
}
Delete an artifact. This is a soft delete - the artifact is marked as deleted but can be restored within 30 days.
Request
string
required
The artifact ID to delete
boolean
Set to
true for permanent deletion (cannot be undone)Response
{
"id": "art_abc123",
"status": "deleted",
"deletedAt": "2024-01-16T14:30:00Z"
}
{
"error": {
"code": "not_found",
"message": "Artifact not found"
}
}
Code Examples
curl -X DELETE https://genui.sh/api/artifacts/art_abc123 \
-H "Authorization: Bearer $GENUI_API_KEY"
import requests
import os
artifact_id = "art_abc123"
response = requests.delete(
f"https://genui.sh/api/artifacts/{artifact_id}",
headers={"Authorization": f"Bearer {os.environ['GENUI_API_KEY']}"}
)
if response.status_code == 200:
print(f"Deleted artifact: {artifact_id}")
const artifactId = 'art_abc123';
const response = await fetch(`https://genui.sh/api/artifacts/${artifactId}`, {
method: 'DELETE',
headers: {
'Authorization': `Bearer ${process.env.GENUI_API_KEY}`
}
});
if (response.ok) {
console.log(`Deleted artifact: ${artifactId}`);
}
artifactID := "art_abc123"
req, _ := http.NewRequest("DELETE", "https://genui.sh/api/artifacts/"+artifactID, nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("GENUI_API_KEY"))
client := &http.Client{}
resp, _ := client.Do(req)
if resp.StatusCode == 200 {
fmt.Printf("Deleted artifact: %s\n", artifactID)
}
artifact_id = 'art_abc123'
uri = URI("https://genui.sh/api/artifacts/#{artifact_id}")
request = Net::HTTP::Delete.new(uri)
request['Authorization'] = "Bearer #{ENV['GENUI_API_KEY']}"
response = http.request(request)
puts "Deleted artifact: #{artifact_id}" if response.code == '200'
let artifact_id = "art_abc123";
let response = client
.delete(format!("https://genui.sh/api/artifacts/{}", artifact_id))
.header("Authorization", format!("Bearer {}", api_key))
.send()
.await?;
if response.status().is_success() {
println!("Deleted artifact: {}", artifact_id);
}
var artifactId = "art_abc123";
var response = await client.DeleteAsync($"https://genui.sh/api/artifacts/{artifactId}");
if (response.IsSuccessStatusCode)
{
Console.WriteLine($"Deleted artifact: {artifactId}");
}
Permanent Deletion
To permanently delete an artifact without the ability to restore:curl -X DELETE "https://genui.sh/api/artifacts/art_abc123?permanent=true" \
-H "Authorization: Bearer $GENUI_API_KEY"
Permanent deletion cannot be undone. The artifact and all associated data will be immediately removed.