Skip to main content

File object

A file object contains information about a file shared with a workspace.

{
"id": "F0A12BCDE",
"created": 1531763342,
"timestamp": 1531763342,
"name": "tedair.gif",
"title": "tedair.gif",
"mimetype": "image/gif",
"filetype": "gif",
"pretty_type": "GIF",
"user": "U012A3BCD",
"editable": false,
"size": 137531,
"mode": "hosted",
"is_external": false,
"external_type": "",
"is_public": true,
"public_url_shared": false,
"display_as_bot": false,
"username": "",
"url_private": "https://.../tedair.gif",
"url_private_download": "https://.../tedair.gif",
"thumb_64": "https://.../tedair_64.png",
"thumb_80": "https://.../tedair_80.png",
"thumb_360": "https://.../tedair_360.png",
"thumb_360_w": 176,
"thumb_360_h": 226,
"thumb_160": "https://.../tedair_=_160.png",
"thumb_360_gif": "https://.../tedair_360.gif",
"image_exif_rotation": 1,
"original_w": 176,
"original_h": 226,
"deanimate_gif": "https://.../tedair_deanimate_gif.png",
"pjpeg": "https://.../tedair_pjpeg.jpg",
"permalink": "https://.../tedair.gif",
"permalink_public": "https://.../...",
"comments_count": 0,
"is_starred": false,
"shares": {
"public": {
"C0A1BC2DE": [
{
"reply_users": [
"U012A3BCD"
],
"reply_users_count": 1,
"reply_count": 1,
"ts": "1531763348.000001",
"thread_ts": "1531763273.000015",
"latest_reply": "1531763348.000001",
"channel_name": "file-under",
"team_id": "T012AB3C4"
}
]
}
},
"channels": [
"C0A1BC2DE"
],
"groups": [],
"ims": [],
"has_rich_preview": false
}

Properties

FieldTypeDescription
ai_generatedBooleanWhether the file was AI-generated.
bot_idStringID of the bot that uploaded the file.
bot_user_idStringBot user ID associated with the file.
channelsArrayContains the IDs of any channels with which the file is currently shared.
createdUnix timestampA Unix timestamp representing when the file was created.
editableBooleanIndicates whether files are stored in editable mode.
edit_linkString (URL)Only present for posts and snippets and is the page at which the file can be edited.
external_idStringID of the file in an external system.
external_typeStringIndicates what kind of external file it is; possible values: "", gdrive, dropbox, box, onedrive, app, undefined, salesforce.
external_urlString (URI) or nullURL of the file in an external system.
filetypeStringThe file's type. Note the mimetype and filetype properties do not have a 1-to-1 mapping, as multiple different files types (html, js, etc.) share the same mime type.
groupsArrayContains the IDs of any private groups with which the file is currently shared. Groups are only returned if the caller is a member of that group.
idStringThe ID of the file object.
imsArrayContains the IDs of any direct message channels with which the file is currently shared. Messages are only returned if the caller is a member of that channel.
initial_commentObjectA comment from the file uploader. Will only be set when the uploader commented on the file at the time of upload. Clients can use this to display the comment with the file when announcing new file uploads. Use comments_count to determine how many comments are attached to a file.
is_externalBooleanIndicates whether or not the master copy of a file is stored within the system. If is_external is true, the url property will point to the externally-hosted master file.
is_publicBooleanWill be true if the file is public.
is_starredBooleanWill be true if the calling user has starred the file, else it will be omitted.
mimetypeStringThe file's mimetype.
modeStringOne of the following: hosted, external, snippet or post.
nameStringName of the file; may be null for unnamed files.
num_starsIntegerContains the number of users who have starred this file. Will not be present if no users have starred it.
permalinkString (URL)Points to a single page for the file containing details, comments, and a download link. If the file is available to the public, a permalink_public URL points to the public file itself.
pinned_toArrayContains the IDs of any channels in which the file is currently pinned.
pretty_typeStringA human-readable version of the type.
public_url_sharedBooleanWill be true if the file's public URL has been shared.
reactionsArray of reaction objectsContains any reactions that have been added to the file. Gives information about the type of reaction, the total number of users who added that reaction, and a (possibly incomplete) list of users who have added that reaction to the file. The users array in the reactions property may not always contain all users that have reacted (we limit it, and the quantity might change); however, count will always represent the count of all users who made that reaction (i.e., it may be greater than users.length). If the authenticated user has a given reaction then they are guaranteed to appear in the users array regardless of whether count is greater than users.length or not.
sizeIntegerThe filesize in bytes. Snippets are limited to a maximum file size of 1 megabyte.
stateString or nullCurrent file state.
subtypeStringFile subtype.
timestampInteger or nullA deprecated property that is provided only for backwards compatibility with older clients.
titleStringTitle of the file.
updatedUnix timestampFor Post filetypes only; a Unix timestamp of when the Post was last edited.
userStringThe ID of the user who created the object.

Previews

For posts, a short plain-text preview is also included that can be shown in place of a thumbnail.

For snippets, a preview of the contents is included (a few truncated lines of plaintext), as well as a more complex syntax-highlighted preview (preview_highlight) in HTML. The total count of lines in the snippet is returned in lines, while lines_more contains a count of lines not shown in the preview.

Depending on the file's type, you may encounter different fields relevant to that type. For instance, you may encounter fields such as image_exif_rotation, original_w, and original_h for images, but will not find those fields for HTML documents.

Access control / Sharing

Authentication is required to retrieve file URLs.

The url_private property points to a URL with the file contents. Editable-mode files will also have a url_private_download parameter, which includes headers to force a browser download. Both url_private and url_private_download require an authorization header of the form:

Authorization: Bearer A_VALID_TOKEN

In this case, A_VALID_TOKEN is representative of a real OAuth token, bearing at least the files:read scope. Learn more about OAuth Scopes.

Fields providing URLs that require this form of authentication include:

  • url_private
  • url_private_download
  • thumb_64
  • thumb_80
  • thumb_160
  • thumb_360
  • thumb_480
  • thumb_720
  • thumb_960
  • thumb_1024
The url and url_download parameters have been deprecated.

Please use url_private and url_private_download instead.

FieldTypeDescription
accessStringAccess level of the file.
dm_mpdm_users_with_file_accessArray of objectsDM/MPDM users with file access (each has user_id, access).
external_workspaces_with_read_accessArray of team_idExternal workspaces/Slack Connect spaces this file is pinned to that the viewer is a member of.
file_accessStringFile access level (e.g. "check_file_info" for Slack Connect files).
has_more_sharesBooleanWhether there are additional shares not returned.
is_restricted_sharing_enabledBooleanWhether restricted sharing is enabled.
last_readIntegerUnix timestamp of when the file was last read.
most_recent_access_request_tsIntegerUnix timestamp of the most recent access request.
org_or_workspace_accessStringOrganization or workspace access level.
private_channels_with_file_access_countIntegerCount of private channels with access to this file.
private_external_workspaces_with_read_access_countIntegerCount of external workspaces with access that the viewer is not a member of.
restriction_typeInteger (enum: 0, 1)0 = no restrictions, 1 = DSA restricted.
skipped_sharesBooleanWhether some shares were skipped in the response.
source_teamteam_idTeam where the file originated.
teams_shared_withArray of team_idTeams the file is shared with.
user_teamteam_idTeam of the user who created the file.

AI / Skills

FieldTypeDescription
ai_skill_example_promptsArray of stringAI-generated example prompts that trigger this skill.
ai_skill_library_countIntegerNumber of users who added this skill to their library.
ai_skill_usage_countIntegerTotal times this skill has been loaded across all users.
ai_summaryObjectAI-generated file summary.
excluded_from_slack_aiBooleanWhether the file is excluded from Slack AI.
is_ai_suggestedBooleanWhether the file was suggested by AI.
is_skillBooleanWhether this canvas is a Slackbot AI skill.
skill_descriptionStringDescription of what this skill does.

Audio / Video / Media

FieldTypeDescription
aacStringURL to AAC audio.
accStringURL to ACC audio.
audio_wave_samplesArray of integersAudio waveform sample data.
duration_msIntegerDuration of audio/video in milliseconds.
hlsStringURL to HLS video stream.
hls_embedStringURL to HLS embed stream.
hls_previewStringURL to HLS preview stream.
is_transcription_region_supportedBooleanWhether transcription is supported for this file.
media_display_typeStringHow the media should be displayed.
media_progressObjectMedia playback progress tracking.
mp4StringURL to MP4 video.
mp4_lowStringURL to low-bitrate MP4 video.
vttStringWebVTT subtitle/caption content.

Canvas properties

FieldTypeDescription
canvas_agent_creator_idStringAI agent ID that created the canvas.
canvas_creator_idStringUser ID of the canvas creator.
canvas_default_agent_idStringDefault AI agent ID for the canvas.
canvas_metadataObjectCanvas metadata (contains originating_huddle_id, items).
canvas_printing_enabledBooleanWhether canvas printing org pref is enabled.
canvas_readtimeNumberApproximate read time for canvas content.
is_channel_spaceBooleanWhether the file is a channel space canvas.
linked_channel_idStringChannel ID this canvas is linked to.
source_canvas_idfile_idSource canvas ID if this canvas was duplicated.
team_pref_version_history_enabledBoolean or nullWhether version history team pref is enabled.
title_blocksArray of rich_text_title_blockStructured title blocks for canvases.

Canvas template properties

FieldTypeDescription
canvas_template_modeEnumTemplate publication status. Possible values: draft, published, sales_draft, sales_published, solutions_published.
is_global_templateBooleanWhether this is a global template.
is_org_visibleBooleanWhether the template is visible to the org.
template_conversion_tsInteger or nullUnix timestamp of template conversion.
template_converter_iduser_id or nullUser who converted the template.
template_descriptionStringTemplate description.
template_iconStringTemplate icon.
template_localeStringTemplate locale.
template_nameStringTemplate name.
template_titleStringTemplate title.

Editing / Collaboration

FieldTypeDescription
can_toggle_canvas_lockBoolean or nullWhether the viewer can toggle the canvas lock.
edit_timestampInteger or nullUnix timestamp of last edit.
editoruser_id or nullCurrent editor of the file.
editorsArray of stringList of canvas editor user IDs.
editors_countInteger or nullNumber of editors.
is_lockedBooleanWhether the file is locked.
last_editoruser_id or nullLast user to edit the file.
non_owner_editableBoolean or nullWhether non-owners can edit the file.
show_badgeBooleanWhether to show an editor badge.

Email properties

FieldTypeDescription
attachmentsArray of objectEmail attachments (each has filename, size, mimetype, url, slack_file_id, etc.).
ccArray of email_addressCC recipients.
email_securityObjectEmail security info (contains has_valid_dmarc).
fromArray of email_addressEmail sender(s).
headersObjectRaw email headers.
inline_attachment_countIntegerNumber of inline email attachments.
meeting_metadataObjectMeeting metadata extracted from calendar invites (contains meeting_object_id, meeting_provider, title, description, etc.).
office_pdfStringURL to Office document PDF conversion.
original_attachment_countIntegerOriginal number of email attachments.
sent_to_selfBooleanWhether the email was sent to the user's own address.
simplified_htmlStringSimplified HTML version of the email.
subjectStringEmail subject line.
toArray of email_addressEmail recipients (each has address, name, original, slack_user_id).

Lifecycle / Deletion

FieldTypeDescription
date_deleteIntegerUnix timestamp of file deletion.
is_archivedBooleanWhether the file is archived.
is_deletedBooleanWhether the file has been deleted.
is_hidden_by_limitIntegerWhether the file is hidden due to a limit.
is_legally_heldBooleanWhether the file is under a legal hold.
is_tombstonedBooleanWhether the file has been tombstoned.
migrated_idStringID of the file after migration.
update_notificationInteger or nullUnix timestamp of update notification.

Lists properties

FieldTypeDescription
list_csv_download_urlStringURL to download the list as CSV.
list_limitsObjectThe List count of the current amount of rows/items, columns, views, and archived items. It also has the limits for each entity, including the maximum amount of items a List can have. Task tracking field columns (todo_completed, todo_due_date, and todo_assignee type columns) don't count towards the column_count limit.
list_metadataObjectThis field contains List information such as List schema, which includes all columns with header names of the List. This field also has List view information (all existing views for the given List) and subtasks schema (column information for subtasks). The header name for columns will be present in the schema[].name field, and List view names will be present in the views[].name field.
list_recordsArray of list_recordList row/record data.
list_template_localization_statusStringLocalization status of the list template.
list_template_modeRef (template_status)List template publication status.
list_template_typeRef (template_type)List template type.
todosRef (list_todo_message_attachment)List todo message attachment data.

Stars / Saved / Pinning

FieldTypeDescription
actionsArray of objectFile actions (each has ts, event_type).
favoritesArray of objectFavorites collections containing this file (each has collection_id, collection_name, position).
pinned_infoObjectDetailed pinning information.
savedObjectSaved/bookmarked message reference.

Text content / Previews

FieldTypeDescription
alt_text_highlightsStringAlt text with search highlighting markers.
alt_txtStringAlternative text for image files.
annotation_countIntegerNumber of annotations on the file.
contentsStringFull file contents.
contents_extractsArray of stringContent extracts from the file.
contents_highlightStringFile contents with search highlighting.
file_contents_hlObjectFile contents with highlighting (contains lines array).
formattedStringFormatted content.
has_moreBooleanWhether more content is available.
path_to_rootArray of stringPath hierarchy to root.
plain_textStringPlain text version of the file.
preview_is_truncatedBooleanWhether the preview was truncated.
preview_plain_textStringPlain text preview.

Thumbnails (dimensions and extra formats)

If a thumbnail is available for the file, the URL to a 64x64 pixel thumbnail will be returned as the thumb_64 property.

The thumb_80 property, when present, contains the URL of an 80x80 pixel thumbnail. Unlike the 64px thumbnail, this size is guaranteed to be 80x80, even when the source image was smaller (it is padded with transparent pixels).

A variable-sized thumbnail will be returned as thumb_360, with its longest size no bigger than 360 pixels(although it may be smaller depending on the source size). Dimensions for this thumb are returned in thumb_360_w and thumb_360_h. In the case where the original image was an animated gif with dimensions greater than 360 pixels, an animated thumbnail is also created and passed as thumb_360_gif.

Depending on the original file's size, you may even find a thumb_480, thumb_720, thumb_960, or thumb_1024 property.

All thumbnails require an authorization header as described above.

FieldTypeDescription
converted_pdfStringURL to a converted PDF version of the file.
deanimateString (URI)URL to deanimated version of the file (distinct from deanimate_gif).
thumb_480_gifString (URI)URL to animated 480px thumbnail for GIFs.
thumb_480_hIntegerHeight of the 480px thumbnail.
thumb_480_wIntegerWidth of the 480px thumbnail.
thumb_720_hIntegerHeight of the 720px thumbnail.
thumb_720_wIntegerWidth of the 720px thumbnail.
thumb_800String (URI)URL to 800px thumbnail.
thumb_800_hIntegerHeight of the 800px thumbnail.
thumb_800_wIntegerWidth of the 800px thumbnail.
thumb_960_hIntegerHeight of the 960px thumbnail.
thumb_960_wIntegerWidth of the 960px thumbnail.
thumb_1024_hIntegerHeight of the 1024px thumbnail.
thumb_1024_wIntegerWidth of the 1024px thumbnail.
thumb_pdfString (URI)URL to PDF thumbnail.
thumb_pdf_hIntegerHeight of the PDF thumbnail.
thumb_pdf_wIntegerWidth of the PDF thumbnail.
thumb_tinyStringTiny inline thumbnail (base64-encoded).
thumb_videoString (URI)URL to video thumbnail.
thumb_video_hIntegerHeight of the video thumbnail.
thumb_video_tsStringTimestamp within the video used for the thumbnail.
thumb_video_wIntegerWidth of the video thumbnail.
url_static_previewStringURL to a static preview image.

Transcription / Huddle

FieldTypeDescription
huddle_date_endIntegerEnd time of the huddle (Unix timestamp).
huddle_date_startIntegerStart time of the huddle (Unix timestamp).
huddle_participant_idsArray of user_idUser IDs of all huddle participants.
huddle_summary_idsummary_idID of the associated huddle summary.
huddle_transcript_file_idfile_idID of the associated huddle transcript file.
huddle_transcriptionObjectFull huddle transcription (contains blocks, lines, date_start, date_end, channel_id, transcription_time_ranges).
is_huddle_canvasBooleanWhether the file is a huddle canvas.
transcriptionObjectTranscription data for audio/video files.
transcription_hlObjectTranscription with search highlighting (contains lines array with start_time_ms, contents).

Work objects / App integration

FieldTypeDescription
app_idStringID of the associated app.
app_nameStringName of the associated app.
app_provides_file_work_objectsBooleanWhether the app provides file work objects.
embedded_file_idsArray of stringIDs of files embedded within this file.
entity_idStringWork object entity ID associated with this file.
full_size_preview_supportedBooleanWhether full size preview is supported in work objects.
is_salesforce_fileBooleanWhether the file is a Salesforce file.
product_iconObjectProduct icon to use when rendering the file.
quip_thread_idStringAssociated Quip thread ID.

Slack Connect files

When a file is uploaded to a Slack Connect channel, file object properties are not immediately accessible to apps listening via the Events API or the legacy RTM API. Instead, the payload will contain a file object with the key-value pair "file_access": "check_file_info" meaning that further action is required from your app in order to view an uploaded file's metadata.

{
...
"files": [
{
"id": "F12345678",
"mode": "file_access",
"file_access": "check_file_info",
"created": 0,
"timestamp": 0,
"user": ""
}
]
...
}

See the Slack Connect overview page for more details on how to handle this scenario.

File types

Possible filetype values include, but are not limited to, the following:

TypeDescription
autoAuto Detect Type
textPlain Text
aiIllustrator File
apkAPK
applescriptAppleScript
binaryBinary
bmpBitmap
boxnoteBoxNote
cC
csharpC#
cppC++
cssCSS
csvCSV
clojureClojure
coffeescriptCoffeeScript
cfmColdFusion
dD
dartDart
diffDiff
docWord Document
docxWord document
dockerfileDocker
dotxWord template
emlEmail
epsEPS
epubEPUB
erlangErlang
flaFlash FLA
flvFlash video
fsharpF#
fortranFortran
gdocGDocs Document
gdrawGDocs Drawing
gifGIF
goGo
gpresGDocs Presentation
groovyGroovy
gsheetGDocs Spreadsheet
gzipGzip
htmlHTML
handlebarsHandlebars
haskellHaskell
haxeHaxe
inddInDesign Document
javaJava
javascriptJavaScript
jpgJPEG
jsonJSON
keynoteKeynote Document
kotlinKotlin
latexLaTeX/sTeX
lispLisp
luaLua
m4aMPEG 4 audio
markdownMarkdown (raw)
matlabMATLAB
mhtmlMHTML
mkvMatroska video
movQuickTime video
mp3mp4
mp4MPEG 4 video
mpgMPEG video
mumpsMUMPS
numbersNumbers Document
nzbNZB
objcObjective-C
ocamlOCaml
odgOpenDocument Drawing
odiOpenDocument Image
odpOpenDocument Presentation
odsOpenDocument Spreadsheet
odtOpenDocument Text
oggOgg Vorbis
ogvOgg video
pagesPages Document
pascalPascal
pdfPDF
perlPerl
phpPHP
pigPig
pngPNG
postSlack Post
powershellPowerShell
pptPowerPoint presentation
pptxPowerPoint presentation
psdPhotoshop Document
puppetPuppet
pythonPython
qtzQuartz Composer Composition
rR
rtfRich Text File
rubyRuby
rustRust
sqlSQL
sassSass
scalaScala
schemeScheme
sketchSketch File
shellShell
smalltalkSmalltalk
svgSVG
swfFlash SWF
swiftSwift
tarTarball
tiffTIFF
tsvTSV
vbVB.NET
vbscriptVBScript
vcardvCard
velocityVelocity
verilogVerilog
wavWaveform audio
webmWebM
wmvWindows Media Video
xlsExcel spreadsheet
xlsxExcel spreadsheet
xlsbExcel Spreadsheet (Binary, Macro Enabled)
xlsmExcel Spreadsheet (Macro Enabled)
xltxExcel template
xmlXML
yamlYAML
zipZip