Skip to main content

Image element

Example:

An example of an image element

Fields

FieldTypeDescriptionRequired?
typeStringThe type of element. In this case type is always image.Required
alt_textStringA plain-text summary of the image. This should not contain any markup.Required
image_urlStringThe URL for a publicly hosted image. You must provide either an image_url or slack_file. Maximum length for this field is 3000 characters.Optional
slack_fileObjectA Slack image file object that defines the source of the image.Optional

Usage info

Use the image block if you want a block with only an image in it.

Example

{
"type": "image",
"image_url": "http://placekitten.com/700/500",
"alt_text": "Multiple cute kittens"
}

An image block using slack_file with a url:

{
"type": "image",
"slack_file": {
"url": "https://files.slack.com/files-pri/T0123456-F0123456/xyz.png"
},
"alt_text": "Slack file object."
}

An image block using slack_file with a id:

{
"type": "image",
"slack_file": {
"id": "F0123456",
},
"alt_text": "Slack file object."
}