Slack History API

The History API from Slack — 1 operation(s) for history.

Documentation

Specifications

Schemas & Data

Other Resources

OpenAPI Specification

slack-history-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  version: '1.0'
  title: Slack Admin Access History API
  description: "The Slack Admin API is a set of privileged endpoints\x14primarily under admin.* with related SCIM and Audit Logs APIs\x14that lets Enterprise Grid owners and admins automate organization\x11 wide management and governance. It covers user lifecycle (provision, suspend, assign roles), workspace and channel administration across workspaces (create, move, archive channels; manage membership and settings), app governance (approve/deny or allowlist/ban apps and install them to workspaces), invite request handling, and security/compliance controls such as information barriers, session and authentication policies, and org\x11level analytics exports. These APIs require elevated admin scopes and are commonly used to power automated onboarding/offboarding, centralized channel and app controls, and integrations with identity, ITSM, and compliance systems."
tags:
- name: History
paths:
  /conversations.history:
    get:
      tags:
      - History
      description: Fetches a conversation's history of messages and events.
      externalDocs:
        description: API method documentation
        url: https://api.slack.com/methods/conversations.history
      operationId: getConversationsHistory
      parameters:
      - name: token
        in: query
        description: 'Authentication token. Requires scope: `conversations:history`'
        schema:
          type: string
      - name: channel
        in: query
        description: Conversation ID to fetch history for.
        schema:
          type: string
      - name: latest
        in: query
        description: End of time range of messages to include in results.
        schema:
          type: number
      - name: oldest
        in: query
        description: Start of time range of messages to include in results.
        schema:
          type: number
      - name: inclusive
        in: query
        description: Include messages with latest or oldest timestamp in results only when either timestamp is specified.
        schema:
          type: boolean
      - 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 users list hasn't been reached.
        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 containing a channel's messages
          content:
            application/json:
              schema:
                title: conversations.history success schema
                required:
                - channel_actions_count
                - channel_actions_ts
                - has_more
                - messages
                - ok
                - pin_count
                type: object
                properties:
                  channel_actions_count:
                    type: integer
                  channel_actions_ts:
                    type: object
                  has_more:
                    type: boolean
                  messages:
                    minItems: 1
                    uniqueItems: true
                    type: array
                    items:
                      $ref: '#/components/schemas/objs_message'
                  ok:
                    $ref: '#/components/schemas/defs_ok_true'
                  pin_count:
                    type: integer
                additionalProperties: false
                description: Schema for successful response from conversations.history method
              example:
                has_more: true
                messages:
                - text: I find you punny and would like to smell your nose letter
                  ts: '1512085950.000216'
                  type: message
                  user: U012AB3CDE
                - text: What, you want to smell my shoes better?
                  ts: '1512104434.000490'
                  type: message
                  user: U061F7AUR
                ok: true
                pin_count: 0
                response_metadata:
                  next_cursor: bmV4dF90czoxNTEyMDg1ODYxMDAwNTQz
        default:
          description: Typical error response
          content:
            application/json:
              schema:
                title: conversations.history 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:
                    - missing_scope
                    - channel_not_found
                    - invalid_ts_latest
                    - invalid_ts_oldest
                    - not_authed
                    - invalid_auth
                    - account_inactive
                    - 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
                  needed:
                    type: string
                  ok:
                    $ref: '#/components/schemas/defs_ok_false'
                  provided:
                    type: string
                additionalProperties: false
                description: Schema for error response from conversations.history method
              example:
                error: channel_not_found
                ok: false
      security:
      - slackAuth:
        - channels:history
        - groups:history
        - im:history
        - mpim:history
      summary: Slack Get Conversations History
      x-api-evangelist-processing:
        GenerateOperationSummariesFromPath: true
        PascalCaseOperationSummaries: true
        CaselCaseOperationIds: true
        ChooseTags: true
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK