Sample - Slack Web API
POST/files.delete

Delete a file

Deletes a file identified by its file ID. Use the file field to select the file and provide a token with the required file-writing scope. The operation returns a success indicator when the file is deleted.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

1 parameter · 1 body field
tokenstringoptional
Authentication token with the `files:write:user` scope.

Form-encoded data identifying the file to delete.

filestringoptional
ID of file to delete.

2 status codes
200Returns an object with `ok` set to true when the file is deleted.
okbooleanrequired
Allowed:true
defaultReturns an object with `ok` set to false and an `error` value when the file cannot be deleted or the request is invalid.
callstackstringoptional
Note: PHP callstack is only visible in dev/qa
errorstringrequired
Allowed:file_not_foundfile_deletedcant_delete_filenot_authedinvalid_authaccount_inactiveno_permissioninvalid_arg_nameinvalid_array_arginvalid_charsetinvalid_form_datainvalid_post_type
okbooleanrequired
Allowed:false

Error handling

file must identify the file you want to delete. The authentication token must have the files:write:user scope when authentication is required.