Skip to main content

Blocks

This page documents the Ruby API for blocks. Values use keyword-only construction, validate before freezing, and serialize to Slack JSON.

ActionsBlock​

A block that holds interactive elements such as buttons and menus.

See the Slack reference.

.new​

Construct an immutable, validated value with keyword arguments. Required keywords: elements.

def self.new: (elements: Array[Element], ?block_id: (String)?, ?additional_fields: Hash[String | Symbol, untyped]?) -> ActionsBlock
ParameterDescription
elementsAdds interactive elements in display order.
block_idSets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.
additional_fieldsJSON-compatible extension fields that do not replace modeled wire keys.

Returns: ActionsBlock

ThrowsWhen
ValidationErrorA field or cross-field Slack rule fails.

Related types: ActionsBlock, Element

.[]

Keyword-only alias for .new.

def self.[]: (elements: Array[Element], ?block_id: (String)?, ?additional_fields: Hash[String | Symbol, untyped]?) -> ActionsBlock

Returns: ActionsBlock

Related types: ActionsBlock, Element

elements​

Adds interactive elements in display order. Wire key: elements.

def elements: () -> Array[Element]

Returns: Array[Element]

Related types: Element

block_id​

Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again. Wire key: block_id.

def block_id: () -> (String)?

Returns: (String)?

additional_fields​

Return frozen extension fields with normalized string keys.

def additional_fields: () -> Hash[String, untyped]

with​

Return a newly validated value with changed keywords.

def with: (**untyped changes) -> ActionsBlock

Returns: ActionsBlock

Related types: ActionsBlock

to_h​

Return structural Ruby members, including additional_fields. Nested members remain frozen.

def to_h: () -> Hash[Symbol, untyped]

as_json​

Return a fresh, detached Slack wire Hash.

def as_json: (?untyped options) -> Hash[String, untyped]

to_json​

Encode the Slack wire payload as JSON.

def to_json: (?untyped options) -> String

AlertBlock​

A severity-labelled alert, available in modals.

See the Slack reference.

.new​

Construct an immutable, validated value with keyword arguments. Required keywords: text.

def self.new: (text: String | Text, ?level: (:default | :info | :warning | :error | :success)?, ?block_id: (String)?, ?additional_fields: Hash[String | Symbol, untyped]?) -> AlertBlock
ParameterDescription
textSets the alert message.
levelSets the alert severity, which controls its color and icon.
block_idSets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.
additional_fieldsJSON-compatible extension fields that do not replace modeled wire keys.

Returns: AlertBlock

ThrowsWhen
ValidationErrorA field or cross-field Slack rule fails.

Related types: AlertBlock, Text

.[]​

Keyword-only alias for .new.

def self.[]: (text: String | Text, ?level: (:default | :info | :warning | :error | :success)?, ?block_id: (String)?, ?additional_fields: Hash[String | Symbol, untyped]?) -> AlertBlock

Returns: AlertBlock

Related types: AlertBlock, Text

text​

Sets the alert message. Wire key: text.

def text: () -> Text

Returns: Text

Related types: Text

level​

Sets the alert severity, which controls its color and icon. Wire key: level.

def level: () -> (:default | :info | :warning | :error | :success)?

Returns: (:default | :info | :warning | :error | :success)?

block_id​

Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again. Wire key: block_id.

def block_id: () -> (String)?

Returns: (String)?

additional_fields​

Return frozen extension fields with normalized string keys.

def additional_fields: () -> Hash[String, untyped]

with​

Return a newly validated value with changed keywords.

def with: (**untyped changes) -> AlertBlock

Returns: AlertBlock

Related types: AlertBlock

to_h​

Return structural Ruby members, including additional_fields. Nested members remain frozen.

def to_h: () -> Hash[Symbol, untyped]

as_json​

Return a fresh, detached Slack wire Hash.

def as_json: (?untyped options) -> Hash[String, untyped]

to_json​

Encode the Slack wire payload as JSON.

def to_json: (?untyped options) -> String

AlertLevel​

Severity levels supported by alert blocks. Pass the wire symbol to constructor keywords.

ConstantSlack valueMeaning
DEFAULT:defaultNeutral styling.
INFO:infoInformational styling.
WARNING:warningWarning styling.
ERROR:errorError styling.
SUCCESS:successSuccess styling.

Block​

A validated Slack layout block accepted by payload block arrays.

CardBlock​

A compact card with an image, text, and up to three buttons.

See the Slack reference.

.new​

Construct an immutable, validated value with keyword arguments.

def self.new: (?hero_image: (ImageElement)?, ?icon: (ImageElement)?, ?title: (String | Text)?, ?subtitle: (String | Text)?, ?body: (String | Text)?, ?actions: (Array[ButtonElement])?, ?slack_icon: (SlackIcon)?, ?subtext: (String | Text)?, ?block_id: (String)?, ?additional_fields: Hash[String | Symbol, untyped]?) -> CardBlock
ParameterDescription
hero_imageSets the image displayed prominently at the top of the card.
iconSets the image displayed beside the title.
titleSets the card title.
subtitleSets the supporting text shown below the title.
bodySets the main body text of the card.
actionsAdds buttons displayed at the bottom of the card, in display order.
slack_iconSets a Slack-provided icon displayed beside the title. Cannot be combined with an image icon.
subtextSets the small print shown at the bottom of the card.
block_idSets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.
additional_fieldsJSON-compatible extension fields that do not replace modeled wire keys.

Returns: CardBlock

ThrowsWhen
ValidationErrorA field or cross-field Slack rule fails.

Related types: ButtonElement, CardBlock, ImageElement, SlackIcon, Text

.[]​

Keyword-only alias for .new.

def self.[]: (?hero_image: (ImageElement)?, ?icon: (ImageElement)?, ?title: (String | Text)?, ?subtitle: (String | Text)?, ?body: (String | Text)?, ?actions: (Array[ButtonElement])?, ?slack_icon: (SlackIcon)?, ?subtext: (String | Text)?, ?block_id: (String)?, ?additional_fields: Hash[String | Symbol, untyped]?) -> CardBlock

Returns: CardBlock

Related types: ButtonElement, CardBlock, ImageElement, SlackIcon, Text

hero_image​

Sets the image displayed prominently at the top of the card. Wire key: hero_image.

def hero_image: () -> (ImageElement)?

Returns: (ImageElement)?

Related types: ImageElement

icon​

Sets the image displayed beside the title. Wire key: icon.

def icon: () -> (ImageElement)?

Returns: (ImageElement)?

Related types: ImageElement

title​

Sets the card title. Wire key: title.

def title: () -> (Text)?

Returns: (Text)?

Related types: Text

subtitle​

Sets the supporting text shown below the title. Wire key: subtitle.

def subtitle: () -> (Text)?

Returns: (Text)?

Related types: Text

body​

Sets the main body text of the card. Wire key: body.

def body: () -> (Text)?

Returns: (Text)?

Related types: Text

actions​

Adds buttons displayed at the bottom of the card, in display order. Wire key: actions.

def actions: () -> (Array[ButtonElement])?

Returns: (Array[ButtonElement])?

Related types: ButtonElement

slack_icon​

Sets a Slack-provided icon displayed beside the title. Cannot be combined with an image icon. Wire key: slack_icon.

def slack_icon: () -> (SlackIcon)?

Returns: (SlackIcon)?

Related types: SlackIcon

subtext​

Sets the small print shown at the bottom of the card. Wire key: subtext.

def subtext: () -> (Text)?

Returns: (Text)?

Related types: Text

block_id​

Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again. Wire key: block_id.

def block_id: () -> (String)?

Returns: (String)?

additional_fields​

Return frozen extension fields with normalized string keys.

def additional_fields: () -> Hash[String, untyped]

with​

Return a newly validated value with changed keywords.

def with: (**untyped changes) -> CardBlock

Returns: CardBlock

Related types: CardBlock

to_h​

Return structural Ruby members, including additional_fields. Nested members remain frozen.

def to_h: () -> Hash[Symbol, untyped]

as_json​

Return a fresh, detached Slack wire Hash.

def as_json: (?untyped options) -> Hash[String, untyped]

to_json​

Encode the Slack wire payload as JSON.

def to_json: (?untyped options) -> String

CarouselBlock​

A horizontally scrolling set of cards, available in messages and App Home.

See the Slack reference.

.new​

Construct an immutable, validated value with keyword arguments. Required keywords: elements.

def self.new: (elements: Array[CardBlock], ?block_id: (String)?, ?additional_fields: Hash[String | Symbol, untyped]?) -> CarouselBlock
ParameterDescription
elementsAdds the cards in display order.
block_idSets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.
additional_fieldsJSON-compatible extension fields that do not replace modeled wire keys.

Returns: CarouselBlock

ThrowsWhen
ValidationErrorA field or cross-field Slack rule fails.

Related types: CardBlock, CarouselBlock

.[]​

Keyword-only alias for .new.

def self.[]: (elements: Array[CardBlock], ?block_id: (String)?, ?additional_fields: Hash[String | Symbol, untyped]?) -> CarouselBlock

Returns: CarouselBlock

Related types: CardBlock, CarouselBlock

elements​

Adds the cards in display order. Wire key: elements.

def elements: () -> Array[CardBlock]

Returns: Array[CardBlock]

Related types: CardBlock

block_id​

Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again. Wire key: block_id.

def block_id: () -> (String)?

Returns: (String)?

additional_fields​

Return frozen extension fields with normalized string keys.

def additional_fields: () -> Hash[String, untyped]

with​

Return a newly validated value with changed keywords.

def with: (**untyped changes) -> CarouselBlock

Returns: CarouselBlock

Related types: CarouselBlock

to_h​

Return structural Ruby members, including additional_fields. Nested members remain frozen.

def to_h: () -> Hash[Symbol, untyped]

as_json​

Return a fresh, detached Slack wire Hash.

def as_json: (?untyped options) -> Hash[String, untyped]

to_json​

Encode the Slack wire payload as JSON.

def to_json: (?untyped options) -> String

ContainerBlock​

A titled group of blocks that can optionally collapse.

See the Slack reference.

.new​

Construct an immutable, validated value with keyword arguments. Required keywords: child_blocks.

def self.new: (child_blocks: Array[Block], ?title: (String | PlainText)?, ?rich_text_title: (RichTextBlock)?, ?subtitle: (String | Text)?, ?width: (:narrow | :standard | :wide | :full)?, ?icon: (ImageElement)?, ?is_collapsible: (bool)?, ?default_collapsed: (bool)?, ?has_header_divider: (bool)?, ?block_id: (String)?, ?additional_fields: Hash[String | Symbol, untyped]?) -> ContainerBlock
ParameterDescription
child_blocksAdds the blocks grouped inside the container, in display order.
titleSets the container title. Provide either a title or a rich text title.
rich_text_titleSets a rich text block used as the title in place of a plain-text title.
subtitleSets the supporting text shown below the title.
widthSets the horizontal width of the container.
iconSets the image displayed beside the title.
is_collapsibleSets whether users can collapse and expand the container.
default_collapsedSets whether a collapsible container starts collapsed. Requires the container to be collapsible.
has_header_dividerSets whether Slack draws a divider below the container header. Only valid for non-collapsible containers.
block_idSets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.
additional_fieldsJSON-compatible extension fields that do not replace modeled wire keys.

Returns: ContainerBlock

ThrowsWhen
ValidationErrorA field or cross-field Slack rule fails.

Related types: Block, ContainerBlock, ImageElement, PlainText, RichTextBlock, Text

.[]​

Keyword-only alias for .new.

def self.[]: (child_blocks: Array[Block], ?title: (String | PlainText)?, ?rich_text_title: (RichTextBlock)?, ?subtitle: (String | Text)?, ?width: (:narrow | :standard | :wide | :full)?, ?icon: (ImageElement)?, ?is_collapsible: (bool)?, ?default_collapsed: (bool)?, ?has_header_divider: (bool)?, ?block_id: (String)?, ?additional_fields: Hash[String | Symbol, untyped]?) -> ContainerBlock

Returns: ContainerBlock

Related types: Block, ContainerBlock, ImageElement, PlainText, RichTextBlock, Text

child_blocks​

Adds the blocks grouped inside the container, in display order. Wire key: child_blocks.

def child_blocks: () -> Array[Block]

Returns: Array[Block]

Related types: Block

title​

Sets the container title. Provide either a title or a rich text title. Wire key: title.

def title: () -> (PlainText)?

Returns: (PlainText)?

Related types: PlainText

rich_text_title​

Sets a rich text block used as the title in place of a plain-text title. Wire key: rich_text_title.

def rich_text_title: () -> (RichTextBlock)?

Returns: (RichTextBlock)?

Related types: RichTextBlock

subtitle​

Sets the supporting text shown below the title. Wire key: subtitle.

def subtitle: () -> (Text)?

Returns: (Text)?

Related types: Text

width​

Sets the horizontal width of the container. Wire key: width.

def width: () -> (:narrow | :standard | :wide | :full)?

Returns: (:narrow | :standard | :wide | :full)?

icon​

Sets the image displayed beside the title. Wire key: icon.

def icon: () -> (ImageElement)?

Returns: (ImageElement)?

Related types: ImageElement

is_collapsible​

Sets whether users can collapse and expand the container. Wire key: is_collapsible.

def is_collapsible: () -> (bool)?

Returns: (bool)?

default_collapsed​

Sets whether a collapsible container starts collapsed. Requires the container to be collapsible. Wire key: default_collapsed.

def default_collapsed: () -> (bool)?

Returns: (bool)?

has_header_divider​

Sets whether Slack draws a divider below the container header. Only valid for non-collapsible containers. Wire key: has_header_divider.

def has_header_divider: () -> (bool)?

Returns: (bool)?

block_id​

Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again. Wire key: block_id.

def block_id: () -> (String)?

Returns: (String)?

additional_fields​

Return frozen extension fields with normalized string keys.

def additional_fields: () -> Hash[String, untyped]

with​

Return a newly validated value with changed keywords.

def with: (**untyped changes) -> ContainerBlock

Returns: ContainerBlock

Related types: ContainerBlock

to_h​

Return structural Ruby members, including additional_fields. Nested members remain frozen.

def to_h: () -> Hash[Symbol, untyped]

as_json​

Return a fresh, detached Slack wire Hash.

def as_json: (?untyped options) -> Hash[String, untyped]

to_json​

Encode the Slack wire payload as JSON.

def to_json: (?untyped options) -> String

ContainerWidth​

Widths supported by Slack container blocks. Pass the wire symbol to constructor keywords.

ConstantSlack valueMeaning
NARROW:narrowA compact container.
STANDARD:standardSlack's standard container width.
WIDE:wideA wide container.
FULL:fullThe full available width.

ContextActionsBlock​

A row of feedback or icon buttons, usually shown below AI-generated content.

See the Slack reference.

.new​

Construct an immutable, validated value with keyword arguments. Required keywords: elements.

def self.new: (elements: Array[ContextActionsElement], ?block_id: (String)?, ?additional_fields: Hash[String | Symbol, untyped]?) -> ContextActionsBlock
ParameterDescription
elementsAdds feedback buttons or icon buttons in display order.
block_idSets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.
additional_fieldsJSON-compatible extension fields that do not replace modeled wire keys.

Returns: ContextActionsBlock

ThrowsWhen
ValidationErrorA field or cross-field Slack rule fails.

Related types: ContextActionsBlock, ContextActionsElement

.[]​

Keyword-only alias for .new.

def self.[]: (elements: Array[ContextActionsElement], ?block_id: (String)?, ?additional_fields: Hash[String | Symbol, untyped]?) -> ContextActionsBlock

Returns: ContextActionsBlock

Related types: ContextActionsBlock, ContextActionsElement

elements​

Adds feedback buttons or icon buttons in display order. Wire key: elements.

def elements: () -> Array[ContextActionsElement]

Returns: Array[ContextActionsElement]

Related types: ContextActionsElement

block_id​

Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again. Wire key: block_id.

def block_id: () -> (String)?

Returns: (String)?

additional_fields​

Return frozen extension fields with normalized string keys.

def additional_fields: () -> Hash[String, untyped]

with​

Return a newly validated value with changed keywords.

def with: (**untyped changes) -> ContextActionsBlock

Returns: ContextActionsBlock

Related types: ContextActionsBlock

to_h​

Return structural Ruby members, including additional_fields. Nested members remain frozen.

def to_h: () -> Hash[Symbol, untyped]

as_json​

Return a fresh, detached Slack wire Hash.

def as_json: (?untyped options) -> Hash[String, untyped]

to_json​

Encode the Slack wire payload as JSON.

def to_json: (?untyped options) -> String

ContextActionsElement​

A value that can appear in a context actions block: feedback buttons or an icon button.

ContextBlock​

A block of small, secondary images and text.

See the Slack reference.

.new​

Construct an immutable, validated value with keyword arguments. Required keywords: elements.

def self.new: (elements: Array[ContextElement], ?block_id: (String)?, ?additional_fields: Hash[String | Symbol, untyped]?) -> ContextBlock
ParameterDescription
elementsAdds images and text in display order.
block_idSets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.
additional_fieldsJSON-compatible extension fields that do not replace modeled wire keys.

Returns: ContextBlock

ThrowsWhen
ValidationErrorA field or cross-field Slack rule fails.

Related types: ContextBlock, ContextElement

.[]​

Keyword-only alias for .new.

def self.[]: (elements: Array[ContextElement], ?block_id: (String)?, ?additional_fields: Hash[String | Symbol, untyped]?) -> ContextBlock

Returns: ContextBlock

Related types: ContextBlock, ContextElement

elements​

Adds images and text in display order. Wire key: elements.

def elements: () -> Array[ContextElement]

Returns: Array[ContextElement]

Related types: ContextElement

block_id​

Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again. Wire key: block_id.

def block_id: () -> (String)?

Returns: (String)?

additional_fields​

Return frozen extension fields with normalized string keys.

def additional_fields: () -> Hash[String, untyped]

with​

Return a newly validated value with changed keywords.

def with: (**untyped changes) -> ContextBlock

Returns: ContextBlock

Related types: ContextBlock

to_h​

Return structural Ruby members, including additional_fields. Nested members remain frozen.

def to_h: () -> Hash[Symbol, untyped]

as_json​

Return a fresh, detached Slack wire Hash.

def as_json: (?untyped options) -> Hash[String, untyped]

to_json​

Encode the Slack wire payload as JSON.

def to_json: (?untyped options) -> String

ContextElement​

A value that can appear in a context block: an image element or a text object.

DataTableBlock​

A sortable, paginated table of raw text, numbers, and rich text.

See the Slack reference.

.new​

Construct an immutable, validated value with keyword arguments. Required keywords: rows, caption.

def self.new: (rows: Array[Array[DataTableCell]], caption: String, ?page_size: (Integer)?, ?row_header_column_index: (Integer)?, ?block_id: (String)?, ?additional_fields: Hash[String | Symbol, untyped]?) -> DataTableBlock
ParameterDescription
rowsAdds complete table rows in display order. Every row must have the same number of cells.
captionSets the caption that describes the table's contents.
page_sizeSets how many rows Slack shows per page.
row_header_column_indexSets the zero-based index of the column whose cells act as row headers.
block_idSets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.
additional_fieldsJSON-compatible extension fields that do not replace modeled wire keys.

Returns: DataTableBlock

ThrowsWhen
ValidationErrorA field or cross-field Slack rule fails.

Related types: DataTableBlock, DataTableCell

.[]​

Keyword-only alias for .new.

def self.[]: (rows: Array[Array[DataTableCell]], caption: String, ?page_size: (Integer)?, ?row_header_column_index: (Integer)?, ?block_id: (String)?, ?additional_fields: Hash[String | Symbol, untyped]?) -> DataTableBlock

Returns: DataTableBlock

Related types: DataTableBlock, DataTableCell

rows​

Adds complete table rows in display order. Every row must have the same number of cells. Wire key: rows.

def rows: () -> Array[Array[DataTableCell]]

Returns: Array[Array[DataTableCell]]

Related types: DataTableCell

caption​

Sets the caption that describes the table's contents. Wire key: caption.

def caption: () -> String

Returns: String

page_size​

Sets how many rows Slack shows per page. Wire key: page_size.

def page_size: () -> (Integer)?

Returns: (Integer)?

row_header_column_index​

Sets the zero-based index of the column whose cells act as row headers. Wire key: row_header_column_index.

def row_header_column_index: () -> (Integer)?

Returns: (Integer)?

block_id​

Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again. Wire key: block_id.

def block_id: () -> (String)?

Returns: (String)?

additional_fields​

Return frozen extension fields with normalized string keys.

def additional_fields: () -> Hash[String, untyped]

with​

Return a newly validated value with changed keywords.

def with: (**untyped changes) -> DataTableBlock

Returns: DataTableBlock

Related types: DataTableBlock

to_h​

Return structural Ruby members, including additional_fields. Nested members remain frozen.

def to_h: () -> Hash[Symbol, untyped]

as_json​

Return a fresh, detached Slack wire Hash.

def as_json: (?untyped options) -> Hash[String, untyped]

to_json​

Encode the Slack wire payload as JSON.

def to_json: (?untyped options) -> String

DataTableCell​

A value that can appear as a data table cell: raw text, a raw number, or a rich text block.

DataVisualizationBlock​

A titled pie, bar, area, or line chart.

See the Slack reference.

.new​

Construct an immutable, validated value with keyword arguments. Required keywords: title, chart.

def self.new: (title: String, chart: Chart, ?block_id: (String)?, ?additional_fields: Hash[String | Symbol, untyped]?) -> DataVisualizationBlock
ParameterDescription
titleSets the chart title.
chartSets the chart to display.
block_idSets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.
additional_fieldsJSON-compatible extension fields that do not replace modeled wire keys.

Returns: DataVisualizationBlock

ThrowsWhen
ValidationErrorA field or cross-field Slack rule fails.

Related types: Chart, DataVisualizationBlock

.[]​

Keyword-only alias for .new.

def self.[]: (title: String, chart: Chart, ?block_id: (String)?, ?additional_fields: Hash[String | Symbol, untyped]?) -> DataVisualizationBlock

Returns: DataVisualizationBlock

Related types: Chart, DataVisualizationBlock

title​

Sets the chart title. Wire key: title.

def title: () -> String

Returns: String

chart​

Sets the chart to display. Wire key: chart.

def chart: () -> Chart

Returns: Chart

Related types: Chart

block_id​

Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again. Wire key: block_id.

def block_id: () -> (String)?

Returns: (String)?

additional_fields​

Return frozen extension fields with normalized string keys.

def additional_fields: () -> Hash[String, untyped]

with​

Return a newly validated value with changed keywords.

def with: (**untyped changes) -> DataVisualizationBlock

Returns: DataVisualizationBlock

Related types: DataVisualizationBlock

to_h​

Return structural Ruby members, including additional_fields. Nested members remain frozen.

def to_h: () -> Hash[Symbol, untyped]

as_json​

Return a fresh, detached Slack wire Hash.

def as_json: (?untyped options) -> Hash[String, untyped]

to_json​

Encode the Slack wire payload as JSON.

def to_json: (?untyped options) -> String

DividerBlock​

A horizontal rule that separates blocks.

See the Slack reference.

.new​

Construct an immutable, validated value with keyword arguments.

def self.new: (?block_id: (String)?, ?additional_fields: Hash[String | Symbol, untyped]?) -> DividerBlock
ParameterDescription
block_idSets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.
additional_fieldsJSON-compatible extension fields that do not replace modeled wire keys.

Returns: DividerBlock

ThrowsWhen
ValidationErrorA field or cross-field Slack rule fails.

Related types: DividerBlock

.[]​

Keyword-only alias for .new.

def self.[]: (?block_id: (String)?, ?additional_fields: Hash[String | Symbol, untyped]?) -> DividerBlock

Returns: DividerBlock

Related types: DividerBlock

block_id​

Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again. Wire key: block_id.

def block_id: () -> (String)?

Returns: (String)?

additional_fields​

Return frozen extension fields with normalized string keys.

def additional_fields: () -> Hash[String, untyped]

with​

Return a newly validated value with changed keywords.

def with: (**untyped changes) -> DividerBlock

Returns: DividerBlock

Related types: DividerBlock

to_h​

Return structural Ruby members, including additional_fields. Nested members remain frozen.

def to_h: () -> Hash[Symbol, untyped]

as_json​

Return a fresh, detached Slack wire Hash.

def as_json: (?untyped options) -> Hash[String, untyped]

to_json​

Encode the Slack wire payload as JSON.

def to_json: (?untyped options) -> String

FileBlock​

A remote file previously added with the files.remote API.

See the Slack reference.

.new​

Construct an immutable, validated value with keyword arguments. Required keywords: external_id.

def self.new: (external_id: String, ?source: (String)?, ?block_id: (String)?, ?additional_fields: Hash[String | Symbol, untyped]?) -> FileBlock
ParameterDescription
external_idSets the external identifier of a remote file previously added with the files.remote API.
sourceSets the file source. Slack currently supports only remote files.
block_idSets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.
additional_fieldsJSON-compatible extension fields that do not replace modeled wire keys.

Returns: FileBlock

ThrowsWhen
ValidationErrorA field or cross-field Slack rule fails.

Related types: FileBlock

.[]​

Keyword-only alias for .new.

def self.[]: (external_id: String, ?source: (String)?, ?block_id: (String)?, ?additional_fields: Hash[String | Symbol, untyped]?) -> FileBlock

Returns: FileBlock

Related types: FileBlock

external_id​

Sets the external identifier of a remote file previously added with the files.remote API. Wire key: external_id.

def external_id: () -> String

Returns: String

source​

Sets the file source. Slack currently supports only remote files. Wire key: source.

def source: () -> (String)?

Returns: (String)?

block_id​

Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again. Wire key: block_id.

def block_id: () -> (String)?

Returns: (String)?

additional_fields​

Return frozen extension fields with normalized string keys.

def additional_fields: () -> Hash[String, untyped]

with​

Return a newly validated value with changed keywords.

def with: (**untyped changes) -> FileBlock

Returns: FileBlock

Related types: FileBlock

to_h​

Return structural Ruby members, including additional_fields. Nested members remain frozen.

def to_h: () -> Hash[Symbol, untyped]

as_json​

Return a fresh, detached Slack wire Hash.

def as_json: (?untyped options) -> Hash[String, untyped]

to_json​

Encode the Slack wire payload as JSON.

def to_json: (?untyped options) -> String

HeaderBlock​

Large, bold plain text that introduces a group of blocks.

See the Slack reference.

.new​

Construct an immutable, validated value with keyword arguments. Required keywords: text.

def self.new: (text: String | PlainText, ?block_id: (String)?, ?additional_fields: Hash[String | Symbol, untyped]?) -> HeaderBlock
ParameterDescription
textSets the header text, shown in a larger bold font.
block_idSets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.
additional_fieldsJSON-compatible extension fields that do not replace modeled wire keys.

Returns: HeaderBlock

ThrowsWhen
ValidationErrorA field or cross-field Slack rule fails.

Related types: HeaderBlock, PlainText

.[]​

Keyword-only alias for .new.

def self.[]: (text: String | PlainText, ?block_id: (String)?, ?additional_fields: Hash[String | Symbol, untyped]?) -> HeaderBlock

Returns: HeaderBlock

Related types: HeaderBlock, PlainText

text​

Sets the header text, shown in a larger bold font. Wire key: text.

def text: () -> PlainText

Returns: PlainText

Related types: PlainText

block_id​

Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again. Wire key: block_id.

def block_id: () -> (String)?

Returns: (String)?

additional_fields​

Return frozen extension fields with normalized string keys.

def additional_fields: () -> Hash[String, untyped]

with​

Return a newly validated value with changed keywords.

def with: (**untyped changes) -> HeaderBlock

Returns: HeaderBlock

Related types: HeaderBlock

to_h​

Return structural Ruby members, including additional_fields. Nested members remain frozen.

def to_h: () -> Hash[Symbol, untyped]

as_json​

Return a fresh, detached Slack wire Hash.

def as_json: (?untyped options) -> Hash[String, untyped]

to_json​

Encode the Slack wire payload as JSON.

def to_json: (?untyped options) -> String

ImageBlock​

A standalone image with alternative text and an optional title.

See the Slack reference.

.new​

Construct an immutable, validated value with keyword arguments. Required keywords: alt_text.

def self.new: (?image_url: (String)?, ?slack_file: (SlackFile)?, alt_text: String, ?title: (String | PlainText)?, ?block_id: (String)?, ?additional_fields: Hash[String | Symbol, untyped]?) -> ImageBlock
ParameterDescription
image_urlSets the publicly accessible URL of the image. Cannot be combined with a Slack file.
slack_fileSets a file hosted in Slack as the image source. Cannot be combined with an image URL.
alt_textSets a plain-text summary of the image or video for assistive technology.
titleSets the title shown above the image.
block_idSets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.
additional_fieldsJSON-compatible extension fields that do not replace modeled wire keys.

Returns: ImageBlock

ThrowsWhen
ValidationErrorA field or cross-field Slack rule fails.

Related types: ImageBlock, PlainText, SlackFile

.[]​

Keyword-only alias for .new.

def self.[]: (?image_url: (String)?, ?slack_file: (SlackFile)?, alt_text: String, ?title: (String | PlainText)?, ?block_id: (String)?, ?additional_fields: Hash[String | Symbol, untyped]?) -> ImageBlock

Returns: ImageBlock

Related types: ImageBlock, PlainText, SlackFile

image_url​

Sets the publicly accessible URL of the image. Cannot be combined with a Slack file. Wire key: image_url.

def image_url: () -> (String)?

Returns: (String)?

slack_file​

Sets a file hosted in Slack as the image source. Cannot be combined with an image URL. Wire key: slack_file.

def slack_file: () -> (SlackFile)?

Returns: (SlackFile)?

Related types: SlackFile

alt_text​

Sets a plain-text summary of the image or video for assistive technology. Wire key: alt_text.

def alt_text: () -> String

Returns: String

title​

Sets the title shown above the image. Wire key: title.

def title: () -> (PlainText)?

Returns: (PlainText)?

Related types: PlainText

block_id​

Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again. Wire key: block_id.

def block_id: () -> (String)?

Returns: (String)?

additional_fields​

Return frozen extension fields with normalized string keys.

def additional_fields: () -> Hash[String, untyped]

with​

Return a newly validated value with changed keywords.

def with: (**untyped changes) -> ImageBlock

Returns: ImageBlock

Related types: ImageBlock

to_h​

Return structural Ruby members, including additional_fields. Nested members remain frozen.

def to_h: () -> Hash[Symbol, untyped]

as_json​

Return a fresh, detached Slack wire Hash.

def as_json: (?untyped options) -> Hash[String, untyped]

to_json​

Encode the Slack wire payload as JSON.

def to_json: (?untyped options) -> String

InputBlock​

A labelled input that collects a value in a modal, App Home, or message.

See the Slack reference.

.new​

Construct an immutable, validated value with keyword arguments. Required keywords: label, element.

def self.new: (label: String | PlainText, element: InputElement, ?dispatch_action: (bool)?, ?block_id: (String)?, ?hint: (String | PlainText)?, ?optional: (bool)?, ?additional_fields: Hash[String | Symbol, untyped]?) -> InputBlock
ParameterDescription
labelSets the label shown above the input.
elementSets the input element that collects the user's value.
dispatch_actionSets whether changing the element sends a block_actions payload immediately.
block_idSets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.
hintSets helper text shown below the input.
optionalSets whether the modal can be submitted when this input is empty.
additional_fieldsJSON-compatible extension fields that do not replace modeled wire keys.

Returns: InputBlock

ThrowsWhen
ValidationErrorA field or cross-field Slack rule fails.

Related types: InputBlock, InputElement, PlainText

.[]​

Keyword-only alias for .new.

def self.[]: (label: String | PlainText, element: InputElement, ?dispatch_action: (bool)?, ?block_id: (String)?, ?hint: (String | PlainText)?, ?optional: (bool)?, ?additional_fields: Hash[String | Symbol, untyped]?) -> InputBlock

Returns: InputBlock

Related types: InputBlock, InputElement, PlainText

label​

Sets the label shown above the input. Wire key: label.

def label: () -> PlainText

Returns: PlainText

Related types: PlainText

element​

Sets the input element that collects the user's value. Wire key: element.

def element: () -> InputElement

Returns: InputElement

Related types: InputElement

dispatch_action​

Sets whether changing the element sends a block_actions payload immediately. Wire key: dispatch_action.

def dispatch_action: () -> (bool)?

Returns: (bool)?

block_id​

Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again. Wire key: block_id.

def block_id: () -> (String)?

Returns: (String)?

hint​

Sets helper text shown below the input. Wire key: hint.

def hint: () -> (PlainText)?

Returns: (PlainText)?

Related types: PlainText

optional​

Sets whether the modal can be submitted when this input is empty. Wire key: optional.

def optional: () -> (bool)?

Returns: (bool)?

additional_fields​

Return frozen extension fields with normalized string keys.

def additional_fields: () -> Hash[String, untyped]

with​

Return a newly validated value with changed keywords.

def with: (**untyped changes) -> InputBlock

Returns: InputBlock

Related types: InputBlock

to_h​

Return structural Ruby members, including additional_fields. Nested members remain frozen.

def to_h: () -> Hash[Symbol, untyped]

as_json​

Return a fresh, detached Slack wire Hash.

def as_json: (?untyped options) -> Hash[String, untyped]

to_json​

Encode the Slack wire payload as JSON.

def to_json: (?untyped options) -> String

MarkdownBlock​

Standard markdown rendered by Slack, intended for AI-generated content.

See the Slack reference.

.new​

Construct an immutable, validated value with keyword arguments. Required keywords: text.

def self.new: (text: String, ?block_id: (String)?, ?additional_fields: Hash[String | Symbol, untyped]?) -> MarkdownBlock
ParameterDescription
textSets standard markdown content, which Slack renders directly.
block_idSets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.
additional_fieldsJSON-compatible extension fields that do not replace modeled wire keys.

Returns: MarkdownBlock

ThrowsWhen
ValidationErrorA field or cross-field Slack rule fails.

Related types: MarkdownBlock

.[]​

Keyword-only alias for .new.

def self.[]: (text: String, ?block_id: (String)?, ?additional_fields: Hash[String | Symbol, untyped]?) -> MarkdownBlock

Returns: MarkdownBlock

Related types: MarkdownBlock

text​

Sets standard markdown content, which Slack renders directly. Wire key: text.

def text: () -> String

Returns: String

block_id​

Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again. Wire key: block_id.

def block_id: () -> (String)?

Returns: (String)?

additional_fields​

Return frozen extension fields with normalized string keys.

def additional_fields: () -> Hash[String, untyped]

with​

Return a newly validated value with changed keywords.

def with: (**untyped changes) -> MarkdownBlock

Returns: MarkdownBlock

Related types: MarkdownBlock

to_h​

Return structural Ruby members, including additional_fields. Nested members remain frozen.

def to_h: () -> Hash[Symbol, untyped]

as_json​

Return a fresh, detached Slack wire Hash.

def as_json: (?untyped options) -> Hash[String, untyped]

to_json​

Encode the Slack wire payload as JSON.

def to_json: (?untyped options) -> String

PlanBlock​

A titled sequence of task cards.

See the Slack reference.

.new​

Construct an immutable, validated value with keyword arguments. Required keywords: title, tasks.

def self.new: (title: String, tasks: Array[TaskCardBlock], ?block_id: (String)?, ?additional_fields: Hash[String | Symbol, untyped]?) -> PlanBlock
ParameterDescription
titleSets the plan title.
tasksAdds task cards in display order.
block_idSets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.
additional_fieldsJSON-compatible extension fields that do not replace modeled wire keys.

Returns: PlanBlock

ThrowsWhen
ValidationErrorA field or cross-field Slack rule fails.

Related types: PlanBlock, TaskCardBlock

.[]​

Keyword-only alias for .new.

def self.[]: (title: String, tasks: Array[TaskCardBlock], ?block_id: (String)?, ?additional_fields: Hash[String | Symbol, untyped]?) -> PlanBlock

Returns: PlanBlock

Related types: PlanBlock, TaskCardBlock

title​

Sets the plan title. Wire key: title.

def title: () -> String

Returns: String

tasks​

Adds task cards in display order. Wire key: tasks.

def tasks: () -> Array[TaskCardBlock]

Returns: Array[TaskCardBlock]

Related types: TaskCardBlock

block_id​

Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again. Wire key: block_id.

def block_id: () -> (String)?

Returns: (String)?

additional_fields​

Return frozen extension fields with normalized string keys.

def additional_fields: () -> Hash[String, untyped]

with​

Return a newly validated value with changed keywords.

def with: (**untyped changes) -> PlanBlock

Returns: PlanBlock

Related types: PlanBlock

to_h​

Return structural Ruby members, including additional_fields. Nested members remain frozen.

def to_h: () -> Hash[Symbol, untyped]

as_json​

Return a fresh, detached Slack wire Hash.

def as_json: (?untyped options) -> Hash[String, untyped]

to_json​

Encode the Slack wire payload as JSON.

def to_json: (?untyped options) -> String

RichTextBlock​

Formatted text built from sections, lists, preformatted blocks, and quotes.

See the Slack reference.

.new​

Construct an immutable, validated value with keyword arguments. Required keywords: elements.

def self.new: (elements: Array[RichTextBlockElement], ?block_id: (String)?, ?additional_fields: Hash[String | Symbol, untyped]?) -> RichTextBlock
ParameterDescription
elementsAdds sections, lists, preformatted blocks, and quotes in display order.
block_idSets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.
additional_fieldsJSON-compatible extension fields that do not replace modeled wire keys.

Returns: RichTextBlock

ThrowsWhen
ValidationErrorA field or cross-field Slack rule fails.

Related types: RichTextBlock, RichTextBlockElement

.[]​

Keyword-only alias for .new.

def self.[]: (elements: Array[RichTextBlockElement], ?block_id: (String)?, ?additional_fields: Hash[String | Symbol, untyped]?) -> RichTextBlock

Returns: RichTextBlock

Related types: RichTextBlock, RichTextBlockElement

elements​

Adds sections, lists, preformatted blocks, and quotes in display order. Wire key: elements.

def elements: () -> Array[RichTextBlockElement]

Returns: Array[RichTextBlockElement]

Related types: RichTextBlockElement

block_id​

Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again. Wire key: block_id.

def block_id: () -> (String)?

Returns: (String)?

additional_fields​

Return frozen extension fields with normalized string keys.

def additional_fields: () -> Hash[String, untyped]

with​

Return a newly validated value with changed keywords.

def with: (**untyped changes) -> RichTextBlock

Returns: RichTextBlock

Related types: RichTextBlock

to_h​

Return structural Ruby members, including additional_fields. Nested members remain frozen.

def to_h: () -> Hash[Symbol, untyped]

as_json​

Return a fresh, detached Slack wire Hash.

def as_json: (?untyped options) -> Hash[String, untyped]

to_json​

Encode the Slack wire payload as JSON.

def to_json: (?untyped options) -> String

SectionBlock​

Text, a grid of fields, or both, with an optional accessory element.

See the Slack reference.

.new​

Construct an immutable, validated value with keyword arguments.

def self.new: (?text: (String | Text)?, ?fields: (Array[String | Text])?, ?accessory: (Element)?, ?block_id: (String)?, ?additional_fields: Hash[String | Symbol, untyped]?) -> SectionBlock
ParameterDescription
textSets the main text of the section.
fieldsAdds section fields, shown in a two-column grid, in display order.
accessorySets the element displayed beside the section text.
block_idSets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.
additional_fieldsJSON-compatible extension fields that do not replace modeled wire keys.

Returns: SectionBlock

ThrowsWhen
ValidationErrorA field or cross-field Slack rule fails.

Related types: Element, SectionBlock, Text

.[]​

Keyword-only alias for .new.

def self.[]: (?text: (String | Text)?, ?fields: (Array[String | Text])?, ?accessory: (Element)?, ?block_id: (String)?, ?additional_fields: Hash[String | Symbol, untyped]?) -> SectionBlock

Returns: SectionBlock

Related types: Element, SectionBlock, Text

text​

Sets the main text of the section. Wire key: text.

def text: () -> (Text)?

Returns: (Text)?

Related types: Text

fields​

Adds section fields, shown in a two-column grid, in display order. Wire key: fields.

def fields: () -> (Array[Text])?

Returns: (Array[Text])?

Related types: Text

accessory​

Sets the element displayed beside the section text. Wire key: accessory.

def accessory: () -> (Element)?

Returns: (Element)?

Related types: Element

block_id​

Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again. Wire key: block_id.

def block_id: () -> (String)?

Returns: (String)?

additional_fields​

Return frozen extension fields with normalized string keys.

def additional_fields: () -> Hash[String, untyped]

with​

Return a newly validated value with changed keywords.

def with: (**untyped changes) -> SectionBlock

Returns: SectionBlock

Related types: SectionBlock

to_h​

Return structural Ruby members, including additional_fields. Nested members remain frozen.

def to_h: () -> Hash[Symbol, untyped]

as_json​

Return a fresh, detached Slack wire Hash.

def as_json: (?untyped options) -> Hash[String, untyped]

to_json​

Encode the Slack wire payload as JSON.

def to_json: (?untyped options) -> String

TableBlock​

A simple table of raw text and rich text cells.

See the Slack reference.

.new​

Construct an immutable, validated value with keyword arguments. Required keywords: rows.

def self.new: (rows: Array[Array[TableCell]], ?column_settings: (Array[ColumnSettings])?, ?block_id: (String)?, ?additional_fields: Hash[String | Symbol, untyped]?) -> TableBlock
ParameterDescription
rowsAdds complete table rows in display order.
column_settingsAdds per-column settings in column order. Provide one entry for every column.
block_idSets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.
additional_fieldsJSON-compatible extension fields that do not replace modeled wire keys.

Returns: TableBlock

ThrowsWhen
ValidationErrorA field or cross-field Slack rule fails.

Related types: ColumnSettings, TableBlock, TableCell

.[]​

Keyword-only alias for .new.

def self.[]: (rows: Array[Array[TableCell]], ?column_settings: (Array[ColumnSettings])?, ?block_id: (String)?, ?additional_fields: Hash[String | Symbol, untyped]?) -> TableBlock

Returns: TableBlock

Related types: ColumnSettings, TableBlock, TableCell

rows​

Adds complete table rows in display order. Wire key: rows.

def rows: () -> Array[Array[TableCell]]

Returns: Array[Array[TableCell]]

Related types: TableCell

column_settings​

Adds per-column settings in column order. Provide one entry for every column. Wire key: column_settings.

def column_settings: () -> (Array[ColumnSettings])?

Returns: (Array[ColumnSettings])?

Related types: ColumnSettings

block_id​

Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again. Wire key: block_id.

def block_id: () -> (String)?

Returns: (String)?

additional_fields​

Return frozen extension fields with normalized string keys.

def additional_fields: () -> Hash[String, untyped]

with​

Return a newly validated value with changed keywords.

def with: (**untyped changes) -> TableBlock

Returns: TableBlock

Related types: TableBlock

to_h​

Return structural Ruby members, including additional_fields. Nested members remain frozen.

def to_h: () -> Hash[Symbol, untyped]

as_json​

Return a fresh, detached Slack wire Hash.

def as_json: (?untyped options) -> Hash[String, untyped]

to_json​

Encode the Slack wire payload as JSON.

def to_json: (?untyped options) -> String

TableCell​

A value that can appear as a table block cell: raw text or a rich text block.

TaskCardBlock​

One task with its status, details, output, and sources.

See the Slack reference.

.new​

Construct an immutable, validated value with keyword arguments. Required keywords: task_id, title, status.

def self.new: (task_id: String, title: String, ?details: (RichTextBlock)?, ?output: (RichTextBlock)?, ?sources: (Array[UrlSource])?, status: :pending | :in_progress | :complete | :error, ?block_id: (String)?, ?additional_fields: Hash[String | Symbol, untyped]?) -> TaskCardBlock
ParameterDescription
task_idSets the identifier of the task.
titleSets the task title.
detailsSets a rich text description of the task.
outputSets rich text describing the task's output.
sourcesAdds links to the sources the task used, in display order.
statusSets the task's current state.
block_idSets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.
additional_fieldsJSON-compatible extension fields that do not replace modeled wire keys.

Returns: TaskCardBlock

ThrowsWhen
ValidationErrorA field or cross-field Slack rule fails.

Related types: RichTextBlock, TaskCardBlock, UrlSource

.[]​

Keyword-only alias for .new.

def self.[]: (task_id: String, title: String, ?details: (RichTextBlock)?, ?output: (RichTextBlock)?, ?sources: (Array[UrlSource])?, status: :pending | :in_progress | :complete | :error, ?block_id: (String)?, ?additional_fields: Hash[String | Symbol, untyped]?) -> TaskCardBlock

Returns: TaskCardBlock

Related types: RichTextBlock, TaskCardBlock, UrlSource

task_id​

Sets the identifier of the task. Wire key: task_id.

def task_id: () -> String

Returns: String

title​

Sets the task title. Wire key: title.

def title: () -> String

Returns: String

details​

Sets a rich text description of the task. Wire key: details.

def details: () -> (RichTextBlock)?

Returns: (RichTextBlock)?

Related types: RichTextBlock

output​

Sets rich text describing the task's output. Wire key: output.

def output: () -> (RichTextBlock)?

Returns: (RichTextBlock)?

Related types: RichTextBlock

sources​

Adds links to the sources the task used, in display order. Wire key: sources.

def sources: () -> (Array[UrlSource])?

Returns: (Array[UrlSource])?

Related types: UrlSource

status​

Sets the task's current state. Wire key: status.

def status: () -> :pending | :in_progress | :complete | :error

Returns: :pending | :in_progress | :complete | :error

block_id​

Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again. Wire key: block_id.

def block_id: () -> (String)?

Returns: (String)?

additional_fields​

Return frozen extension fields with normalized string keys.

def additional_fields: () -> Hash[String, untyped]

with​

Return a newly validated value with changed keywords.

def with: (**untyped changes) -> TaskCardBlock

Returns: TaskCardBlock

Related types: TaskCardBlock

to_h​

Return structural Ruby members, including additional_fields. Nested members remain frozen.

def to_h: () -> Hash[Symbol, untyped]

as_json​

Return a fresh, detached Slack wire Hash.

def as_json: (?untyped options) -> Hash[String, untyped]

to_json​

Encode the Slack wire payload as JSON.

def to_json: (?untyped options) -> String

TaskStatus​

States supported by task card blocks. Pass the wire symbol to constructor keywords.

ConstantSlack valueMeaning
PENDING:pendingThe task has not started.
IN_PROGRESS:in_progressThe task is running.
COMPLETE:completeThe task finished successfully.
ERROR:errorThe task failed.

VideoBlock​

An embedded video player.

See the Slack reference.

.new​

Construct an immutable, validated value with keyword arguments. Required keywords: alt_text, thumbnail_url, title, video_url.

def self.new: (alt_text: String, thumbnail_url: String, title: String | PlainText, video_url: String, ?block_id: (String)?, ?author_name: (String)?, ?description: (String | PlainText)?, ?provider_icon_url: (String)?, ?provider_name: (String)?, ?title_url: (String)?, ?additional_fields: Hash[String | Symbol, untyped]?) -> VideoBlock
ParameterDescription
alt_textSets a plain-text summary of the image or video for assistive technology.
thumbnail_urlSets the URL of the image shown before the video plays.
titleSets the video title.
video_urlSets the embeddable URL of the video. The domain must be listed in the app's unfurl domains.
block_idSets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again.
author_nameSets the name of the video's author.
descriptionSets the video description.
provider_icon_urlSets the URL of the video provider's icon.
provider_nameSets the name of the video provider, such as YouTube.
title_urlSets the HTTPS URL opened when the title is clicked.
additional_fieldsJSON-compatible extension fields that do not replace modeled wire keys.

Returns: VideoBlock

ThrowsWhen
ValidationErrorA field or cross-field Slack rule fails.

Related types: PlainText, VideoBlock

.[]​

Keyword-only alias for .new.

def self.[]: (alt_text: String, thumbnail_url: String, title: String | PlainText, video_url: String, ?block_id: (String)?, ?author_name: (String)?, ?description: (String | PlainText)?, ?provider_icon_url: (String)?, ?provider_name: (String)?, ?title_url: (String)?, ?additional_fields: Hash[String | Symbol, untyped]?) -> VideoBlock

Returns: VideoBlock

Related types: PlainText, VideoBlock

alt_text​

Sets a plain-text summary of the image or video for assistive technology. Wire key: alt_text.

def alt_text: () -> String

Returns: String

thumbnail_url​

Sets the URL of the image shown before the video plays. Wire key: thumbnail_url.

def thumbnail_url: () -> String

Returns: String

title​

Sets the video title. Wire key: title.

def title: () -> PlainText

Returns: PlainText

Related types: PlainText

video_url​

Sets the embeddable URL of the video. The domain must be listed in the app's unfurl domains. Wire key: video_url.

def video_url: () -> String

Returns: String

block_id​

Sets a unique identifier for this block. Slack returns it in interaction payloads, so use a stable value when you need to find the block again. Wire key: block_id.

def block_id: () -> (String)?

Returns: (String)?

author_name​

Sets the name of the video's author. Wire key: author_name.

def author_name: () -> (String)?

Returns: (String)?

description​

Sets the video description. Wire key: description.

def description: () -> (PlainText)?

Returns: (PlainText)?

Related types: PlainText

provider_icon_url​

Sets the URL of the video provider's icon. Wire key: provider_icon_url.

def provider_icon_url: () -> (String)?

Returns: (String)?

provider_name​

Sets the name of the video provider, such as YouTube. Wire key: provider_name.

def provider_name: () -> (String)?

Returns: (String)?

title_url​

Sets the HTTPS URL opened when the title is clicked. Wire key: title_url.

def title_url: () -> (String)?

Returns: (String)?

additional_fields​

Return frozen extension fields with normalized string keys.

def additional_fields: () -> Hash[String, untyped]

with​

Return a newly validated value with changed keywords.

def with: (**untyped changes) -> VideoBlock

Returns: VideoBlock

Related types: VideoBlock

to_h​

Return structural Ruby members, including additional_fields. Nested members remain frozen.

def to_h: () -> Hash[Symbol, untyped]

as_json​

Return a fresh, detached Slack wire Hash.

def as_json: (?untyped options) -> Hash[String, untyped]

to_json​

Encode the Slack wire payload as JSON.

def to_json: (?untyped options) -> String