Delete file
December 23, 2024
Table of contents
Use this endpoint to delete file uploaded by
This endpoint will return a response 200
if you’re trying to delete a file that does not exist or has already been deleted. It is safe to say it always succeeds.
https://api.useapi.net/v1/minimax/files/
fileID
Request Headers
Authorization: Bearer {API token}
Content-Type: application/json
API token
is required, see Setup useapi.net for details.
Path parameter
fileID
is required. Specify the fileID you want to delete.
Responses
-
{ "error": "<Error message>", "code": 400 }
-
{ "error": "Unauthorized", "code": 401 }
Examples
-
curl -X DELETE "https://api.useapi.net/v1/minimax/files/fileID" \ -H "Accept: application/json" \ -H "Authorization: Bearer …"
-
const token = "API token"; const fileID = "fileID to delete"; const apiUrl = `https://api.useapi.net/v1/minimax/files/${fileID}`; const response = await fetch(apiUrl, { method: 'DELETE', headers: { "Authorization": `Bearer ${token}`, }, }); const result = await response.json(); console.log("response", {response, result});
-
import requests token = "API token" fileID = "fileID to delete" apiUrl = f"https://api.useapi.net/v1/minimax/files/{fileID}" headers = { "Content-Type": "application/json", "Authorization" : f"Bearer {token}" } response = requests.delete(apiUrl, headers=headers) print(response, response.json())