Python
from magic_hour import Client
from os import getenv
client = Client(token=getenv("API_TOKEN"))
res = client.v1.image_projects.delete(id="cuid-example")import { Client } from "magic-hour";
const client = new Client({ token: process.env["API_TOKEN"]!! });
const res = await client.v1.imageProjects.delete({ id: "cuid-example" });package main
import (
os "os"
sdk "github.com/magichourhq/magic-hour-go/client"
image_projects "github.com/magichourhq/magic-hour-go/resources/v1/image_projects"
)
func main() {
client := sdk.NewClient(
sdk.WithBearerAuth(os.Getenv("API_TOKEN")),
)
err := client.V1.ImageProjects.Delete(image_projects.DeleteRequest{
Id: "cuid-example",
})
}let client = magic_hour::Client::default()
.with_bearer_auth(&std::env::var("API_TOKEN").unwrap());
let res = client
.v1()
.image_projects()
.delete(magic_hour::resources::v1::image_projects::DeleteRequest {
id: "cuid-example".to_string(),
})
.await;curl --request DELETE \
--url https://api.magichour.ai/v1/image-projects/id \
--header 'accept: application/json' \
--header 'authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.magichour.ai/v1/image-projects/id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"accept: application/json",
"authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.delete("https://api.magichour.ai/v1/image-projects/id")
.header("accept", "application/json")
.header("authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.magichour.ai/v1/image-projects/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"message": "Missing request body"
}{
"message": "Unauthorized"
}{
"message": "Payment required"
}{
"message": "Not Found"
}Image Projects
Delete Image API Reference - Magic Hour Docs
Permanently delete the rendered image(s). This action is not reversible, please be sure before deleting.
DELETE
/
v1
/
image-projects
/
{id}
Python
from magic_hour import Client
from os import getenv
client = Client(token=getenv("API_TOKEN"))
res = client.v1.image_projects.delete(id="cuid-example")import { Client } from "magic-hour";
const client = new Client({ token: process.env["API_TOKEN"]!! });
const res = await client.v1.imageProjects.delete({ id: "cuid-example" });package main
import (
os "os"
sdk "github.com/magichourhq/magic-hour-go/client"
image_projects "github.com/magichourhq/magic-hour-go/resources/v1/image_projects"
)
func main() {
client := sdk.NewClient(
sdk.WithBearerAuth(os.Getenv("API_TOKEN")),
)
err := client.V1.ImageProjects.Delete(image_projects.DeleteRequest{
Id: "cuid-example",
})
}let client = magic_hour::Client::default()
.with_bearer_auth(&std::env::var("API_TOKEN").unwrap());
let res = client
.v1()
.image_projects()
.delete(magic_hour::resources::v1::image_projects::DeleteRequest {
id: "cuid-example".to_string(),
})
.await;curl --request DELETE \
--url https://api.magichour.ai/v1/image-projects/id \
--header 'accept: application/json' \
--header 'authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.magichour.ai/v1/image-projects/id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"accept: application/json",
"authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.delete("https://api.magichour.ai/v1/image-projects/id")
.header("accept", "application/json")
.header("authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.magichour.ai/v1/image-projects/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"message": "Missing request body"
}{
"message": "Unauthorized"
}{
"message": "Payment required"
}{
"message": "Not Found"
}Authorizations
Bearer authentication header of the form Bearer <api_key>, where <api_key> is your API key. To get your API key, go to Developer Hub and click "Create new API Key".
Path Parameters
Unique ID of the image project. This value is returned by all of the POST APIs that create an image.
Example:
"cuid-example"
Response
204
Was this page helpful?
⌘I