Sample - Slack Web API
POST/files.remote.add

Add a remote file

Adds a file hosted by a remote service. Supply the remote file identity and metadata such as title, filetype, and external_url to register it. You can also provide preview_image and searchable text in indexable_file_contents.

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

7 body fields

Form-encoded data describing the remote file to add.

tokenstringoptional
Authentication token. Requires scope: `remote_files:write`
external_idstringoptional
Creator defined GUID for the file.
titlestringoptional
Title of the file being shared.
filetypestringoptional
type of file
external_urlstringoptional
URL of the remote file.
preview_imagestringoptional
Preview of the document via `multipart/form-data`.
indexable_file_contentsstringoptional
A text file (txt, pdf, doc, etc.) containing textual search terms that are used to improve discovery of the remote file.

2 status codes
200Returns an object with `ok` set to true when the remote file is added.
okbooleanrequired
Allowed:true
defaultReturns an object with `ok` set to false when the remote file cannot be added or the request is invalid.
okbooleanrequired
Allowed:false

Error handling

The authentication token must have the remote_files:write scope. external_id identifies the file in the remote service, external_url must identify its remote location, and preview_image is supplied through multipart form data when used.