Sample - Slack Web API
POST/files.revokePublicURL

Revoke a file's public URL

Revokes public or external sharing access for a file. Supply the file ID in file to identify the file whose public access you want to remove. The response includes the updated file object after access is revoked.

  • 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 whose public sharing access will be revoked.

filestringoptional
File to revoke

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

Error handling

file must identify the file whose public or external sharing access you want to revoke. The authentication token must have the files:write:user scope.