Excluir item
curl --request DELETE \
--url https://api.lazydata.com.br/v1/storage/items/{item_type}/{item_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.lazydata.com.br/v1/storage/items/{item_type}/{item_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.lazydata.com.br/v1/storage/items/{item_type}/{item_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://api.lazydata.com.br/v1/storage/items/{item_type}/{item_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 => [
"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://api.lazydata.com.br/v1/storage/items/{item_type}/{item_id}"
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://api.lazydata.com.br/v1/storage/items/{item_type}/{item_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lazydata.com.br/v1/storage/items/{item_type}/{item_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{
"code": 202,
"message": "Exclusão do arquivo iniciada.",
"result": {
"item_type": "file",
"item_id": "9fcb573b-7f62-4774-978b-07e89dfef5f2"
}
}
{
"code": 404,
"message": "Arquivo não localizado."
}
{
"code": 409,
"message": "Aguarde o upload em andamento antes de excluir esta pasta."
}
Armazenamento
Excluir item
Inicie a exclusão de um arquivo ou pasta do armazenamento.
DELETE
https://api.lazydata.com.br/
/
v1
/
storage
/
items
/
{item_type}
/
{item_id}
Excluir item
curl --request DELETE \
--url https://api.lazydata.com.br/v1/storage/items/{item_type}/{item_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.lazydata.com.br/v1/storage/items/{item_type}/{item_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.lazydata.com.br/v1/storage/items/{item_type}/{item_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://api.lazydata.com.br/v1/storage/items/{item_type}/{item_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 => [
"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://api.lazydata.com.br/v1/storage/items/{item_type}/{item_id}"
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://api.lazydata.com.br/v1/storage/items/{item_type}/{item_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lazydata.com.br/v1/storage/items/{item_type}/{item_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{
"code": 202,
"message": "Exclusão do arquivo iniciada.",
"result": {
"item_type": "file",
"item_id": "9fcb573b-7f62-4774-978b-07e89dfef5f2"
}
}
{
"code": 404,
"message": "Arquivo não localizado."
}
{
"code": 409,
"message": "Aguarde o upload em andamento antes de excluir esta pasta."
}
Inicia a exclusão de um arquivo ou pasta do armazenamento.
A exclusão é assíncrona. A resposta
Valores aceitos:
202 indica que a solicitação foi aceita e o item entrou em processamento de remoção.
{
"code": 202,
"message": "Exclusão do arquivo iniciada.",
"result": {
"item_type": "file",
"item_id": "9fcb573b-7f62-4774-978b-07e89dfef5f2"
}
}
{
"code": 404,
"message": "Arquivo não localizado."
}
{
"code": 409,
"message": "Aguarde o upload em andamento antes de excluir esta pasta."
}
Parâmetros
string
required
Tipo do item.
| Valor | Descrição |
|---|---|
file | Arquivo armazenado. |
folder | Pasta do armazenamento. |
string
required
ID do arquivo ou pasta.
Resposta
| Campo | Tipo | Descrição |
|---|---|---|
item_type | string | Tipo do item enviado para exclusão. |
item_id | string | ID do item enviado para exclusão. |
Regras importantes
- Ao excluir uma pasta, arquivos e subpastas internas também entram no fluxo de exclusão.
- Pastas com upload em andamento não podem ser excluídas até o upload finalizar ou falhar.
- Se houver falha ao remover objeto do storage, o item pode ficar com status
delete_failed.
⌘I

