Delete a file
DELETE
/files/{fileId}
const url = 'https://firma.company-gpt.com/companygpt/rag/api/files/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request DELETE \ --url https://firma.company-gpt.com/companygpt/rag/api/files/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \ --header 'Authorization: Bearer <token>'Delete a file and remove it from all indexes. Only the collection owner or a collection admin may delete.
Authorizations
Abschnitt betitelt „Authorizations“Parameters
Abschnitt betitelt „Parameters“Path Parameters
Abschnitt betitelt „Path Parameters“fileId
required
string format: uuid
File UUID
Responses
Abschnitt betitelt „Responses“File deleted
Media typeapplication/json
Generic status acknowledgement returned by several action endpoints
object
status
required
string
Examplegenerated
{ "status": "example"}Unauthorized
Media typeapplication/json
object
error
required
Error message
string
Examplegenerated
{ "error": "example"}File not found (also returned instead of 403 when access is denied, to avoid revealing existence)
Media typeapplication/json
object
error
required
Error message
string
Examplegenerated
{ "error": "example"}