Endpoint workflow replacement
Slack files.getUploadURLExternal completeUploadExternal bytes upload no file appears channel
Bytes upload successfully, yet no Slack file appears in the channel.
Agent Quick Fix
The upload URL step only reserves a file. The bytes must be uploaded to the returned URL, then `files.completeUploadExternal` must complete the same file ID and share it to a channel.
Product: Slack file upload
Affected: Slack apps migrating from `files.upload` to the external upload sequence.
Current-contract area: External upload URL step succeeds but complete step is omitted
Likely root cause: Bytes upload successfully, yet no Slack file appears in the channel.
Patch:
const upload = await client.files.getUploadURLExternal({ filename: "report.txt", length: bytes.length });
await fetch(upload.upload_url, { method: "POST", body: bytes });
await client.files.completeUploadExternal({
files: [{ id: upload.file_id, title: "report.txt" }],
channel_id: channelId,
});
Validation Status
Codex searched organically in the validation run. No no-web counterfactual is attached to this page yet.
Symptom
Bytes upload successfully, yet no Slack file appears in the channel.
Upload URL request succeeds but no file appears in the channel
files.completeUploadExternal was not called or used the wrong file_id
Why This Happens
The upload URL step only reserves a file. The bytes must be uploaded to the returned URL, then `files.completeUploadExternal` must complete the same file ID and share it to a channel.
Before And After
Before
await client.files.getUploadURLExternal({ filename: "report.txt", length: bytes.length });
After
const upload = await client.files.getUploadURLExternal({ filename: "report.txt", length: bytes.length });
await fetch(upload.upload_url, { method: "POST", body: bytes });
await client.files.completeUploadExternal({
files: [{ id: upload.file_id, title: "report.txt" }],
channel_id: channelId,
});
Verification
node scripts/slack-upload-smoke.js
Common Wrong Fixes
- Do not retry `completeUploadExternal` blindly; the completion call is not a general idempotent repair path.
Codex Search Keywords
These are the search terms observed in a neutral Codex validation run for this failure shape.
Slack files.getUploadURLExternal completeUploadExternal bytes upload no file appears channel
files.getUploadURLExternal files.completeUploadExternal site:api.slack.com
https://api.slack.com/methods/files.getUploadURLExternal
https://api.slack.com/methods/files.completeUploadExternal
Source Trail
- Slack files.upload retirement: https://docs.slack.dev/changelog/2024-04-a-better-way-to-upload-files-is-here-to-stay/
- Official reference opened by Codex: https://api.slack.com/methods/files.getUploadURLExternal
- Official reference opened by Codex: https://api.slack.com/methods/files.completeUploadExternal
- Authoritative source: https://docs.slack.dev/changelog/2024-04-a-better-way-to-upload-files-is-here-to-stay