Objects
Delete objects
Delete one or more objects from the bucket by their keys. Objects are deleted in batches of up to 1000. Partial failures are logged but do not cause the request to fail.
DELETE
/
object-storage
/
{id}
/
objects
Delete objects
curl --request DELETE \
--url https://api.sevalla.com/v3/object-storage/{id}/objects \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"keys": [
"images/photo.jpg",
"docs/readme.txt"
]
}
'import requests
url = "https://api.sevalla.com/v3/object-storage/{id}/objects"
payload = { "keys": ["images/photo.jpg", "docs/readme.txt"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({keys: ['images/photo.jpg', 'docs/readme.txt']})
};
fetch('https://api.sevalla.com/v3/object-storage/{id}/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://api.sevalla.com/v3/object-storage/{id}/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([
'keys' => [
'images/photo.jpg',
'docs/readme.txt'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.sevalla.com/v3/object-storage/{id}/objects"
payload := strings.NewReader("{\n \"keys\": [\n \"images/photo.jpg\",\n \"docs/readme.txt\"\n ]\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.sevalla.com/v3/object-storage/{id}/objects")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"keys\": [\n \"images/photo.jpg\",\n \"docs/readme.txt\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sevalla.com/v3/object-storage/{id}/objects")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"keys\": [\n \"images/photo.jpg\",\n \"docs/readme.txt\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "Bad request",
"status": 400,
"data": {
"code": "err-abc-123",
"message": "If you need assistance, please contact support and provide this error code."
}
}{
"message": "Unauthorized",
"status": 401,
"data": {
"code": "err-abc-123",
"message": "If you need assistance, please contact support and provide this error code."
}
}{
"message": "Forbidden",
"status": 403,
"data": {
"code": "err-abc-123",
"message": "If you need assistance, please contact support and provide this error code."
}
}{
"message": "Not found",
"status": 404,
"data": {
"code": "err-abc-123",
"message": "If you need assistance, please contact support and provide this error code."
}
}{
"message": "Too many requests",
"status": 429,
"data": {
"code": "err-abc-123",
"message": "If you need assistance, please contact support and provide this error code."
}
}{
"message": "Internal Server Error",
"status": 500,
"data": {
"code": "err-abc-123",
"message": "If you need assistance, please contact support and provide this error code."
}
}Authorizations
API key authentication. Pass your API key as a Bearer token in the Authorization header.
Path Parameters
Object storage bucket identifier
Pattern:
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Example:
"fb5e5168-4281-4bec-94c5-0d1584e9e657"
Body
application/json
Object keys to delete. Maximum 1000 keys per request.
Required array length:
1 - 1000 elementsExample:
["images/photo.jpg", "docs/readme.txt"]
Response
Objects deleted successfully
Was this page helpful?
Previous
List CORS policiesRetrieve all CORS policy rules configured for the object storage bucket. Rules without an ID are automatically assigned one.
Next
⌘I
Delete objects
curl --request DELETE \
--url https://api.sevalla.com/v3/object-storage/{id}/objects \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"keys": [
"images/photo.jpg",
"docs/readme.txt"
]
}
'import requests
url = "https://api.sevalla.com/v3/object-storage/{id}/objects"
payload = { "keys": ["images/photo.jpg", "docs/readme.txt"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({keys: ['images/photo.jpg', 'docs/readme.txt']})
};
fetch('https://api.sevalla.com/v3/object-storage/{id}/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://api.sevalla.com/v3/object-storage/{id}/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([
'keys' => [
'images/photo.jpg',
'docs/readme.txt'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.sevalla.com/v3/object-storage/{id}/objects"
payload := strings.NewReader("{\n \"keys\": [\n \"images/photo.jpg\",\n \"docs/readme.txt\"\n ]\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.sevalla.com/v3/object-storage/{id}/objects")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"keys\": [\n \"images/photo.jpg\",\n \"docs/readme.txt\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sevalla.com/v3/object-storage/{id}/objects")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"keys\": [\n \"images/photo.jpg\",\n \"docs/readme.txt\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "Bad request",
"status": 400,
"data": {
"code": "err-abc-123",
"message": "If you need assistance, please contact support and provide this error code."
}
}{
"message": "Unauthorized",
"status": 401,
"data": {
"code": "err-abc-123",
"message": "If you need assistance, please contact support and provide this error code."
}
}{
"message": "Forbidden",
"status": 403,
"data": {
"code": "err-abc-123",
"message": "If you need assistance, please contact support and provide this error code."
}
}{
"message": "Not found",
"status": 404,
"data": {
"code": "err-abc-123",
"message": "If you need assistance, please contact support and provide this error code."
}
}{
"message": "Too many requests",
"status": 429,
"data": {
"code": "err-abc-123",
"message": "If you need assistance, please contact support and provide this error code."
}
}{
"message": "Internal Server Error",
"status": 500,
"data": {
"code": "err-abc-123",
"message": "If you need assistance, please contact support and provide this error code."
}
}