To delete a file from the Library by providing its unique `file_id`
DELETEhttps://api.knowbase.ai/api/v1/delete
Headers
Name
Type
Description
access-token*
string
Required. Your API access token
Request Body
Name
Type
Description
file_id*
string
The ID of the file to summarize
{"message":"string"}
{"detail":"string"}
{"error":"string"}
Example usage
import requestsimport json# The URL for the delete endpointurl ='https://api.knowbase.ai/api/v1/delete'# Replace 'your_access_token_here' with the actual access token you received from the APIheaders ={'access-token':'your_access_token_here','Content-Type':'application/json'# Specify the content type as JSON}# Replace 'your_file_id_here' with the actual file ID you want to deletedata ={'file_id':'your_file_id_here'}# Make the DELETE request to delete the fileresponse = requests.delete(url, headers=headers, data=json.dumps(data))# Check the responseif response.status_code ==200:print("File deleted successfully.")print(response.json())# This will print the success messageelif response.status_code ==404:print("File not found.")print(response.json())# This will print the error messageelse:print("Failed to delete file.")print(response.json())# This will print the error message