Sample - Slack Web API
POST/files.sharedPublicURL

Enable a file for public sharing

Enables a file for public or external sharing. Supply the file identifier in file and an authentication token with the required file-writing scope. The response includes the updated file object after sharing is enabled.

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

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

Optional form data identifying the file to enable for public or external sharing.

filestringoptional
File to share

2 status codes
200Returns an object with `ok` set to true and the updated `file` object.
fileobjectrequired
okbooleanrequired
Allowed:true
defaultReturned when the file cannot be shared or the authentication token, permissions, or request arguments are invalid; the response includes `ok` set to false and an `error` reason.
callstackstringoptional
Note: PHP callstack is only visible in dev/qa
errorstringrequired
Allowed:file_not_foundnot_allowednot_authedinvalid_authaccount_inactivetoken_revokedno_permissionorg_login_requireduser_is_botuser_is_restrictedinvalid_arg_nameinvalid_array_arg
okbooleanrequired
Allowed:false

Error handling

The token must include the files:write:user scope. Supply file to identify the file to share, and use a valid authentication token when the header is provided.