Delete file

December 23, 2024

Table of contents

  1. Request Headers
  2. Path parameter
  3. Responses
  4. Examples
  5. Try It

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
Path parameter
  • fileID is required. Specify the fileID you want to delete.
Responses
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())
    
Try It