Slack Files API

Slack's Files API lets apps programmatically upload, share, and manage files in Slack. Apps can upload binaries (images, docs, code snippets) or register links to external files, then attach them to channels, DMs, or threads with optional captions. The API supports retrieving file metadata and content, listing and filtering files, generating or revoking public share links, and deleting files, with access controlled by app scopes and channel membership.

OpenAPI Specification

slack-files-openapi.yml Raw ↑
openapi: 3.1.0
info:
  version: "1.0"
  title: Slack Files API
  description: "Slack\x19s Files API lets apps programmatically upload, share, and manage files in Slack. Apps can upload binaries (images, docs, code snippets) or register links to external files, then
    attach them to channels, DMs, or threads with optional captions. The API supports retrieving file metadata and content, listing and filtering files, generating or revoking public share links, and deleting
    files, with access controlled by app scopes and channel membership. For large uploads, a two-step flow provides an upload URL before finalizing the file, and related Events API notifications (for example,
    file_created and file_shared) let apps react to changes. Common uses include import/export pipelines, compliance and archiving tools, and integrations with cloud storage."
paths:
  /files.comments.delete:
    post:
      tags:
      - Comments
      - Deletes
      - Files
      - Post
      description: Deletes an existing comment on a file.
      externalDocs:
        description: API method documentation
        url: https://api.slack.com/methods/files.comments.delete
      operationId: postFilesCommentsDelete
      parameters:
      - name: token
        in: header
        description: 'Authentication token. Requires scope: `files:write:user`'
        schema:
          type: string
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                file:
                  type: string
                  description: File to delete a comment from.
                id:
                  type: string
                  description: The comment to delete.
          application/json:
            schema:
              type: object
              properties:
                file:
                  type: string
                  description: File to delete a comment from.
                id:
                  type: string
                  description: The comment to delete.
      responses:
        '200':
          description: Standard success response is very simple
          content:
            application/json:
              schema:
                title: files.comments.delete schema
                required:
                - ok
                type: object
                properties:
                  ok:
                    $ref: '#/components/schemas/defs_ok_true'
                additionalProperties: false
                description: Schema for successful response files.comments.delete method
              example:
                ok: true
        default:
          description: Standard failure response when used with an invalid token
          content:
            application/json:
              schema:
                title: files.comments.delete error schema
                required:
                - error
                - ok
                type: object
                properties:
                  callstack:
                    type: string
                    description: 'Note: PHP callstack is only visible in dev/qa'
                  error:
                    type: string
                    enum:
                    - cant_delete
                    - comment_not_found
                    - 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
                    - invalid_json
                    - json_not_object
                    - request_timeout
                    - upgrade_required
                  ok:
                    $ref: '#/components/schemas/defs_ok_false'
                additionalProperties: false
                description: Schema for error response files.comments.delete method
              example:
                error: file_not_found
                ok: false
      security:
      - slackAuth:
        - files:write:user
      summary: Slack Post Files Comments Delete
      x-api-evangelist-processing:
        GenerateOperationSummariesFromPath: true
        PascalCaseOperationSummaries: true
        CaselCaseOperationIds: true
        ChooseTags: true
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /files.delete:
    post:
      tags:
      - Deletes
      - Files
      - Post
      description: Deletes a file.
      externalDocs:
        description: API method documentation
        url: https://api.slack.com/methods/files.delete
      operationId: postFilesDelete
      parameters:
      - name: token
        in: header
        description: 'Authentication token. Requires scope: `files:write:user`'
        schema:
          type: string
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                file:
                  type: string
                  description: ID of file to delete.
          application/json:
            schema:
              type: object
              properties:
                file:
                  type: string
                  description: ID of file to delete.
      responses:
        '200':
          description: Typical success response
          content:
            application/json:
              schema:
                title: files.delete schema
                required:
                - ok
                type: object
                properties:
                  ok:
                    $ref: '#/components/schemas/defs_ok_true'
                additionalProperties: false
                description: Schema for successful response files.delete method
              example:
                ok: true
        default:
          description: Typical error response
          content:
            application/json:
              schema:
                title: files.delete error schema
                required:
                - error
                - ok
                type: object
                properties:
                  callstack:
                    type: string
                    description: 'Note: PHP callstack is only visible in dev/qa'
                  error:
                    type: string
                    enum:
                    - file_not_found
                    - file_deleted
                    - cant_delete_file
                    - 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:
                    $ref: '#/components/schemas/defs_ok_false'
                additionalProperties: false
                description: Schema for error response files.delete method
              example:
                error: invalid_auth
                ok: false
      security:
      - slackAuth:
        - files:write:user
      summary: Slack Post Files Delete
      x-api-evangelist-processing:
        GenerateOperationSummariesFromPath: true
        PascalCaseOperationSummaries: true
        CaselCaseOperationIds: true
        ChooseTags: true
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /files.info:
    get:
      tags:
      - Files
      - Get
      - Info
      description: Gets information about a file.
      externalDocs:
        description: API method documentation
        url: https://api.slack.com/methods/files.info
      operationId: getFilesInfo
      parameters:
      - name: token
        in: query
        description: 'Authentication token. Requires scope: `files:read`'
        schema:
          type: string
      - name: file
        in: query
        description: Specify a file by providing its ID.
        schema:
          type: string
      - name: count
        in: query
        schema:
          type: string
      - name: page
        in: query
        schema:
          type: string
      - name: limit
        in: query
        description: >-
          The maximum number of items to return. Fewer than the requested
          number of items may be returned, even if the end of the list hasn't
          been reached.
        schema:
          type: integer
      - name: cursor
        in: query
        description: >-
          Parameter for pagination. File comments are paginated for a single
          file. Set `cursor` equal to the `next_cursor` attribute returned by
          the previous request's `response_metadata`. This parameter is
          optional, but pagination is mandatory: the default value simply
          fetches the first "page" of the collection of comments. See
          [pagination](/docs/pagination) for more details.
        schema:
          type: string
      responses:
        '200':
          description: Typical success response
          content:
            application/json:
              schema:
                title: files.info schema
                required:
                - comments
                - file
                - ok
                type: object
                properties:
                  comments:
                    $ref: '#/components/schemas/objs_comments'
                  editor:
                    $ref: '#/components/schemas/defs_user_id'
                  file:
                    $ref: '#/components/schemas/objs_file'
                  ok:
                    $ref: '#/components/schemas/defs_ok_true'
                  paging:
                    $ref: '#/components/schemas/objs_paging'
                  response_metadata:
                    $ref: '#/components/schemas/objs_response_metadata'
                additionalProperties: false
                description: Schema for successful response from files.info method
              example:
                comments: []
                file:
                  channels:
                  - C0T8SE4AU
                  comments_count: 0
                  created: 1531763342
                  deanimate_gif: https://.../tedair_deanimate_gif.png
                  display_as_bot: false
                  editable: false
                  external_type: ''
                  filetype: gif
                  groups: []
                  has_rich_preview: false
                  id: F0S43PZDF
                  image_exif_rotation: 1
                  ims: []
                  is_external: false
                  is_public: true
                  is_starred: false
                  mimetype: image/gif
                  mode: hosted
                  name: tedair.gif
                  original_h: 226
                  original_w: 176
                  permalink: https://.../tedair.gif
                  permalink_public: https://.../...
                  pjpeg: https://.../tedair_pjpeg.jpg
                  pretty_type: GIF
                  public_url_shared: false
                  shares:
                    public:
                      C0T8SE4AU:
                      - channel_name: file-under
                        latest_reply: '1531763348.000001'
                        reply_count: 1
                        reply_users:
                        - U061F7AUR
                        reply_users_count: 1
                        team_id: T061EG9R6
                        thread_ts: '1531763273.000015'
                        ts: '1531763348.000001'
                  size: 137531
                  thumb_160: https://.../tedair_=_160.png
                  thumb_360: https://.../tedair_360.png
                  thumb_360_gif: https://.../tedair_360.gif
                  thumb_360_h: 226
                  thumb_360_w: 176
                  thumb_64: https://.../tedair_64.png
                  thumb_80: https://.../tedair_80.png
                  timestamp: 1531763342
                  title: tedair.gif
                  url_private: https://.../tedair.gif
                  url_private_download: https://.../tedair.gif
                  user: U061F7AUR
                  username: ''
                ok: true
                response_metadata:
                  next_cursor: dGVhbTpDMUg5UkVTR0w=
        default:
          description: Typical error response
          content:
            application/json:
              schema:
                title: files.info error schema
                required:
                - error
                - ok
                type: object
                properties:
                  callstack:
                    type: string
                    description: 'Note: PHP callstack is only visible in dev/qa'
                  error:
                    type: string
                    enum:
                    - file_not_found
                    - file_deleted
                    - timezone_count_failed
                    - 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:
                    $ref: '#/components/schemas/defs_ok_false'
                additionalProperties: false
                description: Schema for error response from files.info method
              example:
                error: invalid_auth
                ok: false
      security:
      - slackAuth:
        - files:read
      summary: Slack Get Files Info
      x-api-evangelist-processing:
        GenerateOperationSummariesFromPath: true
        PascalCaseOperationSummaries: true
        CaselCaseOperationIds: true
        ChooseTags: true
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /files.list:
    get:
      tags:
      - Files
      - Get
      - Lists
      description: List for a team, in a channel, or from a user with applied filters.
      externalDocs:
        description: API method documentation
        url: https://api.slack.com/methods/files.list
      operationId: getFilesList
      parameters:
      - name: token
        in: query
        description: 'Authentication token. Requires scope: `files:read`'
        schema:
          type: string
      - name: user
        in: query
        description: Filter files created by a single user.
        schema:
          type: string
      - name: channel
        in: query
        description: Filter files appearing in a specific channel, indicated by its ID.
        schema:
          type: string
      - name: ts_from
        in: query
        description: Filter files created after this timestamp (inclusive).
        schema:
          type: number
      - name: ts_to
        in: query
        description: Filter files created before this timestamp (inclusive).
        schema:
          type: number
      - name: types
        in: query
        description: >-
          Filter files by type ([see below](#file_types)). You can pass
          multiple values in the types argument, like
          `types=spaces,snippets`.The default value is `all`, which does not
          filter the list.
        schema:
          type: string
      - name: count
        in: query
        schema:
          type: string
      - name: page
        in: query
        schema:
          type: string
      - name: show_files_hidden_by_limit
        in: query
        description: >-
          Show truncated file info for files hidden due to being too old, and
          the team who owns the file being over the file limit.
        schema:
          type: boolean
      responses:
        '200':
          description: Typical success response
          content:
            application/json:
              schema:
                title: files.list schema
                required:
                - files
                - ok
                - paging
                type: object
                properties:
                  files:
                    minItems: 0
                    uniqueItems: true
                    type: array
                    items:
                      $ref: '#/components/schemas/objs_file'
                  ok:
                    $ref: '#/components/schemas/defs_ok_true'
                  paging:
                    $ref: '#/components/schemas/objs_paging'
                additionalProperties: false
                description: Schema for successful response from files.list method
              example:
                files:
                - channels:
                  - C0T8SE4AU
                  comments_count: 0
                  created: 1531763254
                  deanimate_gif: https://.../billair_deanimate_gif.png
                  display_as_bot: false
                  editable: false
                  external_type: ''
                  filetype: gif
                  groups: []
                  id: F0S43P1CZ
                  image_exif_rotation: 1
                  ims: []
                  is_external: false
                  is_public: true
                  mimetype: image/gif
                  mode: hosted
                  name: billair.gif
                  original_h: 226
                  original_w: 176
                  permalink: https://.../billair.gif
                  permalink_public: https://.../...
                  pjpeg: https://.../billair_pjpeg.jpg
                  pretty_type: GIF
                  public_url_shared: false
                  size: 144538
                  thumb_160: https://.../billair_=_160.png
                  thumb_360: https://.../billair_360.png
                  thumb_360_gif: https://.../billair_360.gif
                  thumb_360_h: 226
                  thumb_360_w: 176
                  thumb_64: https://.../billair_64.png
                  thumb_80: https://.../billair_80.png
                  timestamp: 1531763254
                  title: billair.gif
                  url_private: https://.../billair.gif
                  url_private_download: https://.../billair.gif
                  user: U061F7AUR
                  username: ''
                - channels:
                  - C0T8SE4AU
                  comments_count: 0
                  created: 1531763342
                  deanimate_gif: https://.../tedair_deanimate_gif.png
                  display_as_bot: false
                  editable: false
                  external_type: ''
                  filetype: gif
                  groups: []
                  id: F0S43PZDF
                  image_exif_rotation: 1
                  ims: []
                  is_external: false
                  is_public: true
                  mimetype: image/gif
                  mode: hosted
                  name: tedair.gif
                  original_h: 226
                  original_w: 176
                  permalink: https://.../tedair.gif
                  permalink_public: https://.../...
                  pjpeg: https://.../tedair_pjpeg.jpg
                  pretty_type: GIF
                  public_url_shared: false
                  size: 137531
                  thumb_160: https://.../tedair_=_160.png
                  thumb_360: https://.../tedair_360.png
                  thumb_360_gif: https://.../tedair_360.gif
                  thumb_360_h: 226
                  thumb_360_w: 176
                  thumb_64: https://.../tedair_64.png
                  thumb_80: https://.../tedair_80.png
                  timestamp: 1531763342
                  title: tedair.gif
                  url_private: https://.../tedair.gif
                  url_private_download: https://.../tedair.gif
                  user: U061F7AUR
                  username: ''
                ok: true
                paging:
                  count: 100
                  page: 1
                  pages: 1
                  total: 2
        default:
          description: Typical error response
          content:
            application/json:
              schema:
                title: files.list error schema
                required:
                - error
                - ok
                type: object
                properties:
                  callstack:
                    type: string
                    description: 'Note: PHP callstack is only visible in dev/qa'
                  error:
                    type: string
                    enum:
                    - user_not_found
                    - unknown_type
                    - not_authed
                    - invalid_auth
                    - account_inactive
                    - no_permission
                    - user_is_bot
                    - 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:
                    $ref: '#/components/schemas/defs_ok_false'
                additionalProperties: false
                description: Schema for error response from files.list method
              example:
                error: invalid_auth
                ok: false
      security:
      - slackAuth:
        - files:read
      summary: Slack Get Files List
      x-api-evangelist-processing:
        GenerateOperationSummariesFromPath: true
        PascalCaseOperationSummaries: true
        CaselCaseOperationIds: true
        ChooseTags: true
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /files.remote.add:
    post:
      tags:
      - Add
      - Files
      - Post
      - Remote
      description: Adds a file from a remote service
      externalDocs:
        description: API method documentation
        url: https://api.slack.com/methods/files.remote.add
      operationId: postFilesRemoteAdd
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                token:
                  type: string
                  description: 'Authentication token. Requires scope: `remote_files:write`'
                external_id:
                  type: string
                  description: Creator defined GUID for the file.
                title:
                  type: string
                  description: Title of the file being shared.
                filetype:
                  type: string
                  description: type of file
                external_url:
                  type: string
                  description: URL of the remote file.
                preview_image:
                  type: string
                  description: Preview of the document via `multipart/form-data`.
                indexable_file_contents:
                  type: string
                  description: >-
                    A text file (txt, pdf, doc, etc.) containing textual search
                    terms that are used to improve discovery of the remote file.
      responses:
        '200':
          description: Typical success response
          content:
            application/json:
              schema:
                title: Default success template
                required:
                - ok
                type: object
                properties:
                  ok:
                    $ref: '#/components/schemas/defs_ok_true'
                additionalProperties: true
                description: >-
                  This method either only returns a brief _OK_ response or a
                  verbose schema is not available for this method.
              example:
                ok: true
        default:
          description: Typical error response
          content:
            application/json:
              schema:
                title: Default error template
                required:
                - ok
                type: object
                properties:
                  ok:
                    $ref: '#/components/schemas/defs_ok_false'
                additionalProperties: true
                description: >-
                  This method either only returns a brief _not OK_ response or a
                  verbose schema is not available for this method.
              example:
                error: invalid_auth
                ok: false
      security:
      - slackAuth:
        - remote_files:write
      summary: Slack Post Files Remote Add
      x-api-evangelist-processing:
        GenerateOperationSummariesFromPath: true
        PascalCaseOperationSummaries: true
        CaselCaseOperationIds: true
        ChooseTags: true
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /files.remote.info:
    get:
      tags:
      - Files
      - Get
      - Info
      - Remote
      description: Retrieve information about a remote file added to Slack
      externalDocs:
        description: API method documentation
        url: https://api.slack.com/methods/files.remote.info
      operationId: getFilesRemoteInfo
      parameters:
      - name: token
        in: query
        description: 'Authentication token. Requires scope: `remote_files:read`'
        schema:
          type: string
      - name: file
        in: query
        description: Specify a file by providing its ID.
        schema:
          type: string
      - name: external_id
        in: query
        description: Creator defined GUID for the file.
        schema:
          type: string
      responses:
        '200':
          description: Typical success response
          content:
            application/json:
              schema:
                title: Default success template
                required:
                - ok
                type: object
                properties:
                  ok:
                    $ref: '#/components/schemas/defs_ok_true'
                additionalProperties: true
                description: >-
                  This method either only returns a brief _OK_ response or a
                  verbose schema is not available for this method.
              example:
                ok: true
        default:
          description: Typical error response
          content:
            application/json:
              schema:
                title: Default error template
                required:
                - ok
                type: object
                properties:
                  ok:
                    $ref: '#/components/schemas/defs_ok_false'
                additionalProperties: true
                description: >-
                  This method either only returns a brief _not OK_ response or a
                  verbose schema is not available for this method.
              example:
                error: invalid_auth
                ok: false
      security:
      - slackAuth:
        - remote_files:read
      summary: Slack Get Files Remote Info
      x-api-evangelist-processing:
        GenerateOperationSummariesFromPath: true
        PascalCaseOperationSummaries: true
        CaselCaseOperationIds: true
        ChooseTags: true
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /files.remote.list:
    get:
      tags:
      - Files
      - Get
      - Lists
      - Remote
      description: Retrieve information about a remote file added to Slack
      externalDocs:
        description: API method documentation
        url: https://api.slack.com/methods/files.remote.list
      operationId: getFilesRemoteList
      parameters:
      - name: token
        in: query
        description: 'Authentication token. Requires scope: `remote_files:read`'
        schema:
          type: string
      - name: channel
        in: query
        description: Filter files appearing in a specific channel, indicated by its ID.
        schema:
          type: string
      - name: ts_from
        in: query
        description: Filter files created after this timestamp (inclusive).
        schema:
          type: number
      - name: ts_to
        in: query
        description: Filter files created before this timestamp (inclusive).
        schema:
          type: number
      - name: limit
        in: query
        description: The maximum number of items to return.
        schema:
          type: integer
      - name: cursor
        in: query
        description: >-
          Paginate through collections of data by setting the `cursor`
          parameter to a `next_cursor` attribute returned by a previous
          request's `response_metadata`. Default value fetches the first
          "page" of the collection. See [pagination](/docs/pagination) for
          more detail.
        schema:
          type: string
      responses:
        '200':
          description: Typical success response
          content:
            application/json:
              schema:
                title: Default success template
                required:
                - ok
                type: object
                properties:
                  ok:
                    $ref: '#/components/schemas/defs_ok_true'
                additionalProperties: true
                description: >-
                  This method either only returns a brief _OK_ response or a
                  verbose schema is not available for this method.
              example:
                ok: true
        default:
          description: Typical error response
          content:
            application/json:
              schema:
                title: Default error template
                required:
                - ok
                type: object
                properties:
                  ok:
                    $ref: '#/components/schemas/defs_ok_false'
                additionalProperties: true
                description: >-
                  This method either only returns a brief _not OK_ response or a
                  verbose schema is not available for this method.
              example:
                error: invalid_auth
                ok: false
      security:
      - slackAuth:
        - remote_files:read
      summary: Slack Get Files Remote List
      x-api-evangelist-processing:
        GenerateOperationSummariesFromPath: true
        PascalCaseOperationSummaries: true
        CaselCaseOperationIds: true
        ChooseTags: true
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /files.remote.remove:
    post:
      tags:
      - Files
      - Post
      - Remote
      - Remove
      description: Remove a remote file.
      externalDocs:
        description: API method documentation
        url: https://api.slack.com/methods/files.remote.remove
      operationId: postFilesRemoteRemove
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                token:
                  type: string
                  description: 'Authentication token. Requires scope: `remote_files:write`'
                file:
                  type: string
                  description: Specify a file by providing its ID.
                external_id:
                  type: string
                  description: Creator defined GUID for the file.
      responses:
        '200':
          description: Typical success response
          content:
            application/json:
              schema:
                title: Default success template
                required:
                - ok
                type: object
                properties:
                  ok:
                    $ref: '#/components/schemas/defs_ok_true'
    

# --- truncated at 32 KB (53 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/slack/refs/heads/main/openapi/slack-files-openapi.yml