Skip to main content
DELETE
/
v1
/
objects
Blob Delete Objects
curl --request DELETE \
  --url https://blob.squarecloud.app/v1/objects \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "object": "<string>"
}
'
import requests

url = "https://blob.squarecloud.app/v1/objects"

payload = { "object": "<string>" }
headers = {
    "Authorization": "<authorization>",
    "Content-Type": "application/json"
}

response = requests.delete(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'DELETE',
  headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
  body: JSON.stringify({object: '<string>'})
};

fetch('https://blob.squarecloud.app/v1/objects', 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://blob.squarecloud.app/v1/objects",
  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([
    'object' => '<string>'
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: <authorization>",
    "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://blob.squarecloud.app/v1/objects"

	payload := strings.NewReader("{\n  \"object\": \"<string>\"\n}")

	req, _ := http.NewRequest("DELETE", url, payload)

	req.Header.Add("Authorization", "<authorization>")
	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://blob.squarecloud.app/v1/objects")
  .header("Authorization", "<authorization>")
  .header("Content-Type", "application/json")
  .body("{\n  \"object\": \"<string>\"\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://blob.squarecloud.app/v1/objects")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"object\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "status": "success"
}
Authorization
string
required
The API key for your account. You can find this in your account settings.
Delete removes a single stored object by its full key, including the owning account’s ID prefix. There’s no bulk delete: the endpoint only ever acts on one name, taken from the object field or the first entry of an objects array (kept for backward compatibility), so removing many files means one request per object. The object key is validated against your token’s account ID before the delete runs; a key that resolves outside your own prefix is rejected as INVALID_OBJECT rather than treated as a cross-tenant lookup. A single database query both performs the delete and confirms the object existed, so deleting a name that’s already gone returns OBJECT_NOT_FOUND. To find the exact object key before deleting it, list your objects with Object List; to check storage usage after cleanup, see Account Stats.
object
string
required
The name of the object to delete. The object name must adhere to the following pattern: a to z, A to Z, 0 to 9, and _.
{ "object": "ID/prefix/name1_ltq7b2sw-de6241.jpeg" }

Response

status
string
Indicates whether the call was successful. “success” if successful, “error” if not.
{
  "status": "success"
}

Troubleshooting

// The request body is missing or is not a valid JSON object.
{
    "status": "error",
    "code": "INVALID_BODY"
}
// The provided object key is invalid: it must start with your own account ID prefix and contain no path traversal.
{
    "status": "error",
    "code": "INVALID_OBJECT"
}
// The request to delete the objects failed. Please try again.
{
    "status": "error",
    "code": "DELETE_FAILED"
}