You must enable javascript in order to use the Slack API Documentation. You can do this in your browser settings.
Go to Slack

Attaching content and links to messages

Your messages are vehicles for all kinds of content and experiences. Build distinctive messages referencing images, external websites, and highlight relevant pieces of data. Then simplify workflows by attaching interactive buttons.

A gorgeous message

Attachments let you add more context to a message, making them more useful and effective.

How message formatting appears

Before you get started with attachments

We recommend starting with our primer on messages. You should also be familiar with the complexities of sometimes not-so-simple message formatting.

Use attachments with intent and purpose. Use our message guidelines to help craft your messages, attachments, and interactive experiences.

When to use attachments

Attachments can be added to messages in different ways:

  • For Incoming Webhooks, send a regular payload, but include an attachments array, where each element is a hash containing an attachment.
  • For the Web API, include an attachments URL parameter, or send your message as application/json just as you would with an incoming webhook.

Attachment limits

Please limit your messages to contain no more than 20 attachments to provide the best user experience. Whenever possible, we'll throw a too_many_attachments error when attempting to include more than 100 attachments. When using incoming webhooks, you'll receive that error as a HTTP 400.

Unfortunately, we are unable to serve you an error when sending messages as part of a slash command or message buttons invocation response.

Use the Message Builder to preview your message formatting and attachments in real time!

Attachment structure

Messages can have zero or more attachments, defined as an array. Each hash in that array will contain multiple properties:

    "attachments": [
            "fallback": "Required plain-text summary of the attachment.",
            "color": "#36a64f",
            "pretext": "Optional text that appears above the attachment block",
            "author_name": "Bobby Tables",
            "author_link": "",
            "author_icon": "",
            "title": "Slack API Documentation",
            "title_link": "",
            "text": "Optional text that appears within the attachment",
            "fields": [
                    "title": "Priority",
                    "value": "High",
                    "short": false
            "image_url": "",
            "thumb_url": "",
            "footer": "Slack API",
            "footer_icon": "",
            "ts": 123456789

Try it!

Attachment parameters

Use these parameters to customize the appearance of a message attachment:


A plain-text summary of the attachment. This text will be used in clients that don't show formatted text (eg. IRC, mobile notifications) and should not contain any markup.


Like traffic signals, color-coding messages can quickly communicate intent and help separate them from the flow of other messages in the timeline.

An optional value that can either be one of good, warning, danger, or any hex color code (eg. #439FE0). This value is used to color the border along the left side of the message attachment.

Screenshot of attachments with colors


This is optional text that appears above the message attachment block.

Screenshot of an attachment with pretext

author parameters

The author parameters will display a small section at the top of a message attachment that can contain the following fields:

  • author_name

    Small text used to display the author's name.

  • author_link

    A valid URL that will hyperlink the author_name text mentioned above. Will only work if author_name is present.

  • author_icon

    A valid URL that displays a small 16x16px image to the left of the author_name text. Will only work if author_name is present.

Screenshot of an attachment with an author image and name

title and title_link

The title is displayed as larger, bold text near the top of a message attachment. By passing a valid URL in the title_link parameter (optional), the title text will be hyperlinked.

Screenshot of an attachment with a title


This is the main text in a message attachment, and can contain standard message markup. The content will automatically collapse if it contains 700+ characters or 5+ linebreaks, and will display a "Show more..." link to expand the content. Links posted in the text field will not unfurl.

Screenshot of an attachment with a formatted text

You must include either the text or fallback property, otherwise the attachment will not be displayed correctly! The value of each property can be an empty string (" ").


Fields are defined as an array, and hashes contained within it will be displayed in a table inside the message attachment.

  • title

    Shown as a bold heading above the value text. It cannot contain markup and will be escaped for you.

  • value

    The text value of the field. It may contain standard message markup and must be escaped as normal. May be multi-line.

  • short

    An optional flag indicating whether the value is short enough to be displayed side-by-side with other values.

Screenshot of an attachment with some attachment fields


A valid URL to an image file that will be displayed inside a message attachment. We currently support the following formats: GIF, JPEG, PNG, and BMP.

Large images will be resized to a maximum width of 400px or a maximum height of 500px, while still maintaining the original aspect ratio.

Screenshot of an attachment with a large image


A valid URL to an image file that will be displayed as a thumbnail on the right side of a message attachment. We currently support the following formats: GIF, JPEG, PNG, and BMP.

The thumbnail's longest dimension will be scaled down to 75px while maintaining the aspect ratio of the image. The filesize of the image must also be less than 500 KB.

For best results, please use images that are already 75px by 75px.

Screenshot of an attachment with a thumbnail image

Creating attachment footers

Your message attachments may also contain a subtle footer, which is especially useful when citing content in conjunction with author parameters.


Add some brief text to help contextualize and identify an attachment. Limited to 300 characters, and may be truncated further when displayed to users in environments with limited screen real estate.

Screenshot of rendered footer, footer_icon, and ts fields

Example: "Slack API"


To render a small icon beside your footer text, provide a publicly accessible URL string in the footer_icon field. You must also provide a footer for the field to be recognized.

We'll render what you provide at 16px by 16px. It's best to use an image that is similarly sized.

Example: ""

ts (timestamp)

Does your attachment relate to something happening at a specific time?

By providing the ts field with an integer value in "epoch time", the attachment will display an additional timestamp value as part of the attachment's footer.

Use ts when referencing articles or happenings. Your message will have its own timestamp when published.

Example: Providing 123456789 would result in a rendered timestamp of Nov 29th, 1973.

Do you have a Slack app and want your messages to offers users more interactive experiences? Learn about a special kind of attachment, message buttons.

Putting it all together

Using a combination of the provided message attachment parameters, you can create a variety of message layouts to suit your needs. Here are a few examples of what's possible:

Example: Groove

Screenshot of a groove message

    "attachments": [
            "fallback": "New ticket from Andrea Lee - Ticket #1943: Can't reset my password - https://groove.hq/path/to/ticket/1943",
            "pretext": "New ticket from Andrea Lee",
            "title": "Ticket #1943: Can't reset my password",
            "title_link": "https://groove.hq/path/to/ticket/1943",
            "text": "Help! I tried to reset my password but nothing happened!",
            "color": "#7CD197"

Try it!

Example: Honeybadger

Screenshot of a honeybadger message

    "attachments": [
            "fallback": "ReferenceError - UI is not defined:",
            "text": "<|ReferenceError> - UI is not defined",
            "fields": [
                    "title": "Project",
                    "value": "Awesome Project",
                    "short": true
                    "title": "Environment",
                    "value": "production",
                    "short": true
            "color": "#F35A00"

Try it!

Example: Datadog

Screenshot of a datadog message

    "attachments": [
            "fallback": "Network traffic (kb/s): How does this look? @slack-ops - Sent by Julie Dodd -",
            "title": "Network traffic (kb/s)",
            "title_link": "",
            "text": "How does this look? @slack-ops - Sent by Julie Dodd",
            "image_url": "",
            "color": "#764FA5"

Try it!

Making messages interactive with buttons, menus, and dialogs

Manage workflows by adding interactive features like buttons, menus, and dialogs to your messages.

First interaction with message buttons

Attaching link buttons to a message

Decisively direct users to perform actions on external websites using link buttons.

An example travel approval flow with link buttons

Link buttons are a kind of message attachment action similar to those used in interactive messages.

They're just links that look like buttons.

Button attachment format

A message attachment may contain 1 to 5 actions, each with their type set to button and including a url attribute pointing to the link's destination.

Unlike message buttons, link buttons don't dispatch actions to your interactive components request URL. Use chat.update to update the original message as needed.

Attach link buttons to messages sent via incoming webhooks, chat.postMessage, chat.postEphemeral, or as part of interactive messages or slash commands.


This example demonstrates an offsite travel approval workflow, with buttons linking to another website.

  "text": "<@W1A2BC3DD> approved your travel request. Book any airline you like by continuing below.",
  "channel": "C061EG9SL",
  "attachments": [
      "fallback": "Book your flights at",
      "actions": [
          "type": "button",
          "name": "travel_request_123456",
          "text": "Book flights šŸ›«",
          "url": "",
          "style": "primary"
          "type": "button",
          "name": "travel_cancel_123456",
          "text": "Cancel travel request",
          "url": "",
          "style": "danger"

View in Message Builder

When users click Book flights, they'll be taken to using their preferred web browser. Clicking Cancel travel request will open an alternate URL.

Attachment fields

All fields are required when using link buttons unless noted.

  • fallback - String - This required field describes the experience to users without access to link buttons. Include some text and the destination URL in plain text.
  • actions - Array of action objects - Include up to five buttons in this array of action fields

Action fields

All fields are required when using link buttons unless noted.

  • type - String - Provide button to tell Slack you want to render a button.
  • text - String - A UTF-8 string label for this button. Be brief but descriptive and actionable.
  • url - String - The fully qualified http or https URL to deliver users to. Invalid URLs will result in a message posted with the button omitted .
  • style - String - Optional - Setting to primary turns the button green and indicates the best forward action to take. Providing danger turns the button red and indicates it some kind of destructive action. Use sparingly. Be default, buttons will use the UI's default text color.
  • name - String - Optional - A short string naming the button.

Best practices

Use link buttons responsibly by following these practices:

  • Don't surprise users. When context is unclear, include your site's domain in the button text.
  • Though these links resemble buttons, users will be sent to the URL with a HTTP GET. HTTP GETs should be idempotent and not result in write activity.
  • Confirm actions in your application's UI before committing.
  • Sign users in to your product or service before displaying privileged content.
  • Do not include private information or tokens in link button URLs.
  • Include a meaningful fallback describing what users should do if they cannot access buttons.

Attaching link content to messages

Slack automatically scans URLs found in messages and creates message attachments based on the content it finds in those URLs. We call this functionality "unfurling".

Slack apps can also subscribe to link domains and provide custom unfurl behavior — even allowing protected resources to unfurl. Another powerful capability is initiating interactive workflows from the mere mention of a link.

Read more in our dedicated guide to link unfurling.