How to Delete a File on OpenAI using an API Request
Contribution by Troy Tessalone
Troy is a Certified Zapier Expert who puts Programmable Productivity to work for YOU!
App
OpenAI
- Available OpenAI Zap app triggers/actions: https://zapier.com/apps/openai/integrations#triggers-and-actions
Action
Action: OpenAI - API Request
NOTES:
- This action will handle the OpenAI authentication for you.
- OpenAI File IDs start with “file-”
- Example: file-XXXXX
![](https://uploads-us-west-2.insided.com/zapier-ca/attachment/2a4a97d9-d2f6-458a-aa3f-923cff23f692.png)
API
OpenAI API docs for the endpoint: https://platform.openai.com/docs/api-reference/files/delete
![](https://uploads-us-west-2.insided.com/zapier-ca/attachment/3ebb4a7d-369d-4bb4-8c74-21000cf948a7.png)
CONFIG
HTTP Method: DELETE
URL: https://api.openai.com/v1/files/{file_id}
NOTES:
- Map the OpenAI File ID from a previous Zap step as part of the URL
- You can leave all the other sections/fields blank
![](https://uploads-us-west-2.insided.com/zapier-ca/attachment/0ab61f1e-582c-43ba-b8e6-1c2649d58830.png)