Delete upload
curl --request DELETE \
--url https://files.adclear.ai/v1/uploads/{uploadId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://files.adclear.ai/v1/uploads/{uploadId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://files.adclear.ai/v1/uploads/{uploadId}', 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://files.adclear.ai/v1/uploads/{uploadId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://files.adclear.ai/v1/uploads/{uploadId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://files.adclear.ai/v1/uploads/{uploadId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://files.adclear.ai/v1/uploads/{uploadId}")
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{
"success": true
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "Missing or malformed Content-Range header. Expected: bytes <start>-<end>/<total|*>",
"details": [
{
"type": "field_error",
"field": "fileName",
"message": "Required"
}
]
},
"correlationId": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Missing or invalid Bearer token"
},
"correlationId": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}{
"error": {
"code": "NOT_FOUND",
"message": "Upload not found"
},
"correlationId": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}{
"error": {
"code": "PAYLOAD_TOO_LARGE",
"message": "File size 104857600 exceeds limit of 31457280 bytes for pdf files",
"details": [
{
"type": "constraint_violation",
"constraint": "max_file_size",
"limit": 31457280,
"actual": 104857600
}
]
},
"correlationId": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}{
"error": {
"code": "RATE_LIMITED",
"message": "Too many requests",
"details": [
{
"type": "retry_info",
"retryAfterSeconds": 30
}
]
},
"correlationId": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}{
"error": {
"code": "INTERNAL_ERROR",
"message": "Internal server error"
},
"correlationId": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}{
"error": {
"code": "SERVICE_ERROR",
"message": "Storage returned unexpected status 503"
},
"correlationId": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}Upload
Delete upload
Deletes the GCS file (primary + display variant if present), cleans up any lingering upload session, and hard-deletes the upload record from the database. Returns 404 if the upload does not exist or does not belong to the authenticated user.
DELETE
/
v1
/
uploads
/
{uploadId}
Delete upload
curl --request DELETE \
--url https://files.adclear.ai/v1/uploads/{uploadId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://files.adclear.ai/v1/uploads/{uploadId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://files.adclear.ai/v1/uploads/{uploadId}', 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://files.adclear.ai/v1/uploads/{uploadId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://files.adclear.ai/v1/uploads/{uploadId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://files.adclear.ai/v1/uploads/{uploadId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://files.adclear.ai/v1/uploads/{uploadId}")
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{
"success": true
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "Missing or malformed Content-Range header. Expected: bytes <start>-<end>/<total|*>",
"details": [
{
"type": "field_error",
"field": "fileName",
"message": "Required"
}
]
},
"correlationId": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Missing or invalid Bearer token"
},
"correlationId": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}{
"error": {
"code": "NOT_FOUND",
"message": "Upload not found"
},
"correlationId": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}{
"error": {
"code": "PAYLOAD_TOO_LARGE",
"message": "File size 104857600 exceeds limit of 31457280 bytes for pdf files",
"details": [
{
"type": "constraint_violation",
"constraint": "max_file_size",
"limit": 31457280,
"actual": 104857600
}
]
},
"correlationId": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}{
"error": {
"code": "RATE_LIMITED",
"message": "Too many requests",
"details": [
{
"type": "retry_info",
"retryAfterSeconds": 30
}
]
},
"correlationId": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}{
"error": {
"code": "INTERNAL_ERROR",
"message": "Internal server error"
},
"correlationId": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}{
"error": {
"code": "SERVICE_ERROR",
"message": "Storage returned unexpected status 503"
},
"correlationId": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}Headers
Workspace ID fallback. Required when authenticating with a Bearer token in environments where cookies cannot be shared (e.g. preview). Not needed for API key auth (workspace is embedded in the key metadata) or when the workspace cookie is present.
Example:
"43dc2a1c-3384-41b5-a6e9-3b2d607d0fae"
Was this page helpful?