Delete File
curl --request DELETE \
--url https://api.invaro.ai/api/v1/files/{file_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.invaro.ai/api/v1/files/{file_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.invaro.ai/api/v1/files/{file_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.invaro.ai/api/v1/files/{file_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.invaro.ai/api/v1/files/{file_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.invaro.ai/api/v1/files/{file_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.invaro.ai/api/v1/files/{file_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{
"success": true,
"data": {
"file_id": "72f574a0-b3d2-4a0f-8527-f542e6ea7500",
"message": "File deleted successfully"
}
}Files API (NEW)
Delete File
Delete a file permanently
DELETE
/
files
/
{file_id}
Delete File
curl --request DELETE \
--url https://api.invaro.ai/api/v1/files/{file_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.invaro.ai/api/v1/files/{file_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.invaro.ai/api/v1/files/{file_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.invaro.ai/api/v1/files/{file_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.invaro.ai/api/v1/files/{file_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.invaro.ai/api/v1/files/{file_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.invaro.ai/api/v1/files/{file_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{
"success": true,
"data": {
"file_id": "72f574a0-b3d2-4a0f-8527-f542e6ea7500",
"message": "File deleted successfully"
}
}Delete File
DELETE/files/{file_id}
Permanently delete a file from the system. This operation removes the file completely and cannot be undone.
Features
- Permanently deletes the file
- File completely removed from system
- Cannot be undone - use with caution
- User ownership validation
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
file_id | string | Yes | Unique identifier of the file to delete |
Request
curl -X DELETE "https://api.invaro.ai/api/v1/files/72f574a0-b3d2-4a0f-8527-f542e6ea7500" \
-H "Authorization: Bearer your_api_key"
Response
{
"success": true,
"data": {
"file_id": "72f574a0-b3d2-4a0f-8527-f542e6ea7500",
"message": "File deleted successfully"
}
}
Response Fields
| Field | Type | Description |
|---|---|---|
file_id | string | ID of the deleted file |
message | string | Confirmation message |
Important Notes
- Irreversible: Deletion cannot be undone
- Permanent Deletion: File is completely removed from the system
- No Recovery: File cannot be recovered after deletion
- Complete Removal: All file data and metadata are permanently deleted
Error Responses
- 404 Not Found: File doesn’t exist or user doesn’t have access
- 409 Conflict: File is already deleted
- 403 Forbidden: User doesn’t own the file
Try It Out
Use the interactive playground above to test the delete file endpoint. You can:- Add your API key in the Authorization header
- Enter a file ID in the path parameter (use a UUID from your uploaded files)
- Execute the request to permanently delete the file
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Unique identifier of the file