Search + K

Command Palette

Search for a command to run...

Sign In

files_upload

POST /files.upload
Copy endpoint
https://slack.com/api

Uploads or creates a file.

Request Body

application/x-www-form-urlencoded
{
channels?: string;
content?: string;
file?: string;
filename?: string;
filetype?: string;
initial_comment?: string;
thread_ts?: number;
title?: string;
token?: string;
}

Responses

200 application/json

Success response after uploading a file to a channel with an initial message

{ file: ObjsFile
interface ObjsFile {
channels?: DefsChannelId[];
comments_count?: number;
created?: number;
date_delete?: number;
display_as_bot?: boolean;
editable?: boolean;
editor?: DefsUserId;
external_id?: string;
external_type?: string;
external_url?: string;
filetype?: string;
groups?: DefsGroupId[];
has_rich_preview?: boolean;
id?: DefsFileId;
image_exif_rotation?: number;
ims?: DefsDmId[];
is_external?: boolean;
is_public?: boolean;
is_starred?: boolean;
is_tombstoned?: boolean;
last_editor?: DefsUserId;
mimetype?: string;
mode?: string;
name?: string;
non_owner_editable?: boolean;
num_stars?: number;
original_h?: number;
original_w?: number;
permalink?: string;
permalink_public?: string;
pinned_info?: DefsPinnedInfo;
pinned_to?: DefsChannel[];
pretty_type?: string;
preview?: string;
public_url_shared?: boolean;
reactions?: ObjsReaction[];
shares?: { private?: unknown;public?: unknown; };
size?: number;
source_team?: DefsTeam;
state?: string;
thumb_1024?: string;
thumb_1024_h?: number;
thumb_1024_w?: number;
thumb_160?: string;
thumb_360?: string;
thumb_360_h?: number;
thumb_360_w?: number;
thumb_480?: string;
thumb_480_h?: number;
thumb_480_w?: number;
thumb_64?: string;
thumb_720?: string;
thumb_720_h?: number;
thumb_720_w?: number;
thumb_80?: string;
thumb_800?: string;
thumb_800_h?: number;
thumb_800_w?: number;
thumb_960?: string;
thumb_960_h?: number;
thumb_960_w?: number;
thumb_tiny?: string;
timestamp?: number;
title?: string;
updated?: number;
url_private?: string;
url_private_download?: string;
user?: string;
user_team?: DefsTeam;
username?: string;
}
;ok: DefsOkTrue
type DefsOkTrue = true
; }
default application/json

Typical error response

{ callstack?: string;error: "posting_to_general_channel_denied" | "invalid_channel" | "file_uploads_disabled" | "file_uploads_except_images_disabled" | "storage_limit_reached" | "not_authed" | "invalid_auth" | "account_inactive" | "no_permission" | "invalid_arg_name" | "invalid_array_arg" | "invalid_charset" | "invalid_form_data" | "invalid_post_type" | "missing_post_type" | "team_added_to_org" | "invalid_json" | "json_not_object" | "request_timeout" | "upgrade_required";ok: DefsOkFalse
type DefsOkFalse = false
; }