Packages

A Slack Web & Real Time Messaging API client.

Current section

Files

Jump to
slack_kit priv docs methods files.upload.json
Raw

priv/docs/methods/files.upload.json

{
"args": {
"channels": {
"desc": "Comma-separated list of channel names or IDs where the file will be shared.",
"required": false,
"type": "string"
},
"content": {
"desc": "File contents via a POST variable. If omitting this parameter, you must provide a `file`. You must provide either a `file` or `content` parameter. The content of the file can either be posted using an `enctype` of `multipart/form-data` (with the file parameter named `file`), in the usual way that files are uploaded via the browser, or the content of the file can be sent as a POST var called `content`.",
"example": "...",
"required": false,
"type": "string"
},
"file": {
"desc": "File contents via `multipart/form-data`. If omitting this parameter, you must submit `content`. You must provide either a `file` or `content` parameter. The content of the file can either be posted using an `enctype` of `multipart/form-data` (with the file parameter named `file`), in the usual way that files are uploaded via the browser, or the content of the file can be sent as a POST var called `content`. Possible `filetype` values can be found in the `file` object definition.",
"example": "...",
"required": false
},
"filename": {
"desc": "Filename of file. If you only specify a `filename`, we remove the file extension and populate the file's `title` with the remaining value.",
"example": "foo.txt",
"required": false,
"type": "string"
},
"filetype": {
"desc": "A file type identifier. Possible `filetype` values can be found in the `file` object definition.",
"example": "php",
"required": false,
"type": "string"
},
"initial_comment": {
"desc": "The message text introducing the file in specified `channels`.",
"example": "Best!",
"required": false,
"type": "string"
},
"thread_ts": {
"desc": "Provide another message's `ts` value to upload this file as a reply. Never use a reply's `ts` value; use its parent instead.",
"required": false,
"type": "string"
},
"title": {
"desc": "Title of file. If you only specify a `filename`, we remove the file extension and populate the file's `title` with the remaining value.",
"example": "My File",
"required": false,
"type": "string"
}
},
"desc": "Uploads or creates a file.",
"errors": {
"blocked_file_type": "Admin has disabled uploading this type of file",
"channel_not_found": "At least one of the values passed for `channels` was invalid.",
"invalid_channel": "One or more channels supplied are invalid",
"invalid_thread_ts": "Value passed to thread\\_ts was invalid",
"malware_detected": "This file may contain a virus or other malware and can't be uploaded to Slack",
"not_in_channel": "Authenticated user is not in the channel.",
"post_contents_too_large": "File content is larger than 130kb.",
"posting_to_general_channel_denied": "An admin has restricted posting to the #general channel.",
"slack_connect_blocked_file_type": "File uploads with certain types are blocked in all Slack Connect communications",
"slack_connect_clip_sharing_blocked": "Admin has disabled Clip sharing in Slack Connect channels",
"slack_connect_file_upload_sharing_blocked": "Admin has disabled File uploads in all Slack Connect communications"
},
"rate_limit": {
"label": "Tier 2: 20+ per minute",
"url": "https://docs.slack.dev/apis/web-api/rate-limits"
},
"scopes": {
"bot": [
{
"name": "files:write",
"url": "https://docs.slack.dev/reference/scopes/files.write"
}
],
"user": [
{
"name": "files:write",
"url": "https://docs.slack.dev/reference/scopes/files.write"
}
]
}
}