Slack · api · fg-0357

Downloading a Slack file from url_private saves an HTML sign-in page instead of the file

If you see Downloaded file is a few KB of HTML from slack.com, the cause and the fix for Slack are below, last verified 2026-10-15.

Verified Oct 2026trust 50/100
Symptom
Downloaded file is a few KB of HTML from slack.comPDF or image will not open after downloadHTTP 200 with content-type text/html for url_private_download
Cause
Private file URLs need an Authorization header with a bearer token that has files:read. Without it Slack answers with its login page and a 200 status, and the SDK WebClient does not wrap these URLs.
Fix
Fetch url_private_download with a plain HTTP client and an Authorization: Bearer header using a token that has files:read. Check the response content-type before saving.
Apply
r = requests.get(f["url_private_download"], headers={"Authorization": f"Bearer {bot_token}"}, timeout=30) assert not r.headers["content-type"].startswith("text/html")
Affected
Slack Web API file objects, all versions as of 2026-10
Sources

Last verified 2026-10-15 · Confirmed by 0 builders

Related traps

Have your agent know this before it fails

$ /plugin marketplace add getfootgun/footgun
$ /plugin install footgun@footgun