Slack Chat API

The Slack Chat API is the set of chat.* methods in the Slack Web API that lets apps and bots create and manage messages in Slack workspaces. It enables posting messages to channels and DMs with Block Kit formatting, sending ephemeral messages visible only to a specific user, replying in threads, scheduling messages for later delivery, updating or deleting existing messages, retrieving permalinks, and providing custom link unfurls.

OpenAPI Specification

slack-chat-openapi.yml Raw ↑
openapi: 3.1.0
info:
  version: "1.0"
  title: Slack Chat API
  description: >-
    The Slack Chat API is the set of chat.* methods in the Slack Web API that
    lets apps and bots create and manage messages in Slack workspaces. It
    enables posting messages to channels and DMs with Block Kit formatting,
    sending ephemeral messages visible only to a specific user, replying in
    threads, scheduling messages for later delivery, updating or deleting
    existing messages, retrieving permalinks, and providing custom link unfurls.
    These methods work over HTTP with JSON payloads, use bot/user tokens with
    scopes like chat:write and chat:write.public, and return metadata such as
    channel, ts, and thread_ts. Teams use the Chat API to automate
    notifications, power interactive workflows, and deliver rich conversational
    experiences inside Slack.
paths:
  /chat.delete:
    post:
      tags:
      - Chat
      - Deletes
      - Post
      description: Deletes a message.
      externalDocs:
        description: API method documentation
        url: https://api.slack.com/methods/chat.delete
      operationId: postChatDelete
      parameters:
      - name: token
        in: header
        description: 'Authentication token. Requires scope: `chat:write`'
        schema:
          type: string
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                ts:
                  type: number
                  description: Timestamp of the message to be deleted.
                channel:
                  type: string
                  description: Channel containing the message to be deleted.
                as_user:
                  type: boolean
                  description: >-
                    Pass true to delete the message as the authed user with
                    `chat:write:user` scope. [Bot users](/bot-users) in this
                    context are considered authed users. If unused or false, the
                    message will be deleted with `chat:write:bot` scope.
          application/json:
            schema:
              type: object
              properties:
                ts:
                  type: number
                  description: Timestamp of the message to be deleted.
                channel:
                  type: string
                  description: Channel containing the message to be deleted.
                as_user:
                  type: boolean
                  description: >-
                    Pass true to delete the message as the authed user with
                    `chat:write:user` scope. [Bot users](/bot-users) in this
                    context are considered authed users. If unused or false, the
                    message will be deleted with `chat:write:bot` scope.
      responses:
        '200':
          description: Typical success response
          content:
            application/json:
              schema:
                title: chat.delete success schema
                required:
                - channel
                - ok
                - ts
                type: object
                properties:
                  channel:
                    $ref: '#/components/schemas/defs_channel'
                  ok:
                    $ref: '#/components/schemas/defs_ok_true'
                  ts:
                    $ref: '#/components/schemas/defs_ts'
                additionalProperties: false
                description: Schema for successful response of chat.delete method
              example:
                channel: C024BE91L
                ok: true
                ts: '1401383885.000061'
        default:
          description: Typical error response
          content:
            application/json:
              schema:
                title: chat.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:
                    - message_not_found
                    - channel_not_found
                    - cant_delete_message
                    - compliance_exports_prevent_deletion
                    - not_authed
                    - invalid_auth
                    - account_inactive
                    - token_revoked
                    - 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
                    - fatal_error
                  ok:
                    $ref: '#/components/schemas/defs_ok_false'
                additionalProperties: false
                description: Schema for error response from chat.delete method
              example:
                error: message_not_found
                ok: false
      security:
      - slackAuth:
        - chat:write:user
        - chat:write:bot
      summary: Slack Post Chat Delete
      x-api-evangelist-processing:
        GenerateOperationSummariesFromPath: true
        PascalCaseOperationSummaries: true
        CaselCaseOperationIds: true
        ChooseTags: true
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /chat.deleteScheduledMessage:
    post:
      tags:
      - Chat
      - Post
      description: Deletes a pending scheduled message from the queue.
      externalDocs:
        description: API method documentation
        url: https://api.slack.com/methods/chat.deleteScheduledMessage
      operationId: postChatDeletescheduledmessage
      parameters:
      - name: token
        in: header
        description: 'Authentication token. Requires scope: `chat:write`'
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              required:
              - channel
              - scheduled_message_id
              type: object
              properties:
                as_user:
                  type: boolean
                  description: >-
                    Pass true to delete the message as the authed user with
                    `chat:write:user` scope. [Bot users](/bot-users) in this
                    context are considered authed users. If unused or false, the
                    message will be deleted with `chat:write:bot` scope.
                channel:
                  type: string
                  description: The channel the scheduled_message is posting to
                scheduled_message_id:
                  type: string
                  description: >-
                    `scheduled_message_id` returned from call to
                    chat.scheduleMessage
          application/json:
            schema:
              required:
              - channel
              - scheduled_message_id
              type: object
              properties:
                as_user:
                  type: boolean
                  description: >-
                    Pass true to delete the message as the authed user with
                    `chat:write:user` scope. [Bot users](/bot-users) in this
                    context are considered authed users. If unused or false, the
                    message will be deleted with `chat:write:bot` scope.
                channel:
                  type: string
                  description: The channel the scheduled_message is posting to
                scheduled_message_id:
                  type: string
                  description: >-
                    `scheduled_message_id` returned from call to
                    chat.scheduleMessage
        required: true
      responses:
        '200':
          description: Typical success response
          content:
            application/json:
              schema:
                title: chat.deleteScheduledMessage schema
                required:
                - ok
                type: object
                properties:
                  ok:
                    $ref: '#/components/schemas/defs_ok_true'
                additionalProperties: false
                description: >-
                  Schema for successful response from
                  chat.deleteScheduledMessage method
              example:
                ok: true
        default:
          description: Typical error response if no message is found
          content:
            application/json:
              schema:
                title: chat.deleteScheduledMessage 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:
                    - invalid_scheduled_message_id
                    - channel_not_found
                    - bad_token
                    - not_authed
                    - invalid_auth
                    - account_inactive
                    - token_revoked
                    - no_permission
                    - org_login_required
                    - ekm_access_denied
                    - missing_scope
                    - invalid_arguments
                    - invalid_arg_name
                    - invalid_charset
                    - invalid_form_data
                    - invalid_post_type
                    - missing_post_type
                    - team_added_to_org
                    - invalid_json
                    - json_not_object
                    - request_timeout
                    - upgrade_required
                    - fatal_error
                  ok:
                    $ref: '#/components/schemas/defs_ok_false'
                additionalProperties: false
                description: >-
                  Schema for error response from chat.deleteScheduledMessage
                  method
              example:
                error: invalid_scheduled_message_id
                ok: false
      security:
      - slackAuth:
        - chat:write:user
        - chat:write:bot
      summary: Slack Post Chat Deletescheduledmessage
      x-api-evangelist-processing:
        GenerateOperationSummariesFromPath: true
        PascalCaseOperationSummaries: true
        CaselCaseOperationIds: true
        ChooseTags: true
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /chat.getPermalink:
    get:
      tags:
      - Chat
      - Get
      description: Retrieve a permalink URL for a specific extant message
      externalDocs:
        description: API method documentation
        url: https://api.slack.com/methods/chat.getPermalink
      operationId: getChatGetpermalink
      parameters:
      - name: token
        in: query
        description: 'Authentication token. Requires scope: `none`'
        required: true
        schema:
          type: string
      - name: channel
        in: query
        description: The ID of the conversation or channel containing the message
        required: true
        schema:
          type: string
      - name: message_ts
        in: query
        description: A message's `ts` value, uniquely identifying it within a channel
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Standard success response
          content:
            application/json:
              schema:
                title: chat.getPermalink success schema
                required:
                - channel
                - ok
                - permalink
                type: object
                properties:
                  channel:
                    $ref: '#/components/schemas/defs_channel'
                  ok:
                    $ref: '#/components/schemas/defs_ok_true'
                  permalink:
                    type: string
                    format: uri
                additionalProperties: false
                description: Schema for successful response chat.getPermalink
              example:
                channel: C1H9RESGA
                ok: true
                permalink: >-
                  https://ghostbusters.slack.com/archives/C1H9RESGA/p135854651500008
        default:
          description: Error response when channel cannot be found
          content:
            application/json:
              schema:
                title: chat.getPermalink 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:
                    - channel_not_found
                    - message_not_found
                    - not_authed
                    - invalid_auth
                    - account_inactive
                    - token_revoked
                    - no_permission
                    - org_login_required
                    - 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
                    - fatal_error
                  ok:
                    $ref: '#/components/schemas/defs_ok_false'
                additionalProperties: false
                description: Schema for error response from chat.getPermalink method
              example:
                error: channel_not_found
                ok: false
      security:
      - slackAuth:
        - none
      summary: Slack Get Chat Getpermalink
      x-api-evangelist-processing:
        GenerateOperationSummariesFromPath: true
        PascalCaseOperationSummaries: true
        CaselCaseOperationIds: true
        ChooseTags: true
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /chat.meMessage:
    post:
      tags:
      - Chat
      - Post
      description: Share a me message into a channel.
      externalDocs:
        description: API method documentation
        url: https://api.slack.com/methods/chat.meMessage
      operationId: postChatMemessage
      parameters:
      - name: token
        in: header
        description: 'Authentication token. Requires scope: `chat:write`'
        schema:
          type: string
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                channel:
                  type: string
                  description: >-
                    Channel to send message to. Can be a public channel, private
                    group or IM channel. Can be an encoded ID, or a name.
                text:
                  type: string
                  description: Text of the message to send.
          application/json:
            schema:
              type: object
              properties:
                channel:
                  type: string
                  description: >-
                    Channel to send message to. Can be a public channel, private
                    group or IM channel. Can be an encoded ID, or a name.
                text:
                  type: string
                  description: Text of the message to send.
      responses:
        '200':
          description: Typical success response
          content:
            application/json:
              schema:
                title: chat.meMessage schema
                required:
                - ok
                type: object
                properties:
                  channel:
                    $ref: '#/components/schemas/defs_channel'
                  ok:
                    $ref: '#/components/schemas/defs_ok_true'
                  ts:
                    $ref: '#/components/schemas/defs_ts'
                additionalProperties: false
                description: Schema for successful response from chat.meMessage method
              example:
                channel: C024BE7LR
                ok: true
                ts: '1417671948.000006'
        default:
          description: Typical error response
          content:
            application/json:
              schema:
                title: chat.meMessage 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:
                    - channel_not_found
                    - not_in_channel
                    - is_archived
                    - msg_too_long
                    - no_text
                    - rate_limited
                    - not_authed
                    - invalid_auth
                    - account_inactive
                    - token_revoked
                    - no_permission
                    - org_login_required
                    - 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
                    - fatal_error
                  ok:
                    $ref: '#/components/schemas/defs_ok_false'
                additionalProperties: false
                description: Schema for error response from chat.meMessage method
              example:
                error: invalid_auth
                ok: false
      security:
      - slackAuth:
        - chat:write:user
        - chat:write:bot
      summary: Slack Post Chat Memessage
      x-api-evangelist-processing:
        GenerateOperationSummariesFromPath: true
        PascalCaseOperationSummaries: true
        CaselCaseOperationIds: true
        ChooseTags: true
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /chat.postEphemeral:
    post:
      tags:
      - Chat
      - Post
      description: Sends an ephemeral message to a user in a channel.
      externalDocs:
        description: API method documentation
        url: https://api.slack.com/methods/chat.postEphemeral
      operationId: postChatPostephemeral
      parameters:
      - name: token
        in: header
        description: 'Authentication token. Requires scope: `chat:write`'
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              required:
              - channel
              - user
              type: object
              properties:
                as_user:
                  type: boolean
                  description: >-
                    Pass true to post the message as the authed user. Defaults
                    to true if the chat:write:bot scope is not included.
                    Otherwise, defaults to false.
                attachments:
                  type: string
                  description: >-
                    A JSON-based array of structured attachments, presented as a
                    URL-encoded string.
                blocks:
                  type: string
                  description: >-
                    A JSON-based array of structured blocks, presented as a
                    URL-encoded string.
                channel:
                  type: string
                  description: >-
                    Channel, private group, or IM channel to send message to.
                    Can be an encoded ID, or a name.
                icon_emoji:
                  type: string
                  description: >-
                    Emoji to use as the icon for this message. Overrides
                    `icon_url`. Must be used in conjunction with `as_user` set
                    to `false`, otherwise ignored. See [authorship](#authorship)
                    below.
                icon_url:
                  type: string
                  description: >-
                    URL to an image to use as the icon for this message. Must be
                    used in conjunction with `as_user` set to false, otherwise
                    ignored. See [authorship](#authorship) below.
                link_names:
                  type: boolean
                  description: Find and link channel names and usernames.
                parse:
                  type: string
                  description: >-
                    Change how messages are treated. Defaults to `none`. See
                    [below](#formatting).
                text:
                  type: string
                  description: >-
                    How this field works and whether it is required depends on
                    other fields you use in your API call. [See
                    below](#text_usage) for more detail.
                thread_ts:
                  type: string
                  description: >-
                    Provide another message's `ts` value to post this message in
                    a thread. Avoid using a reply's `ts` value; use its parent's
                    value instead. Ephemeral messages in threads are only shown
                    if there is already an active thread.
                user:
                  type: string
                  description: >-
                    `id` of the user who will receive the ephemeral message. The
                    user should be in the channel specified by the `channel`
                    argument.
                username:
                  type: string
                  description: >-
                    Set your bot's user name. Must be used in conjunction with
                    `as_user` set to false, otherwise ignored. See
                    [authorship](#authorship) below.
          application/json:
            schema:
              required:
              - channel
              - user
              type: object
              properties:
                as_user:
                  type: boolean
                  description: >-
                    Pass true to post the message as the authed user. Defaults
                    to true if the chat:write:bot scope is not included.
                    Otherwise, defaults to false.
                attachments:
                  type: string
                  description: >-
                    A JSON-based array of structured attachments, presented as a
                    URL-encoded string.
                blocks:
                  type: string
                  description: >-
                    A JSON-based array of structured blocks, presented as a
                    URL-encoded string.
                channel:
                  type: string
                  description: >-
                    Channel, private group, or IM channel to send message to.
                    Can be an encoded ID, or a name.
                icon_emoji:
                  type: string
                  description: >-
                    Emoji to use as the icon for this message. Overrides
                    `icon_url`. Must be used in conjunction with `as_user` set
                    to `false`, otherwise ignored. See [authorship](#authorship)
                    below.
                icon_url:
                  type: string
                  description: >-
                    URL to an image to use as the icon for this message. Must be
                    used in conjunction with `as_user` set to false, otherwise
                    ignored. See [authorship](#authorship) below.
                link_names:
                  type: boolean
                  description: Find and link channel names and usernames.
                parse:
                  type: string
                  description: >-
                    Change how messages are treated. Defaults to `none`. See
                    [below](#formatting).
                text:
                  type: string
                  description: >-
                    How this field works and whether it is required depends on
                    other fields you use in your API call. [See
                    below](#text_usage) for more detail.
                thread_ts:
                  type: string
                  description: >-
                    Provide another message's `ts` value to post this message in
                    a thread. Avoid using a reply's `ts` value; use its parent's
                    value instead. Ephemeral messages in threads are only shown
                    if there is already an active thread.
                user:
                  type: string
                  description: >-
                    `id` of the user who will receive the ephemeral message. The
                    user should be in the channel specified by the `channel`
                    argument.
                username:
                  type: string
                  description: >-
                    Set your bot's user name. Must be used in conjunction with
                    `as_user` set to false, otherwise ignored. See
                    [authorship](#authorship) below.
        required: true
      responses:
        '200':
          description: Typical success response
          content:
            application/json:
              schema:
                title: chat.postEphemeral success schema
                required:
                - message_ts
                - ok
                type: object
                properties:
                  message_ts:
                    $ref: '#/components/schemas/defs_ts'
                  ok:
                    $ref: '#/components/schemas/defs_ok_true'
                additionalProperties: false
                description: Schema for successful response from chat.postEphemeral method
              example:
                message_ts: '1502210682.580145'
                ok: true
        default:
          description: Typical error response
          content:
            application/json:
              schema:
                title: chat.postEphemeral 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:
                    - channel_not_found
                    - is_archived
                    - msg_too_long
                    - no_text
                    - restricted_action
                    - too_many_attachments
                    - user_not_in_channel
                    - not_authed
                    - invalid_auth
                    - account_inactive
                    - token_revoked
                    - no_permission
                    - org_login_required
                    - 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
                    - fatal_error
                  ok:
                    $ref: '#/components/schemas/defs_ok_false'
                additionalProperties: false
                description: Schema for error response from chat.postEphemeral method
              example:
                error: user_not_in_channel
                ok: false
      security:
      - slackAuth:
        - chat:write:user
        - chat:write:bot
      summary: Slack Post Chat Postephemeral
      x-api-evangelist-processing:
        GenerateOperationSummariesFromPath: true
        PascalCaseOperationSummaries: true
        CaselCaseOperationIds: true
        ChooseTags: true
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /chat.postMessage:
    post:
      tags:
      - Chat
      - Post
      description: Sends a message to a channel.
      externalDocs:
        description: API method documentation
        url: https://api.slack.com/methods/chat.postMessage
      operationId: postChatPostmessage
      parameters:
      - name: token
        in: header
        description: 'Authentication token. Requires scope: `chat:write`'
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              required:
              - channel
              type: object
              properties:
                as_user:
                  type: string
                  description: >-
                    Pass true to post the message as the authed user, instead of
                    as a bot. Defaults to false. See [authorship](#authorship)
                    below.
                attachments:
                  type: string
                  description: >-
                    A JSON-based array of structured attachments, presented as a
                    URL-encoded string.
                blocks:
                  type: string
                  description: >-
                    A JSON-based array of structured blocks, presented as a
                    URL-encoded string.
                channel:
                  type: string
                  description: >-
                    Channel, private group, or IM channel to send message to.
                    Can be an encoded ID, or a name. See [below](#channels) for
                    more details.
                icon_emoji:
                  type: string
                  description: >-
                    Emoji to use as the icon for this message. Overrides
                    `icon_url`. Must be used in conjunction with `as_user` set
                    to `false`, otherwise ignored. See [authorship](#authorship)
                    below.
                icon_url:
                  type: string
                  description: >-
                    URL to an image to use as the icon for this message. Must be
                    used in conjunction with `as_user` set to false, otherwise
                    ignored. See [authorship](#authorship) below.
                link_names:
                  type: boolean
                  description: Find and link channel names and usernames.
                mrkdwn:
                  type: boolean
                  description: >-
                    Disable Slack markup parsing by setting to `false`. Enabled
                    by default.
                parse:
                  type: string
                  description: >-
                    Change how messages are treated. Defaults to `none`. See
                    [below](#formatting).
                reply_broadcast:
                  type: boolean
                  description: >-
                    Used in conjunction with `thread_ts` and indicates whether
                    reply should be made visible to everyone in the channel or
                    conversation. Defaults to `false`.
                text:
                  type: string
                  description: >-
                    How this

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